From 4c278aa33b3fd9d90c38f511b85afb4810d4a5ac Mon Sep 17 00:00:00 2001 From: Alexander T Date: Fri, 22 May 2020 15:11:39 +0300 Subject: [PATCH 01/48] fix(34934): exclude private properties from Js completion list --- src/services/completions.ts | 2 +- .../completionsPrivateProperties_Js.ts | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/completionsPrivateProperties_Js.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index 8b9228d3441ad..2eb444d54b7d5 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1235,7 +1235,7 @@ namespace ts.Completions { // each individual type has. This is because we're going to add all identifiers // anyways. So we might as well elevate the members that were at least part // of the individual types to a higher status since we know what they are. - symbols.push(...getPropertiesForCompletion(type, typeChecker)); + symbols.push(...filter(getPropertiesForCompletion(type, typeChecker), s => typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, s))); } else { for (const symbol of type.getApparentProperties()) { diff --git a/tests/cases/fourslash/completionsPrivateProperties_Js.ts b/tests/cases/fourslash/completionsPrivateProperties_Js.ts new file mode 100644 index 0000000000000..cd11b37af95d6 --- /dev/null +++ b/tests/cases/fourslash/completionsPrivateProperties_Js.ts @@ -0,0 +1,20 @@ +/// + +// @allowJs: true +// @Filename: a.d.ts +////declare namespace A { +//// class Foo { +//// constructor(); +//// +//// private m1(): void; +//// protected m2(): void; +//// +//// m3(): void; +//// } +////} + +// @filename: b.js +////let foo = new A.Foo(); +////foo./**/ + +verify.completions({ marker: [""], includes: ["m3"], excludes: ["m1", "m2"] }); From bac046573f822486f5218eb970d289bced09295f Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 14 Apr 2020 13:17:19 -0700 Subject: [PATCH 02/48] add trigger reason to protocol --- src/server/protocol.ts | 10 +++++++++- src/server/session.ts | 2 +- .../refactors/addOrRemoveBracesToArrowFunction.ts | 6 +++--- src/services/services.ts | 7 ++++--- src/services/types.ts | 9 ++++++++- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index b6cc2e4d8fdab..62c81fca2ac8f 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -546,7 +546,15 @@ namespace ts.server.protocol { command: CommandTypes.GetApplicableRefactors; arguments: GetApplicableRefactorsRequestArgs; } - export type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs; + export type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & { + triggerReason?: RefactorTriggerReason; + }; + + export type RefactorTriggerReason = RefactorInvokedReason; + + export interface RefactorInvokedReason { + kind: 'invoked'; + } /** * Response is a list of available refactorings. diff --git a/src/server/session.ts b/src/server/session.ts index 3f0321074a994..780c7ab5085e2 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1970,7 +1970,7 @@ namespace ts.server { private getApplicableRefactors(args: protocol.GetApplicableRefactorsRequestArgs): protocol.ApplicableRefactorInfo[] { const { file, project } = this.getFileAndProject(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file)!; - return project.getLanguageService().getApplicableRefactors(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file)); + return project.getLanguageService().getApplicableRefactors(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file), args.triggerReason); } private getEditsForRefactor(args: protocol.GetEditsForRefactorRequestArgs, simplifiedResult: boolean): RefactorEditInfo | protocol.RefactorEditInfo { diff --git a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts index c7c3a04e8d391..1256de9cfbed1 100644 --- a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts +++ b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts @@ -16,8 +16,8 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { } function getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { - const { file, startPosition } = context; - const info = getConvertibleArrowFunctionAtPosition(file, startPosition); + const { file, startPosition, triggerReason } = context; + const info = getConvertibleArrowFunctionAtPosition(file, startPosition, triggerReason); if (!info) return emptyArray; return [{ @@ -70,7 +70,7 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { return { renameFilename: undefined, renameLocation: undefined, edits }; } - function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number): Info | undefined { + function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number, triggerReason?: RefactorTriggerReason): Info | undefined { const node = getTokenAtPosition(file, startPosition); const func = getContainingFunction(node); if (!func || !isArrowFunction(func) || (!rangeContainsRange(func, node) || rangeContainsRange(func.body, node))) return undefined; diff --git a/src/services/services.ts b/src/services/services.ts index 28cf22ec473d1..5cfeb2b754211 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2140,7 +2140,7 @@ namespace ts { return Rename.getRenameInfo(program, getValidSourceFile(fileName), position, options); } - function getRefactorContext(file: SourceFile, positionOrRange: number | TextRange, preferences: UserPreferences, formatOptions?: FormatCodeSettings): RefactorContext { + function getRefactorContext(file: SourceFile, positionOrRange: number | TextRange, preferences: UserPreferences, formatOptions?: FormatCodeSettings, triggerReason?: RefactorTriggerReason): RefactorContext { const [startPosition, endPosition] = typeof positionOrRange === "number" ? [positionOrRange, undefined] : [positionOrRange.pos, positionOrRange.end]; return { file, @@ -2151,6 +2151,7 @@ namespace ts { formatContext: formatting.getFormatContext(formatOptions!, host), // TODO: GH#18217 cancellationToken, preferences, + triggerReason, }; } @@ -2158,10 +2159,10 @@ namespace ts { return SmartSelectionRange.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName)); } - function getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences = emptyOptions): ApplicableRefactorInfo[] { + function getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences = emptyOptions, triggerReason: RefactorTriggerReason): ApplicableRefactorInfo[] { synchronizeHostData(); const file = getValidSourceFile(fileName); - return refactor.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences)); + return refactor.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, undefined, triggerReason)); } function getEditsForRefactor( diff --git a/src/services/types.ts b/src/services/types.ts index fd8ade8f8e6e1..ff85050def74e 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -475,7 +475,7 @@ namespace ts { /** @deprecated `fileName` will be ignored */ applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; - getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined): ApplicableRefactorInfo[]; + getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined; organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; @@ -741,6 +741,12 @@ namespace ts { commands?: CodeActionCommand[]; } + export type RefactorTriggerReason = RefactorInvokedReason; + + export interface RefactorInvokedReason { + kind: 'invoked'; + } + export interface TextInsertion { newText: string; /** The position in newText the caret should point to after the insertion. */ @@ -1404,5 +1410,6 @@ namespace ts { program: Program; cancellationToken?: CancellationToken; preferences: UserPreferences; + triggerReason?: RefactorTriggerReason; } } From 02fa39a6a99acc9de59ae12e81d078cca9f311fe Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Wed, 15 Apr 2020 13:49:50 -0700 Subject: [PATCH 03/48] enable explicit requests for addOrRemoveBracesToArrowFunction --- src/services/refactors/addOrRemoveBracesToArrowFunction.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts index 1256de9cfbed1..de048b7dbd3f7 100644 --- a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts +++ b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts @@ -38,7 +38,7 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { function getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined { const { file, startPosition } = context; - const info = getConvertibleArrowFunctionAtPosition(file, startPosition); + const info = getConvertibleArrowFunctionAtPosition(file, startPosition, /*triggerReason*/ { kind: "invoked" }); if (!info) return undefined; const { expression, returnStatement, func } = info; @@ -73,7 +73,9 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number, triggerReason?: RefactorTriggerReason): Info | undefined { const node = getTokenAtPosition(file, startPosition); const func = getContainingFunction(node); - if (!func || !isArrowFunction(func) || (!rangeContainsRange(func, node) || rangeContainsRange(func.body, node))) return undefined; + // Only offer a refactor in the function body on explicit refactor requests. + if (!func || !isArrowFunction(func) || (!rangeContainsRange(func, node) + || (rangeContainsRange(func.body, node) && triggerReason?.kind !== "invoked"))) return undefined; if (isExpression(func.body)) { return { From c3828ed08697f91fae0490fd5eb246bff4266d4e Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Wed, 22 Apr 2020 11:01:37 -0700 Subject: [PATCH 04/48] loosen convertExport conditions --- src/services/refactors/convertExport.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/refactors/convertExport.ts b/src/services/refactors/convertExport.ts index 18de048ac6c3e..a3fd2bc114026 100644 --- a/src/services/refactors/convertExport.ts +++ b/src/services/refactors/convertExport.ts @@ -31,7 +31,8 @@ namespace ts.refactor { const { file } = context; const span = getRefactorContextSpan(context); const token = getTokenAtPosition(file, span.start); - const exportNode = getParentNodeInSpan(token, file, span); + // If the span is entirely contained in an export node, check that node. + const exportNode = !!(getModifierFlags(token.parent) & ModifierFlags.Export) ? token.parent : getParentNodeInSpan(token, file, span); if (!exportNode || (!isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent)))) { return undefined; } From 1efcffc9150b9d5e7d8467974377dce7a259d0fc Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 28 Apr 2020 12:24:07 -0700 Subject: [PATCH 05/48] convertImport --- src/services/refactors/convertImport.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/refactors/convertImport.ts b/src/services/refactors/convertImport.ts index 29cefdc3210e3..43120591e6b31 100644 --- a/src/services/refactors/convertImport.ts +++ b/src/services/refactors/convertImport.ts @@ -23,8 +23,8 @@ namespace ts.refactor { const { file } = context; const span = getRefactorContextSpan(context); const token = getTokenAtPosition(file, span.start); - const importDecl = getParentNodeInSpan(token, file, span); - if (!importDecl || !isImportDeclaration(importDecl)) return undefined; + const importDecl = findAncestor(token, isImportDeclaration); + if (!importDecl || !isImportDeclaration(importDecl) || (importDecl.getEnd() < span.start + span.length)) return undefined; const { importClause } = importDecl; return importClause && importClause.namedBindings; } From 0296254a60cd5b58b7b220fe0efe837b0da16125 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 28 Apr 2020 13:13:50 -0700 Subject: [PATCH 06/48] extractType --- src/services/refactors/extractType.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/refactors/extractType.ts b/src/services/refactors/extractType.ts index 560fc5deb684a..544124a7fc970 100644 --- a/src/services/refactors/extractType.ts +++ b/src/services/refactors/extractType.ts @@ -64,7 +64,7 @@ namespace ts.refactor { const current = getTokenAtPosition(file, startPosition); const range = createTextRangeFromSpan(getRefactorContextSpan(context)); - const selection = findAncestor(current, (node => node.parent && rangeContainsSkipTrivia(range, node, file) && !rangeContainsSkipTrivia(range, node.parent, file))); + const selection = findAncestor(current, (node => node.parent && isTypeNode(node) && nodeOverlapsWithStartEnd(current, file, range.pos, range.end) && !rangeContainsSkipTrivia(range, node.parent, file))); if (!selection || !isTypeNode(selection)) return undefined; const checker = context.program.getTypeChecker(); From 55880ee5e04507a9db6622c5af1770111c520ddd Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Wed, 29 Apr 2020 12:19:15 -0700 Subject: [PATCH 07/48] extractType explicitCursorRequest --- src/services/refactors/extractType.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/services/refactors/extractType.ts b/src/services/refactors/extractType.ts index 544124a7fc970..1a22a8065c704 100644 --- a/src/services/refactors/extractType.ts +++ b/src/services/refactors/extractType.ts @@ -6,7 +6,7 @@ namespace ts.refactor { const extractToTypeDef = "Extract to typedef"; registerRefactor(refactorName, { getAvailableActions(context): readonly ApplicableRefactorInfo[] { - const info = getRangeToExtract(context); + const info = getRangeToExtract(context, context.triggerReason); if (!info) return emptyArray; return [{ @@ -22,8 +22,8 @@ namespace ts.refactor { }]; }, getEditsForAction(context, actionName): RefactorEditInfo { - const { file } = context; - const info = Debug.checkDefined(getRangeToExtract(context), "Expected to find a range to extract"); + const { file, } = context; + const info = Debug.checkDefined(getRangeToExtract(context, /*triggerReason*/ { kind: "invoked" }), "Expected to find a range to extract"); const name = getUniqueName("NewType", file); const edits = textChanges.ChangeTracker.with(context, changes => { @@ -58,13 +58,15 @@ namespace ts.refactor { type Info = TypeAliasInfo | InterfaceInfo; - function getRangeToExtract(context: RefactorContext): Info | undefined { + function getRangeToExtract(context: RefactorContext, triggerReason?: RefactorTriggerReason): Info | undefined { const { file, startPosition } = context; const isJS = isSourceFileJS(file); const current = getTokenAtPosition(file, startPosition); const range = createTextRangeFromSpan(getRefactorContextSpan(context)); + const explicitCursorRequest = range.pos === range.end && triggerReason?.kind === "invoked"; - const selection = findAncestor(current, (node => node.parent && isTypeNode(node) && nodeOverlapsWithStartEnd(current, file, range.pos, range.end) && !rangeContainsSkipTrivia(range, node.parent, file))); + const selection = findAncestor(current, (node => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) && + (explicitCursorRequest || nodeOverlapsWithStartEnd(current, file, range.pos, range.end)))); if (!selection || !isTypeNode(selection)) return undefined; const checker = context.program.getTypeChecker(); From 602ee995d0349e3f260d11827c5b122b4774415b Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 5 May 2020 14:32:47 -0700 Subject: [PATCH 08/48] fix lint errors --- src/server/protocol.ts | 2 +- src/services/services.ts | 2 +- src/services/types.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 62c81fca2ac8f..a975b0c9b2d11 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -553,7 +553,7 @@ namespace ts.server.protocol { export type RefactorTriggerReason = RefactorInvokedReason; export interface RefactorInvokedReason { - kind: 'invoked'; + kind: "invoked"; } /** diff --git a/src/services/services.ts b/src/services/services.ts index 5cfeb2b754211..2002af73df9c2 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2162,7 +2162,7 @@ namespace ts { function getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences = emptyOptions, triggerReason: RefactorTriggerReason): ApplicableRefactorInfo[] { synchronizeHostData(); const file = getValidSourceFile(fileName); - return refactor.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, undefined, triggerReason)); + return refactor.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason)); } function getEditsForRefactor( diff --git a/src/services/types.ts b/src/services/types.ts index ff85050def74e..d72060bf51698 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -744,7 +744,7 @@ namespace ts { export type RefactorTriggerReason = RefactorInvokedReason; export interface RefactorInvokedReason { - kind: 'invoked'; + kind: "invoked"; } export interface TextInsertion { From f1127e6e9471bc289fc233a6be240f9dba1cb69c Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Wed, 6 May 2020 14:59:21 -0700 Subject: [PATCH 09/48] extract symbol --- src/services/refactors/extractSymbol.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 8c6c8f6fc698b..8b36c3afb62dd 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -8,7 +8,7 @@ namespace ts.refactor.extractSymbol { * Exported for tests. */ export function getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { - const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context)); + const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context), context.triggerReason); const targetRange = rangeToExtract.targetRange; if (targetRange === undefined) { @@ -87,7 +87,7 @@ namespace ts.refactor.extractSymbol { /* Exported for tests */ export function getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined { - const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context)); + const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context), /* triggerReason*/ { kind: "invoked" }); const targetRange = rangeToExtract.targetRange!; // TODO:GH#18217 const parsedFunctionIndexMatch = /^function_scope_(\d+)$/.exec(actionName); @@ -186,18 +186,20 @@ namespace ts.refactor.extractSymbol { * not shown to the user, but can be used by us diagnostically) */ // exported only for tests - export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan): RangeToExtract { + export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan, triggerReason?: RefactorTriggerReason): RangeToExtract { const { length } = span; - - if (length === 0) { + if (length === 0 && triggerReason?.kind !== "invoked") { return { errors: [createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractEmpty)] }; } + const explicitCursorRequest = length === 0 && triggerReason?.kind === "invoked"; // Walk up starting from the the start position until we find a non-SourceFile node that subsumes the selected span. // This may fail (e.g. you select two statements in the root of a source file) - const start = getParentNodeInSpan(getTokenAtPosition(sourceFile, span.start), sourceFile, span); + const startToken = getTokenAtPosition(sourceFile, span.start); + const start = explicitCursorRequest ? getExtractableParent(startToken): getParentNodeInSpan(startToken, sourceFile, span); // Do the same for the ending position - const end = getParentNodeInSpan(findTokenOnLeftOfPosition(sourceFile, textSpanEnd(span)), sourceFile, span); + const endToken = findTokenOnLeftOfPosition(sourceFile, textSpanEnd(span)); + const end = explicitCursorRequest ? start : getParentNodeInSpan(endToken, sourceFile, span); const declarations: Symbol[] = []; @@ -1832,6 +1834,10 @@ namespace ts.refactor.extractSymbol { } } + function getExtractableParent(node: Node | undefined): Node | undefined { + return findAncestor(node, node => node.parent && isExtractableExpression(node) && !isBinaryExpression(node.parent)); + } + /** * Computes whether or not a node represents an expression in a position where it could * be extracted. From c5343f1d4e9c23906e615f7daeb71c23f20d622c Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Wed, 6 May 2020 15:10:18 -0700 Subject: [PATCH 10/48] update refactorConvertImport_partialSelection --- ...DefaultName.ts => refactorConvertImport_partialSelection.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/cases/fourslash/{refactorConvertImport_notAtDefaultName.ts => refactorConvertImport_partialSelection.ts} (65%) diff --git a/tests/cases/fourslash/refactorConvertImport_notAtDefaultName.ts b/tests/cases/fourslash/refactorConvertImport_partialSelection.ts similarity index 65% rename from tests/cases/fourslash/refactorConvertImport_notAtDefaultName.ts rename to tests/cases/fourslash/refactorConvertImport_partialSelection.ts index 5f62bbb439446..0f703d7436f8d 100644 --- a/tests/cases/fourslash/refactorConvertImport_notAtDefaultName.ts +++ b/tests/cases/fourslash/refactorConvertImport_partialSelection.ts @@ -3,4 +3,4 @@ ////import /*a*/d/*b*/, * as n from "m"; goTo.select("a", "b"); -verify.not.refactorAvailable("Convert import"); +verify.refactorAvailable("Convert import"); From 53e8ed0089774c28e927e623c86e82e8630a67db Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Wed, 6 May 2020 15:21:09 -0700 Subject: [PATCH 11/48] accept new baseline --- tests/baselines/reference/api/tsserverlibrary.d.ts | 14 ++++++++++++-- tests/baselines/reference/api/typescript.d.ts | 6 +++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 70e563b7e1cf7..13492ab6e1313 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5309,7 +5309,7 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise; /** @deprecated `fileName` will be ignored */ applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; - getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined): ApplicableRefactorInfo[]; + getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined; organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; @@ -5531,6 +5531,10 @@ declare namespace ts { renameLocation?: number; commands?: CodeActionCommand[]; } + type RefactorTriggerReason = RefactorInvokedReason; + interface RefactorInvokedReason { + kind: "invoked"; + } interface TextInsertion { newText: string; /** The position in newText the caret should point to after the insertion. */ @@ -6629,7 +6633,13 @@ declare namespace ts.server.protocol { command: CommandTypes.GetApplicableRefactors; arguments: GetApplicableRefactorsRequestArgs; } - type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs; + type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & { + triggerReason?: RefactorTriggerReason; + }; + type RefactorTriggerReason = RefactorInvokedReason; + interface RefactorInvokedReason { + kind: "invoked"; + } /** * Response is a list of available refactorings. * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index b6397f88523d9..001f4d618ee74 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5309,7 +5309,7 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise; /** @deprecated `fileName` will be ignored */ applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; - getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined): ApplicableRefactorInfo[]; + getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined; organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; @@ -5531,6 +5531,10 @@ declare namespace ts { renameLocation?: number; commands?: CodeActionCommand[]; } + type RefactorTriggerReason = RefactorInvokedReason; + interface RefactorInvokedReason { + kind: "invoked"; + } interface TextInsertion { newText: string; /** The position in newText the caret should point to after the insertion. */ From 23f4dc9bd9761e3d2e01d6fab3871e374ef6a981 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Wed, 13 May 2020 16:53:31 -0700 Subject: [PATCH 12/48] use enum for RefactorTriggerReason --- src/server/protocol.ts | 6 ++---- .../refactors/addOrRemoveBracesToArrowFunction.ts | 9 +++++---- src/services/refactors/extractSymbol.ts | 11 ++++++----- src/services/refactors/extractType.ts | 9 +++++---- src/services/types.ts | 7 +++---- src/testRunner/unittests/services/extract/ranges.ts | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index a975b0c9b2d11..58a5988a4bfaa 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -550,10 +550,8 @@ namespace ts.server.protocol { triggerReason?: RefactorTriggerReason; }; - export type RefactorTriggerReason = RefactorInvokedReason; - - export interface RefactorInvokedReason { - kind: "invoked"; + export enum RefactorTriggerReason { + Invoked = "invoked" } /** diff --git a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts index de048b7dbd3f7..3f499a06e7f26 100644 --- a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts +++ b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts @@ -17,7 +17,8 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { function getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { const { file, startPosition, triggerReason } = context; - const info = getConvertibleArrowFunctionAtPosition(file, startPosition, triggerReason); + const forImplicitRequest = triggerReason ? triggerReason === RefactorTriggerReason.Implicit : true; + const info = getConvertibleArrowFunctionAtPosition(file, startPosition, forImplicitRequest); if (!info) return emptyArray; return [{ @@ -38,7 +39,7 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { function getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined { const { file, startPosition } = context; - const info = getConvertibleArrowFunctionAtPosition(file, startPosition, /*triggerReason*/ { kind: "invoked" }); + const info = getConvertibleArrowFunctionAtPosition(file, startPosition); if (!info) return undefined; const { expression, returnStatement, func } = info; @@ -70,12 +71,12 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { return { renameFilename: undefined, renameLocation: undefined, edits }; } - function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number, triggerReason?: RefactorTriggerReason): Info | undefined { + function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number, forImplicitRequest = false): Info | undefined { const node = getTokenAtPosition(file, startPosition); const func = getContainingFunction(node); // Only offer a refactor in the function body on explicit refactor requests. if (!func || !isArrowFunction(func) || (!rangeContainsRange(func, node) - || (rangeContainsRange(func.body, node) && triggerReason?.kind !== "invoked"))) return undefined; + || (rangeContainsRange(func.body, node) && forImplicitRequest))) return undefined; if (isExpression(func.body)) { return { diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 8b36c3afb62dd..b7c535fc44fff 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -8,7 +8,8 @@ namespace ts.refactor.extractSymbol { * Exported for tests. */ export function getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { - const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context), context.triggerReason); + const forImplicitRequest = context.triggerReason ? context.triggerReason === RefactorTriggerReason.Implicit : true; + const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context), forImplicitRequest); const targetRange = rangeToExtract.targetRange; if (targetRange === undefined) { @@ -87,7 +88,7 @@ namespace ts.refactor.extractSymbol { /* Exported for tests */ export function getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined { - const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context), /* triggerReason*/ { kind: "invoked" }); + const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context)); const targetRange = rangeToExtract.targetRange!; // TODO:GH#18217 const parsedFunctionIndexMatch = /^function_scope_(\d+)$/.exec(actionName); @@ -186,12 +187,12 @@ namespace ts.refactor.extractSymbol { * not shown to the user, but can be used by us diagnostically) */ // exported only for tests - export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan, triggerReason?: RefactorTriggerReason): RangeToExtract { + export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan, forImplicitRequest = false): RangeToExtract { const { length } = span; - if (length === 0 && triggerReason?.kind !== "invoked") { + if (length === 0 && forImplicitRequest) { return { errors: [createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractEmpty)] }; } - const explicitCursorRequest = length === 0 && triggerReason?.kind === "invoked"; + const explicitCursorRequest = length === 0 && !forImplicitRequest; // Walk up starting from the the start position until we find a non-SourceFile node that subsumes the selected span. // This may fail (e.g. you select two statements in the root of a source file) diff --git a/src/services/refactors/extractType.ts b/src/services/refactors/extractType.ts index 1a22a8065c704..f442c5e0c0d61 100644 --- a/src/services/refactors/extractType.ts +++ b/src/services/refactors/extractType.ts @@ -6,7 +6,8 @@ namespace ts.refactor { const extractToTypeDef = "Extract to typedef"; registerRefactor(refactorName, { getAvailableActions(context): readonly ApplicableRefactorInfo[] { - const info = getRangeToExtract(context, context.triggerReason); + const forImplicitRequest = context.triggerReason ? context.triggerReason === RefactorTriggerReason.Implicit : true; + const info = getRangeToExtract(context, forImplicitRequest); if (!info) return emptyArray; return [{ @@ -23,7 +24,7 @@ namespace ts.refactor { }, getEditsForAction(context, actionName): RefactorEditInfo { const { file, } = context; - const info = Debug.checkDefined(getRangeToExtract(context, /*triggerReason*/ { kind: "invoked" }), "Expected to find a range to extract"); + const info = Debug.checkDefined(getRangeToExtract(context), "Expected to find a range to extract"); const name = getUniqueName("NewType", file); const edits = textChanges.ChangeTracker.with(context, changes => { @@ -58,12 +59,12 @@ namespace ts.refactor { type Info = TypeAliasInfo | InterfaceInfo; - function getRangeToExtract(context: RefactorContext, triggerReason?: RefactorTriggerReason): Info | undefined { + function getRangeToExtract(context: RefactorContext, forImplicitRequest = false): Info | undefined { const { file, startPosition } = context; const isJS = isSourceFileJS(file); const current = getTokenAtPosition(file, startPosition); const range = createTextRangeFromSpan(getRefactorContextSpan(context)); - const explicitCursorRequest = range.pos === range.end && triggerReason?.kind === "invoked"; + const explicitCursorRequest = range.pos === range.end && !forImplicitRequest; const selection = findAncestor(current, (node => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) && (explicitCursorRequest || nodeOverlapsWithStartEnd(current, file, range.pos, range.end)))); diff --git a/src/services/types.ts b/src/services/types.ts index d72060bf51698..e4878471e6849 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -741,10 +741,9 @@ namespace ts { commands?: CodeActionCommand[]; } - export type RefactorTriggerReason = RefactorInvokedReason; - - export interface RefactorInvokedReason { - kind: "invoked"; + export enum RefactorTriggerReason { + Implicit = "implicit", + Invoked = "invoked", } export interface TextInsertion { diff --git a/src/testRunner/unittests/services/extract/ranges.ts b/src/testRunner/unittests/services/extract/ranges.ts index ab205288b330c..e10ed6cbb914c 100644 --- a/src/testRunner/unittests/services/extract/ranges.ts +++ b/src/testRunner/unittests/services/extract/ranges.ts @@ -7,7 +7,7 @@ namespace ts { if (!selectionRange) { throw new Error(`Test ${s} does not specify selection range`); } - const result = refactor.extractSymbol.getRangeToExtract(file, createTextSpanFromRange(selectionRange)); + const result = refactor.extractSymbol.getRangeToExtract(file, createTextSpanFromRange(selectionRange), /*forImplicitRequest*/ true); assert(result.targetRange === undefined, "failure expected"); const sortedErrors = result.errors!.map(e => e.messageText).sort(); assert.deepEqual(sortedErrors, expectedErrors.sort(), "unexpected errors"); From 57e856b0b42f9e4aa6a3d999e9cbdad7458115d3 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Thu, 14 May 2020 11:31:50 -0700 Subject: [PATCH 13/48] convert export tests --- .../refactorConvertExport_defaultToNamedValidSpans.ts | 9 +++++++++ .../refactorConvertExport_namedToDefaultValidSpans.ts | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts create mode 100644 tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts diff --git a/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts b/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts new file mode 100644 index 0000000000000..6b06450f93dbf --- /dev/null +++ b/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts @@ -0,0 +1,9 @@ +/// + +/////*a1*/ex/*a2*/port def/*a3*//*b3*/ault functio/*b2*/n f() {}/*b1*/ + +// verify that the refactor is offered for full, partial, and empty spans. +for (const m of ["1", "2", "3"]) { + goTo.select("a" + m, "b" + m); + verify.refactorAvailable("Convert export", "Convert default export to named export"); +} diff --git a/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts b/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts new file mode 100644 index 0000000000000..f32d1514e9d68 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts @@ -0,0 +1,9 @@ +/// + +/////*a1*/ex/*a2*/port f/*a3*//*b3*/unctio/*b2*/n f() {}/*b1*/ + +// verify that the refactor is offered for full, partial, and empty spans. +for (const m of ["1", "2", "3"]) { + goTo.select("a" + m, "b" + m); + verify.refactorAvailable("Convert export", "Convert named export to default export"); +} From 665e434832f652c76c34e093a439adbb55cafab0 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Thu, 14 May 2020 11:53:43 -0700 Subject: [PATCH 14/48] convert import tests --- ...refactorConvertImport_namedToNamespaceValidSpans.ts | 9 +++++++++ ...refactorConvertImport_namespaceToNamedValidSpans.ts | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts create mode 100644 tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts diff --git a/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts b/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts new file mode 100644 index 0000000000000..0847e5d5744b8 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts @@ -0,0 +1,9 @@ +/// + +/////*a1*/im/*a2*/port { /*a3*//*b3*/x, y as z, T } fro/*b2*/m "m";/*b1*/ + +// verify that the refactor is offered for full, partial, and empty spans. +for (const m of ["1", "2", "3"]) { + goTo.select("a" + m, "b" + m); + verify.refactorAvailable("Convert import", "Convert named imports to namespace import"); +} diff --git a/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts b/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts new file mode 100644 index 0000000000000..768d05282c017 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts @@ -0,0 +1,10 @@ +/// + +/////*a1*/im/*a2*/port * as /*a3*//*b3*/m from "m/*b2*/";/*b1*/ + +// verify that the refactor is offered for full, partial, and empty spans. +for (const m of ["1", "2", "3"]) { + goTo.select("a" + m, "b" + m); + verify.refactorAvailable("Convert import", "Convert namespace import to named imports"); +} + From 23e00644f466e322d2058d24feb296b8e5bee877 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Thu, 14 May 2020 14:49:35 -0700 Subject: [PATCH 15/48] accept new baseline --- tests/baselines/reference/api/tsserverlibrary.d.ts | 11 +++++------ tests/baselines/reference/api/typescript.d.ts | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 13492ab6e1313..14f27cab8e50d 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5531,9 +5531,9 @@ declare namespace ts { renameLocation?: number; commands?: CodeActionCommand[]; } - type RefactorTriggerReason = RefactorInvokedReason; - interface RefactorInvokedReason { - kind: "invoked"; + enum RefactorTriggerReason { + Implicit = "implicit", + Invoked = "invoked" } interface TextInsertion { newText: string; @@ -6636,9 +6636,8 @@ declare namespace ts.server.protocol { type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & { triggerReason?: RefactorTriggerReason; }; - type RefactorTriggerReason = RefactorInvokedReason; - interface RefactorInvokedReason { - kind: "invoked"; + enum RefactorTriggerReason { + Invoked = "invoked" } /** * Response is a list of available refactorings. diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 001f4d618ee74..91dad9f4fc178 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5531,9 +5531,9 @@ declare namespace ts { renameLocation?: number; commands?: CodeActionCommand[]; } - type RefactorTriggerReason = RefactorInvokedReason; - interface RefactorInvokedReason { - kind: "invoked"; + enum RefactorTriggerReason { + Implicit = "implicit", + Invoked = "invoked" } interface TextInsertion { newText: string; From f3751fbdf3034d4ccc760753e689b401c2fdbce6 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Thu, 21 May 2020 16:08:19 -0700 Subject: [PATCH 16/48] change type of RefactorTriggerReason --- src/harness/fourslashImpl.ts | 16 ++++++++-------- src/harness/fourslashInterfaceImpl.ts | 6 +++++- src/server/protocol.ts | 6 ++---- .../addOrRemoveBracesToArrowFunction.ts | 2 +- src/services/refactors/extractSymbol.ts | 2 +- src/services/refactors/extractType.ts | 2 +- src/services/types.ts | 5 +---- tests/cases/fourslash/fourslash.ts | 3 +++ 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/harness/fourslashImpl.ts b/src/harness/fourslashImpl.ts index dd4135ca40c15..d3cdcb1655856 100644 --- a/src/harness/fourslashImpl.ts +++ b/src/harness/fourslashImpl.ts @@ -3214,8 +3214,8 @@ namespace FourSlash { }; } - public verifyRefactorAvailable(negative: boolean, name: string, actionName?: string) { - let refactors = this.getApplicableRefactorsAtSelection(); + public verifyRefactorAvailable(negative: boolean, triggerReason: ts.RefactorTriggerReason, name: string, actionName?: string) { + let refactors = this.getApplicableRefactorsAtSelection(triggerReason); refactors = refactors.filter(r => r.name === name && (actionName === undefined || r.actions.some(a => a.name === actionName))); const isAvailable = refactors.length > 0; @@ -3644,14 +3644,14 @@ namespace FourSlash { test(renameKeys(newFileContents, key => pathUpdater(key) || key), "with file moved"); } - private getApplicableRefactorsAtSelection() { - return this.getApplicableRefactorsWorker(this.getSelection(), this.activeFile.fileName); + private getApplicableRefactorsAtSelection(triggerReason: ts.RefactorTriggerReason = "implicit") { + return this.getApplicableRefactorsWorker(this.getSelection(), this.activeFile.fileName, ts.emptyOptions, triggerReason); } - private getApplicableRefactors(rangeOrMarker: Range | Marker, preferences = ts.emptyOptions): readonly ts.ApplicableRefactorInfo[] { - return this.getApplicableRefactorsWorker("position" in rangeOrMarker ? rangeOrMarker.position : rangeOrMarker, rangeOrMarker.fileName, preferences); // eslint-disable-line no-in-operator + private getApplicableRefactors(rangeOrMarker: Range | Marker, preferences = ts.emptyOptions, triggerReason: ts.RefactorTriggerReason = "implicit"): readonly ts.ApplicableRefactorInfo[] { + return this.getApplicableRefactorsWorker("position" in rangeOrMarker ? rangeOrMarker.position : rangeOrMarker, rangeOrMarker.fileName, preferences, triggerReason); // eslint-disable-line no-in-operator } - private getApplicableRefactorsWorker(positionOrRange: number | ts.TextRange, fileName: string, preferences = ts.emptyOptions): readonly ts.ApplicableRefactorInfo[] { - return this.languageService.getApplicableRefactors(fileName, positionOrRange, preferences) || ts.emptyArray; + private getApplicableRefactorsWorker(positionOrRange: number | ts.TextRange, fileName: string, preferences = ts.emptyOptions, triggerReason: ts.RefactorTriggerReason): readonly ts.ApplicableRefactorInfo[] { + return this.languageService.getApplicableRefactors(fileName, positionOrRange, preferences, triggerReason) || ts.emptyArray; } public configurePlugin(pluginName: string, configuration: any): void { diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index f4905c00b84b5..07eea0c906655 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -208,7 +208,11 @@ namespace FourSlashInterface { } public refactorAvailable(name: string, actionName?: string) { - this.state.verifyRefactorAvailable(this.negative, name, actionName); + this.state.verifyRefactorAvailable(this.negative, "implicit", name, actionName); + } + + public refactorAvailableForTriggerReason(triggerReason: ts.RefactorTriggerReason, name: string, actionName?: string) { + this.state.verifyRefactorAvailable(this.negative, triggerReason, name, actionName); } } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 58a5988a4bfaa..db34b0838d96b 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -547,12 +547,10 @@ namespace ts.server.protocol { arguments: GetApplicableRefactorsRequestArgs; } export type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & { - triggerReason?: RefactorTriggerReason; + triggerReason?: RefactorTriggerReason }; - export enum RefactorTriggerReason { - Invoked = "invoked" - } + export type RefactorTriggerReason = "implicit" | "invoked"; /** * Response is a list of available refactorings. diff --git a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts index 3f499a06e7f26..3f1324e2266fd 100644 --- a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts +++ b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts @@ -17,7 +17,7 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { function getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { const { file, startPosition, triggerReason } = context; - const forImplicitRequest = triggerReason ? triggerReason === RefactorTriggerReason.Implicit : true; + const forImplicitRequest = triggerReason ? triggerReason === "implicit" : true; const info = getConvertibleArrowFunctionAtPosition(file, startPosition, forImplicitRequest); if (!info) return emptyArray; diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index b7c535fc44fff..8425ff9d45783 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -8,7 +8,7 @@ namespace ts.refactor.extractSymbol { * Exported for tests. */ export function getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { - const forImplicitRequest = context.triggerReason ? context.triggerReason === RefactorTriggerReason.Implicit : true; + const forImplicitRequest = context.triggerReason ? context.triggerReason === "implicit" : true; const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context), forImplicitRequest); const targetRange = rangeToExtract.targetRange; diff --git a/src/services/refactors/extractType.ts b/src/services/refactors/extractType.ts index f442c5e0c0d61..114df56e8d96b 100644 --- a/src/services/refactors/extractType.ts +++ b/src/services/refactors/extractType.ts @@ -6,7 +6,7 @@ namespace ts.refactor { const extractToTypeDef = "Extract to typedef"; registerRefactor(refactorName, { getAvailableActions(context): readonly ApplicableRefactorInfo[] { - const forImplicitRequest = context.triggerReason ? context.triggerReason === RefactorTriggerReason.Implicit : true; + const forImplicitRequest = context.triggerReason ? context.triggerReason === "implicit" : true; const info = getRangeToExtract(context, forImplicitRequest); if (!info) return emptyArray; diff --git a/src/services/types.ts b/src/services/types.ts index e4878471e6849..d970e5a69e2b8 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -741,10 +741,7 @@ namespace ts { commands?: CodeActionCommand[]; } - export enum RefactorTriggerReason { - Implicit = "implicit", - Invoked = "invoked", - } + export type RefactorTriggerReason = "implicit" | "invoked"; export interface TextInsertion { newText: string; diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index d7d4935118d0f..b8b6540605571 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -243,6 +243,7 @@ declare namespace FourSlashInterface { applicableRefactorAvailableForRange(): void; refactorAvailable(name: string, actionName?: string): void; + refactorAvailableForTriggerReason(triggerReason: RefactorTriggerReason, name: string, action?: string): void } class verify extends verifyNegatable { assertHasRanges(ranges: Range[]): void; @@ -683,6 +684,8 @@ declare namespace FourSlashInterface { triggerCharacter?: string, } + export type RefactorTriggerReason = "implicit" | "invoked"; + export interface VerifyCodeFixAvailableOptions { readonly description: string; readonly actions?: ReadonlyArray<{ readonly type: string, readonly data: {} }>; From 96f210c1c87222aa50f85871da49d39f055fdfaa Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 10:37:34 -0700 Subject: [PATCH 17/48] arrow function refactor test --- .../refactorAddOrRemoveBracesToArrowFunctionBody.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts diff --git a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts new file mode 100644 index 0000000000000..587f26ded43c9 --- /dev/null +++ b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts @@ -0,0 +1,7 @@ +/// + +//// const a = (a: number) => { return/*a*//*b*/ a; }; + +// an invoked refactor request for a cursor in the body should return a refactor +goTo.select("a", "b"); +verify.refactorAvailableForTriggerReason("invoked","Add or remove braces in an arrow function", "Remove braces from arrow function"); \ No newline at end of file From fbf6737ae29577bdc27b2b0752eaf87590a9339d Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 12:41:20 -0700 Subject: [PATCH 18/48] use verify trigger reason for import export --- .../refactorConvertExport_defaultToNamedValidSpans.ts | 2 +- .../refactorConvertExport_namedToDefaultValidSpans.ts | 2 +- .../refactorConvertImport_namedToNamespaceValidSpans.ts | 2 +- .../refactorConvertImport_namespaceToNamedValidSpans.ts | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts b/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts index 6b06450f93dbf..c6e86c6c01b2e 100644 --- a/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts +++ b/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts @@ -5,5 +5,5 @@ // verify that the refactor is offered for full, partial, and empty spans. for (const m of ["1", "2", "3"]) { goTo.select("a" + m, "b" + m); - verify.refactorAvailable("Convert export", "Convert default export to named export"); + verify.refactorAvailableForTriggerReason("invoked", "Convert export", "Convert default export to named export"); } diff --git a/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts b/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts index f32d1514e9d68..bb8483dde6296 100644 --- a/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts +++ b/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts @@ -5,5 +5,5 @@ // verify that the refactor is offered for full, partial, and empty spans. for (const m of ["1", "2", "3"]) { goTo.select("a" + m, "b" + m); - verify.refactorAvailable("Convert export", "Convert named export to default export"); + verify.refactorAvailableForTriggerReason("invoked", "Convert export", "Convert named export to default export"); } diff --git a/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts b/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts index 0847e5d5744b8..e8cbbf80090da 100644 --- a/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts +++ b/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts @@ -5,5 +5,5 @@ // verify that the refactor is offered for full, partial, and empty spans. for (const m of ["1", "2", "3"]) { goTo.select("a" + m, "b" + m); - verify.refactorAvailable("Convert import", "Convert named imports to namespace import"); + verify.refactorAvailableForTriggerReason("invoked", "Convert import", "Convert named imports to namespace import"); } diff --git a/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts b/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts index 768d05282c017..1a53cea217285 100644 --- a/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts +++ b/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts @@ -5,6 +5,5 @@ // verify that the refactor is offered for full, partial, and empty spans. for (const m of ["1", "2", "3"]) { goTo.select("a" + m, "b" + m); - verify.refactorAvailable("Convert import", "Convert namespace import to named imports"); + verify.refactorAvailableForTriggerReason("invoked","Convert import", "Convert namespace import to named imports"); } - From dc363f10fc14b15e7a07d32ad4cd48e8c9ac360b Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 12:56:36 -0700 Subject: [PATCH 19/48] fix some indices --- .../refactorConvertExport_defaultToNamedValidSpans.ts | 4 ++-- .../refactorConvertExport_namedToDefaultValidSpans.ts | 4 ++-- .../refactorConvertImport_namedToNamespaceValidSpans.ts | 4 ++-- .../refactorConvertImport_namespaceToNamedValidSpans.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts b/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts index c6e86c6c01b2e..e4322853da34b 100644 --- a/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts +++ b/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts @@ -1,9 +1,9 @@ /// -/////*a1*/ex/*a2*/port def/*a3*//*b3*/ault functio/*b2*/n f() {}/*b1*/ +/////*1a*/ex/*2a*/port def/*3a*//*3b*/ault functio/*2b*/n f() {}/*1b*/ // verify that the refactor is offered for full, partial, and empty spans. for (const m of ["1", "2", "3"]) { - goTo.select("a" + m, "b" + m); + goTo.select(m + "a", m + "b"); verify.refactorAvailableForTriggerReason("invoked", "Convert export", "Convert default export to named export"); } diff --git a/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts b/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts index bb8483dde6296..f9955962437e4 100644 --- a/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts +++ b/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts @@ -1,9 +1,9 @@ /// -/////*a1*/ex/*a2*/port f/*a3*//*b3*/unctio/*b2*/n f() {}/*b1*/ +/////*1a*/ex/*2a*/port f/*3a*//*3b*/unctio/*2b*/n f() {}/*1b*/ // verify that the refactor is offered for full, partial, and empty spans. for (const m of ["1", "2", "3"]) { - goTo.select("a" + m, "b" + m); + goTo.select(m + "a", m + "b"); verify.refactorAvailableForTriggerReason("invoked", "Convert export", "Convert named export to default export"); } diff --git a/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts b/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts index e8cbbf80090da..4c36c84929c9c 100644 --- a/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts +++ b/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts @@ -1,9 +1,9 @@ /// -/////*a1*/im/*a2*/port { /*a3*//*b3*/x, y as z, T } fro/*b2*/m "m";/*b1*/ +/////*1a*/im/*2a*/port { /*3a*//*3b*/x, y as z, T } fro/*2b*/m "m";/*1b*/ // verify that the refactor is offered for full, partial, and empty spans. for (const m of ["1", "2", "3"]) { - goTo.select("a" + m, "b" + m); + goTo.select(m + "a", m + "b"); verify.refactorAvailableForTriggerReason("invoked", "Convert import", "Convert named imports to namespace import"); } diff --git a/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts b/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts index 1a53cea217285..9b5bf353cb39e 100644 --- a/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts +++ b/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts @@ -1,9 +1,9 @@ /// -/////*a1*/im/*a2*/port * as /*a3*//*b3*/m from "m/*b2*/";/*b1*/ +/////*1a*/im/*2a*/port * as /*3a*//*3b*/m from "m/*2b*/";/*1b*/ // verify that the refactor is offered for full, partial, and empty spans. for (const m of ["1", "2", "3"]) { - goTo.select("a" + m, "b" + m); + goTo.select(m + "a", m + "b"); verify.refactorAvailableForTriggerReason("invoked","Convert import", "Convert namespace import to named imports"); } From 85e0d8b14af90528af5de46edd185d890d583e2a Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 13:11:38 -0700 Subject: [PATCH 20/48] add refactorNotAvailableForTriggerReason --- src/harness/fourslashInterfaceImpl.ts | 4 ++++ tests/cases/fourslash/fourslash.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 07eea0c906655..606dec937ff8f 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -214,6 +214,10 @@ namespace FourSlashInterface { public refactorAvailableForTriggerReason(triggerReason: ts.RefactorTriggerReason, name: string, actionName?: string) { this.state.verifyRefactorAvailable(this.negative, triggerReason, name, actionName); } + + public refactorNotAvailableForTriggerReason(triggerReason: ts.RefactorTriggerReason, name: string, actionName?: string) { + this.state.verifyRefactorAvailable(!this.negative, triggerReason, name, actionName); + } } export class Verify extends VerifyNegatable { diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index b8b6540605571..460942de4c309 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -243,7 +243,8 @@ declare namespace FourSlashInterface { applicableRefactorAvailableForRange(): void; refactorAvailable(name: string, actionName?: string): void; - refactorAvailableForTriggerReason(triggerReason: RefactorTriggerReason, name: string, action?: string): void + refactorAvailableForTriggerReason(triggerReason: RefactorTriggerReason, name: string, action?: string): void; + refactorNotAvailableForTriggerReason(triggerReason: RefactorTriggerReason, name: string, action?: string): void; } class verify extends verifyNegatable { assertHasRanges(ranges: Range[]): void; From df8ff659c5dbcdd00e718ac6e2f3954fe8448548 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 13:12:02 -0700 Subject: [PATCH 21/48] extract type test --- .../cases/fourslash/refactorExtractTypeValidSpans.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/cases/fourslash/refactorExtractTypeValidSpans.ts diff --git a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts new file mode 100644 index 0000000000000..cf0319876be90 --- /dev/null +++ b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts @@ -0,0 +1,12 @@ +/// + +//// var x: /*1a*/{ a?:/*2a*/ number, b?: string/*2b*//*3a*//*3b*/ }/*1b*/ = { }; + +// Only offer refactor for cursor position if explicitly requested +goTo.select("3a", "3b"); +verify.refactorNotAvailableForTriggerReason("implicit", "Extract type"); + +for (const m of ["1", "2", "3"]) { + goTo.select(m + "a", m + "b"); + verify.refactorAvailableForTriggerReason("invoked", "Extract type"); +} From 3825d193f6a41b60e559757e5794eba772156f4c Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 17:41:23 -0700 Subject: [PATCH 22/48] extract symbol test --- tests/cases/fourslash/extractSymbolForTriggerReason.ts | 10 ++++++++++ tests/cases/fourslash/refactorExtractTypeValidSpans.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/extractSymbolForTriggerReason.ts diff --git a/tests/cases/fourslash/extractSymbolForTriggerReason.ts b/tests/cases/fourslash/extractSymbolForTriggerReason.ts new file mode 100644 index 0000000000000..be946f5fc1545 --- /dev/null +++ b/tests/cases/fourslash/extractSymbolForTriggerReason.ts @@ -0,0 +1,10 @@ +/// + +////function foo() { +//// return 1/*a*//*b*/00; +////} + +// Only offer refactor for empty span if explicity requested +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Extract Symbol"); +verify.refactorAvailableForTriggerReason("invoked", "Extract Symbol", "constant_scope_0"); diff --git a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts index cf0319876be90..a1030a44c43bc 100644 --- a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts +++ b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts @@ -2,7 +2,7 @@ //// var x: /*1a*/{ a?:/*2a*/ number, b?: string/*2b*//*3a*//*3b*/ }/*1b*/ = { }; -// Only offer refactor for cursor position if explicitly requested +// Only offer refactor for empty span if explicity requested goTo.select("3a", "3b"); verify.refactorNotAvailableForTriggerReason("implicit", "Extract type"); From 673a86833aa070f94f6ec4c245f3ccb8309d36f7 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 17:51:00 -0700 Subject: [PATCH 23/48] update test names --- .../refactorAddOrRemoveBracesToArrowFunctionBody.ts | 7 ------- ...rAddOrRemoveBracesToArrowFunctionTriggerReason.ts | 8 ++++++++ .../fourslash/refactorExtractTypeTriggerReason.ts | 8 ++++++++ .../cases/fourslash/refactorExtractTypeValidSpans.ts | 12 ------------ 4 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts create mode 100644 tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts create mode 100644 tests/cases/fourslash/refactorExtractTypeTriggerReason.ts delete mode 100644 tests/cases/fourslash/refactorExtractTypeValidSpans.ts diff --git a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts deleted file mode 100644 index 587f26ded43c9..0000000000000 --- a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionBody.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -//// const a = (a: number) => { return/*a*//*b*/ a; }; - -// an invoked refactor request for a cursor in the body should return a refactor -goTo.select("a", "b"); -verify.refactorAvailableForTriggerReason("invoked","Add or remove braces in an arrow function", "Remove braces from arrow function"); \ No newline at end of file diff --git a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts new file mode 100644 index 0000000000000..a1e940fa7b1ee --- /dev/null +++ b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts @@ -0,0 +1,8 @@ +/// + +//// const a = (a: number) => { return/*a*//*b*/ a; }; + +// Only offer refactor for empty span if explicity requested +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Add or remove braces in an arrow function"); +verify.refactorAvailableForTriggerReason("invoked", "Add or remove braces in an arrow function", "Remove braces from arrow function"); diff --git a/tests/cases/fourslash/refactorExtractTypeTriggerReason.ts b/tests/cases/fourslash/refactorExtractTypeTriggerReason.ts new file mode 100644 index 0000000000000..019996fbbd000 --- /dev/null +++ b/tests/cases/fourslash/refactorExtractTypeTriggerReason.ts @@ -0,0 +1,8 @@ +/// + +//// var x: str/*a*//*b*/ing; + +// Only offer refactor for empty span if explicity requested +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Extract type"); +verify.refactorAvailableForTriggerReason("invoked", "Extract type"); \ No newline at end of file diff --git a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts deleted file mode 100644 index a1030a44c43bc..0000000000000 --- a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - -//// var x: /*1a*/{ a?:/*2a*/ number, b?: string/*2b*//*3a*//*3b*/ }/*1b*/ = { }; - -// Only offer refactor for empty span if explicity requested -goTo.select("3a", "3b"); -verify.refactorNotAvailableForTriggerReason("implicit", "Extract type"); - -for (const m of ["1", "2", "3"]) { - goTo.select(m + "a", m + "b"); - verify.refactorAvailableForTriggerReason("invoked", "Extract type"); -} From 86122c412f701606415ab69b592c446a858231b5 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 18:00:38 -0700 Subject: [PATCH 24/48] convert get set test --- .../refactorConvertToGetAndSetAccessTriggerReason.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/cases/fourslash/refactorConvertToGetAndSetAccessTriggerReason.ts diff --git a/tests/cases/fourslash/refactorConvertToGetAndSetAccessTriggerReason.ts b/tests/cases/fourslash/refactorConvertToGetAndSetAccessTriggerReason.ts new file mode 100644 index 0000000000000..f77de717dbf80 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertToGetAndSetAccessTriggerReason.ts @@ -0,0 +1,9 @@ +/// + +//// class A { +//// public /*a*//*b*/a: string; +//// } + +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Generate 'get' and 'set' accessors"); +verify.refactorAvailableForTriggerReason("invoked", "Generate 'get' and 'set' accessors"); \ No newline at end of file From d37f4c33cc563eff03c5e31449a09780467f207f Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 18:36:29 -0700 Subject: [PATCH 25/48] accept new baseline --- tests/baselines/reference/api/tsserverlibrary.d.ts | 9 ++------- tests/baselines/reference/api/typescript.d.ts | 5 +---- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 14f27cab8e50d..37ec6e753ab22 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5531,10 +5531,7 @@ declare namespace ts { renameLocation?: number; commands?: CodeActionCommand[]; } - enum RefactorTriggerReason { - Implicit = "implicit", - Invoked = "invoked" - } + type RefactorTriggerReason = "implicit" | "invoked"; interface TextInsertion { newText: string; /** The position in newText the caret should point to after the insertion. */ @@ -6636,9 +6633,7 @@ declare namespace ts.server.protocol { type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & { triggerReason?: RefactorTriggerReason; }; - enum RefactorTriggerReason { - Invoked = "invoked" - } + type RefactorTriggerReason = "implicit" | "invoked"; /** * Response is a list of available refactorings. * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 91dad9f4fc178..b20cc1a215a26 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5531,10 +5531,7 @@ declare namespace ts { renameLocation?: number; commands?: CodeActionCommand[]; } - enum RefactorTriggerReason { - Implicit = "implicit", - Invoked = "invoked" - } + type RefactorTriggerReason = "implicit" | "invoked"; interface TextInsertion { newText: string; /** The position in newText the caret should point to after the insertion. */ From e56593139267cb796bc7d8fe1ed13cb93f4bfc04 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 21:07:33 -0700 Subject: [PATCH 26/48] fix up some bools --- .../refactors/addOrRemoveBracesToArrowFunction.ts | 7 +++---- src/services/refactors/extractSymbol.ts | 13 ++++++------- src/services/refactors/extractType.ts | 9 ++++----- src/testRunner/unittests/services/extract/ranges.ts | 2 +- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts index 3f1324e2266fd..84e596c5e4116 100644 --- a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts +++ b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts @@ -17,8 +17,7 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { function getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { const { file, startPosition, triggerReason } = context; - const forImplicitRequest = triggerReason ? triggerReason === "implicit" : true; - const info = getConvertibleArrowFunctionAtPosition(file, startPosition, forImplicitRequest); + const info = getConvertibleArrowFunctionAtPosition(file, startPosition, triggerReason === "invoked"); if (!info) return emptyArray; return [{ @@ -71,12 +70,12 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { return { renameFilename: undefined, renameLocation: undefined, edits }; } - function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number, forImplicitRequest = false): Info | undefined { + function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number, userRequested = true): Info | undefined { const node = getTokenAtPosition(file, startPosition); const func = getContainingFunction(node); // Only offer a refactor in the function body on explicit refactor requests. if (!func || !isArrowFunction(func) || (!rangeContainsRange(func, node) - || (rangeContainsRange(func.body, node) && forImplicitRequest))) return undefined; + || (rangeContainsRange(func.body, node) && !userRequested))) return undefined; if (isExpression(func.body)) { return { diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 8425ff9d45783..3da484a9ce630 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -8,8 +8,7 @@ namespace ts.refactor.extractSymbol { * Exported for tests. */ export function getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { - const forImplicitRequest = context.triggerReason ? context.triggerReason === "implicit" : true; - const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context), forImplicitRequest); + const rangeToExtract = getRangeToExtract(context.file, getRefactorContextSpan(context), context.triggerReason === "invoked"); const targetRange = rangeToExtract.targetRange; if (targetRange === undefined) { @@ -187,20 +186,20 @@ namespace ts.refactor.extractSymbol { * not shown to the user, but can be used by us diagnostically) */ // exported only for tests - export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan, forImplicitRequest = false): RangeToExtract { + export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan, userRequested = true): RangeToExtract { const { length } = span; - if (length === 0 && forImplicitRequest) { + if (length === 0 && !userRequested) { return { errors: [createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractEmpty)] }; } - const explicitCursorRequest = length === 0 && !forImplicitRequest; + const cursorRequest = length === 0 && userRequested; // Walk up starting from the the start position until we find a non-SourceFile node that subsumes the selected span. // This may fail (e.g. you select two statements in the root of a source file) const startToken = getTokenAtPosition(sourceFile, span.start); - const start = explicitCursorRequest ? getExtractableParent(startToken): getParentNodeInSpan(startToken, sourceFile, span); + const start = cursorRequest ? getExtractableParent(startToken): getParentNodeInSpan(startToken, sourceFile, span); // Do the same for the ending position const endToken = findTokenOnLeftOfPosition(sourceFile, textSpanEnd(span)); - const end = explicitCursorRequest ? start : getParentNodeInSpan(endToken, sourceFile, span); + const end = cursorRequest ? start : getParentNodeInSpan(endToken, sourceFile, span); const declarations: Symbol[] = []; diff --git a/src/services/refactors/extractType.ts b/src/services/refactors/extractType.ts index 114df56e8d96b..4941c4dffd6ac 100644 --- a/src/services/refactors/extractType.ts +++ b/src/services/refactors/extractType.ts @@ -6,8 +6,7 @@ namespace ts.refactor { const extractToTypeDef = "Extract to typedef"; registerRefactor(refactorName, { getAvailableActions(context): readonly ApplicableRefactorInfo[] { - const forImplicitRequest = context.triggerReason ? context.triggerReason === "implicit" : true; - const info = getRangeToExtract(context, forImplicitRequest); + const info = getRangeToExtract(context, context.triggerReason === "invoked"); if (!info) return emptyArray; return [{ @@ -59,15 +58,15 @@ namespace ts.refactor { type Info = TypeAliasInfo | InterfaceInfo; - function getRangeToExtract(context: RefactorContext, forImplicitRequest = false): Info | undefined { + function getRangeToExtract(context: RefactorContext, userRequested = true): Info | undefined { const { file, startPosition } = context; const isJS = isSourceFileJS(file); const current = getTokenAtPosition(file, startPosition); const range = createTextRangeFromSpan(getRefactorContextSpan(context)); - const explicitCursorRequest = range.pos === range.end && !forImplicitRequest; + const cursorRequest = range.pos === range.end && userRequested; const selection = findAncestor(current, (node => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) && - (explicitCursorRequest || nodeOverlapsWithStartEnd(current, file, range.pos, range.end)))); + (cursorRequest || nodeOverlapsWithStartEnd(current, file, range.pos, range.end)))); if (!selection || !isTypeNode(selection)) return undefined; const checker = context.program.getTypeChecker(); diff --git a/src/testRunner/unittests/services/extract/ranges.ts b/src/testRunner/unittests/services/extract/ranges.ts index e10ed6cbb914c..8fe5aeb3c131f 100644 --- a/src/testRunner/unittests/services/extract/ranges.ts +++ b/src/testRunner/unittests/services/extract/ranges.ts @@ -7,7 +7,7 @@ namespace ts { if (!selectionRange) { throw new Error(`Test ${s} does not specify selection range`); } - const result = refactor.extractSymbol.getRangeToExtract(file, createTextSpanFromRange(selectionRange), /*forImplicitRequest*/ true); + const result = refactor.extractSymbol.getRangeToExtract(file, createTextSpanFromRange(selectionRange), /*userRequested*/ false); assert(result.targetRange === undefined, "failure expected"); const sortedErrors = result.errors!.map(e => e.messageText).sort(); assert.deepEqual(sortedErrors, expectedErrors.sort(), "unexpected errors"); From a07a79b772ca5edbdff0e0d7f00aae523c6f654b Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 10:19:55 -0700 Subject: [PATCH 27/48] remove unused test method --- src/harness/fourslashInterfaceImpl.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 606dec937ff8f..07eea0c906655 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -214,10 +214,6 @@ namespace FourSlashInterface { public refactorAvailableForTriggerReason(triggerReason: ts.RefactorTriggerReason, name: string, actionName?: string) { this.state.verifyRefactorAvailable(this.negative, triggerReason, name, actionName); } - - public refactorNotAvailableForTriggerReason(triggerReason: ts.RefactorTriggerReason, name: string, actionName?: string) { - this.state.verifyRefactorAvailable(!this.negative, triggerReason, name, actionName); - } } export class Verify extends VerifyNegatable { From 3e1e61470bfcaea49cd83aa8abfbb2fb79d77453 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 10:37:49 -0700 Subject: [PATCH 28/48] Revert "update refactorConvertImport_partialSelection" This reverts commit e28d8a0895f118321c37016a6dad4751a7c13673. --- ...alSelection.ts => refactorConvertImport_notAtDefaultName.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/cases/fourslash/{refactorConvertImport_partialSelection.ts => refactorConvertImport_notAtDefaultName.ts} (65%) diff --git a/tests/cases/fourslash/refactorConvertImport_partialSelection.ts b/tests/cases/fourslash/refactorConvertImport_notAtDefaultName.ts similarity index 65% rename from tests/cases/fourslash/refactorConvertImport_partialSelection.ts rename to tests/cases/fourslash/refactorConvertImport_notAtDefaultName.ts index 0f703d7436f8d..5f62bbb439446 100644 --- a/tests/cases/fourslash/refactorConvertImport_partialSelection.ts +++ b/tests/cases/fourslash/refactorConvertImport_notAtDefaultName.ts @@ -3,4 +3,4 @@ ////import /*a*/d/*b*/, * as n from "m"; goTo.select("a", "b"); -verify.refactorAvailable("Convert import"); +verify.not.refactorAvailable("Convert import"); From 4971c7d546a27c54693ac192894585da34557d6d Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 11:09:10 -0700 Subject: [PATCH 29/48] remove declaration --- tests/cases/fourslash/fourslash.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 460942de4c309..ce3eefcb4ac84 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -244,7 +244,6 @@ declare namespace FourSlashInterface { refactorAvailable(name: string, actionName?: string): void; refactorAvailableForTriggerReason(triggerReason: RefactorTriggerReason, name: string, action?: string): void; - refactorNotAvailableForTriggerReason(triggerReason: RefactorTriggerReason, name: string, action?: string): void; } class verify extends verifyNegatable { assertHasRanges(ranges: Range[]): void; From a7c07d67d8fbe1ed235db18ee979698565ae3994 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 11:10:12 -0700 Subject: [PATCH 30/48] convert export cursor only changes --- src/services/refactors/convertExport.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/refactors/convertExport.ts b/src/services/refactors/convertExport.ts index a3fd2bc114026..cbcc4c13871aa 100644 --- a/src/services/refactors/convertExport.ts +++ b/src/services/refactors/convertExport.ts @@ -5,7 +5,7 @@ namespace ts.refactor { const actionNameNamedToDefault = "Convert named export to default export"; registerRefactor(refactorName, { getAvailableActions(context): readonly ApplicableRefactorInfo[] { - const info = getInfo(context); + const info = getInfo(context, context.triggerReason === "invoked"); if (!info) return emptyArray; const description = info.wasDefault ? Diagnostics.Convert_default_export_to_named_export.message : Diagnostics.Convert_named_export_to_default_export.message; const actionName = info.wasDefault ? actionNameDefaultToNamed : actionNameNamedToDefault; @@ -27,12 +27,12 @@ namespace ts.refactor { readonly exportingModuleSymbol: Symbol; } - function getInfo(context: RefactorContext): Info | undefined { + function getInfo(context: RefactorContext, userRequested = true): Info | undefined { const { file } = context; const span = getRefactorContextSpan(context); const token = getTokenAtPosition(file, span.start); - // If the span is entirely contained in an export node, check that node. - const exportNode = !!(getModifierFlags(token.parent) & ModifierFlags.Export) ? token.parent : getParentNodeInSpan(token, file, span); + const cursorRequest = userRequested && span; + const exportNode = !!(getModifierFlags(token.parent) & ModifierFlags.Export) && cursorRequest ? token.parent : getParentNodeInSpan(token, file, span); if (!exportNode || (!isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent)))) { return undefined; } From c20908a3e74757fcfe4eef01c5991080e74069f0 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 11:10:44 -0700 Subject: [PATCH 31/48] convert export trigger reason test --- .../fourslash/refactorConvertExportForTriggerReason.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/cases/fourslash/refactorConvertExportForTriggerReason.ts diff --git a/tests/cases/fourslash/refactorConvertExportForTriggerReason.ts b/tests/cases/fourslash/refactorConvertExportForTriggerReason.ts new file mode 100644 index 0000000000000..c3cffbeec06eb --- /dev/null +++ b/tests/cases/fourslash/refactorConvertExportForTriggerReason.ts @@ -0,0 +1,7 @@ +/// + +////export /*a*//*b*/function f() {} + +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Convert export"); +verify.refactorAvailableForTriggerReason("invoked", "Convert export"); \ No newline at end of file From 06d2461cd0013b1a046c84c577698547a3693398 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 11:11:09 -0700 Subject: [PATCH 32/48] convert import trigger reason only --- src/services/refactors/convertImport.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/refactors/convertImport.ts b/src/services/refactors/convertImport.ts index 43120591e6b31..88c501925c15f 100644 --- a/src/services/refactors/convertImport.ts +++ b/src/services/refactors/convertImport.ts @@ -5,7 +5,7 @@ namespace ts.refactor { const actionNameNamedToNamespace = "Convert named imports to namespace import"; registerRefactor(refactorName, { getAvailableActions(context): readonly ApplicableRefactorInfo[] { - const i = getImportToConvert(context); + const i = getImportToConvert(context, context.triggerReason === "invoked"); if (!i) return emptyArray; const description = i.kind === SyntaxKind.NamespaceImport ? Diagnostics.Convert_namespace_import_to_named_imports.message : Diagnostics.Convert_named_imports_to_namespace_import.message; const actionName = i.kind === SyntaxKind.NamespaceImport ? actionNameNamespaceToNamed : actionNameNamedToNamespace; @@ -19,11 +19,12 @@ namespace ts.refactor { }); // Can convert imports of the form `import * as m from "m";` or `import d, { x, y } from "m";`. - function getImportToConvert(context: RefactorContext): NamedImportBindings | undefined { + function getImportToConvert(context: RefactorContext, userRequested = true): NamedImportBindings | undefined { const { file } = context; const span = getRefactorContextSpan(context); const token = getTokenAtPosition(file, span.start); - const importDecl = findAncestor(token, isImportDeclaration); + const cursorRequest = userRequested && span.length === 0; + const importDecl = cursorRequest ? findAncestor(token, isImportDeclaration) : getParentNodeInSpan(token, file, span); if (!importDecl || !isImportDeclaration(importDecl) || (importDecl.getEnd() < span.start + span.length)) return undefined; const { importClause } = importDecl; return importClause && importClause.namedBindings; From f4792792176498a0551f689ae50c27cc5c6f9d1c Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 11:11:33 -0700 Subject: [PATCH 33/48] convert import trigger reason test --- .../fourslash/refactorConvertImportForTriggerReason.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/cases/fourslash/refactorConvertImportForTriggerReason.ts diff --git a/tests/cases/fourslash/refactorConvertImportForTriggerReason.ts b/tests/cases/fourslash/refactorConvertImportForTriggerReason.ts new file mode 100644 index 0000000000000..b192b114c1a70 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertImportForTriggerReason.ts @@ -0,0 +1,7 @@ +/// + +////import /*a*//*b*/d, * as n from "m"; + +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Convert import"); +verify.refactorAvailableForTriggerReason("invoked", "Convert import"); \ No newline at end of file From 2db00544445e04b8ef384c9209bec402b57e17db Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 11:16:47 -0700 Subject: [PATCH 34/48] remove outdated tests --- .../refactorConvertExport_defaultToNamedValidSpans.ts | 9 --------- .../refactorConvertExport_namedToDefaultValidSpans.ts | 9 --------- .../refactorConvertImport_namedToNamespaceValidSpans.ts | 9 --------- .../refactorConvertImport_namespaceToNamedValidSpans.ts | 9 --------- 4 files changed, 36 deletions(-) delete mode 100644 tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts delete mode 100644 tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts delete mode 100644 tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts delete mode 100644 tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts diff --git a/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts b/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts deleted file mode 100644 index e4322853da34b..0000000000000 --- a/tests/cases/fourslash/refactorConvertExport_defaultToNamedValidSpans.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -/////*1a*/ex/*2a*/port def/*3a*//*3b*/ault functio/*2b*/n f() {}/*1b*/ - -// verify that the refactor is offered for full, partial, and empty spans. -for (const m of ["1", "2", "3"]) { - goTo.select(m + "a", m + "b"); - verify.refactorAvailableForTriggerReason("invoked", "Convert export", "Convert default export to named export"); -} diff --git a/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts b/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts deleted file mode 100644 index f9955962437e4..0000000000000 --- a/tests/cases/fourslash/refactorConvertExport_namedToDefaultValidSpans.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -/////*1a*/ex/*2a*/port f/*3a*//*3b*/unctio/*2b*/n f() {}/*1b*/ - -// verify that the refactor is offered for full, partial, and empty spans. -for (const m of ["1", "2", "3"]) { - goTo.select(m + "a", m + "b"); - verify.refactorAvailableForTriggerReason("invoked", "Convert export", "Convert named export to default export"); -} diff --git a/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts b/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts deleted file mode 100644 index 4c36c84929c9c..0000000000000 --- a/tests/cases/fourslash/refactorConvertImport_namedToNamespaceValidSpans.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -/////*1a*/im/*2a*/port { /*3a*//*3b*/x, y as z, T } fro/*2b*/m "m";/*1b*/ - -// verify that the refactor is offered for full, partial, and empty spans. -for (const m of ["1", "2", "3"]) { - goTo.select(m + "a", m + "b"); - verify.refactorAvailableForTriggerReason("invoked", "Convert import", "Convert named imports to namespace import"); -} diff --git a/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts b/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts deleted file mode 100644 index 9b5bf353cb39e..0000000000000 --- a/tests/cases/fourslash/refactorConvertImport_namespaceToNamedValidSpans.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -/////*1a*/im/*2a*/port * as /*3a*//*3b*/m from "m/*2b*/";/*1b*/ - -// verify that the refactor is offered for full, partial, and empty spans. -for (const m of ["1", "2", "3"]) { - goTo.select(m + "a", m + "b"); - verify.refactorAvailableForTriggerReason("invoked","Convert import", "Convert namespace import to named imports"); -} From a86a2fa7038337ff17b702772e18ef5a7f5e048b Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 11:57:19 -0700 Subject: [PATCH 35/48] polish tests --- ...efactorAddOrRemoveBracesToArrowFunctionForTriggerReason.ts} | 0 tests/cases/fourslash/refactorConvertExportForTriggerReason.ts | 3 ++- tests/cases/fourslash/refactorConvertImportForTriggerReason.ts | 3 ++- ....ts => refactorConvertToGetAndSetAccessForTriggerReason.ts} | 3 ++- ...TriggerReason.ts => refactorExtractTypeForTriggerReason.ts} | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) rename tests/cases/fourslash/{refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts => refactorAddOrRemoveBracesToArrowFunctionForTriggerReason.ts} (100%) rename tests/cases/fourslash/{refactorConvertToGetAndSetAccessTriggerReason.ts => refactorConvertToGetAndSetAccessForTriggerReason.ts} (74%) rename tests/cases/fourslash/{refactorExtractTypeTriggerReason.ts => refactorExtractTypeForTriggerReason.ts} (95%) diff --git a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason.ts similarity index 100% rename from tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionTriggerReason.ts rename to tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason.ts diff --git a/tests/cases/fourslash/refactorConvertExportForTriggerReason.ts b/tests/cases/fourslash/refactorConvertExportForTriggerReason.ts index c3cffbeec06eb..9735acb5132b8 100644 --- a/tests/cases/fourslash/refactorConvertExportForTriggerReason.ts +++ b/tests/cases/fourslash/refactorConvertExportForTriggerReason.ts @@ -2,6 +2,7 @@ ////export /*a*//*b*/function f() {} +// Only offer refactor for empty span if explicity requested goTo.select("a", "b"); verify.not.refactorAvailableForTriggerReason("implicit", "Convert export"); -verify.refactorAvailableForTriggerReason("invoked", "Convert export"); \ No newline at end of file +verify.refactorAvailableForTriggerReason("invoked", "Convert export"); diff --git a/tests/cases/fourslash/refactorConvertImportForTriggerReason.ts b/tests/cases/fourslash/refactorConvertImportForTriggerReason.ts index b192b114c1a70..72e8a6f8e1b76 100644 --- a/tests/cases/fourslash/refactorConvertImportForTriggerReason.ts +++ b/tests/cases/fourslash/refactorConvertImportForTriggerReason.ts @@ -2,6 +2,7 @@ ////import /*a*//*b*/d, * as n from "m"; +// Only offer refactor for empty span if explicity requested goTo.select("a", "b"); verify.not.refactorAvailableForTriggerReason("implicit", "Convert import"); -verify.refactorAvailableForTriggerReason("invoked", "Convert import"); \ No newline at end of file +verify.refactorAvailableForTriggerReason("invoked", "Convert import"); diff --git a/tests/cases/fourslash/refactorConvertToGetAndSetAccessTriggerReason.ts b/tests/cases/fourslash/refactorConvertToGetAndSetAccessForTriggerReason.ts similarity index 74% rename from tests/cases/fourslash/refactorConvertToGetAndSetAccessTriggerReason.ts rename to tests/cases/fourslash/refactorConvertToGetAndSetAccessForTriggerReason.ts index f77de717dbf80..a6edb03c95f57 100644 --- a/tests/cases/fourslash/refactorConvertToGetAndSetAccessTriggerReason.ts +++ b/tests/cases/fourslash/refactorConvertToGetAndSetAccessForTriggerReason.ts @@ -4,6 +4,7 @@ //// public /*a*//*b*/a: string; //// } +// Only offer refactor for empty span if explicity requested goTo.select("a", "b"); verify.not.refactorAvailableForTriggerReason("implicit", "Generate 'get' and 'set' accessors"); -verify.refactorAvailableForTriggerReason("invoked", "Generate 'get' and 'set' accessors"); \ No newline at end of file +verify.refactorAvailableForTriggerReason("invoked", "Generate 'get' and 'set' accessors"); diff --git a/tests/cases/fourslash/refactorExtractTypeTriggerReason.ts b/tests/cases/fourslash/refactorExtractTypeForTriggerReason.ts similarity index 95% rename from tests/cases/fourslash/refactorExtractTypeTriggerReason.ts rename to tests/cases/fourslash/refactorExtractTypeForTriggerReason.ts index 019996fbbd000..4bc28336657d3 100644 --- a/tests/cases/fourslash/refactorExtractTypeTriggerReason.ts +++ b/tests/cases/fourslash/refactorExtractTypeForTriggerReason.ts @@ -5,4 +5,4 @@ // Only offer refactor for empty span if explicity requested goTo.select("a", "b"); verify.not.refactorAvailableForTriggerReason("implicit", "Extract type"); -verify.refactorAvailableForTriggerReason("invoked", "Extract type"); \ No newline at end of file +verify.refactorAvailableForTriggerReason("invoked", "Extract type"); From ca58c0e03cb6c5cc7530669507edce79673c0c42 Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Fri, 29 May 2020 14:04:07 -0700 Subject: [PATCH 36/48] fix merge conflicts --- src/services/codefixes/generateAccessors.ts | 5 +++-- src/services/refactors/convertExport.ts | 2 +- src/services/refactors/generateGetAccessorAndSetAccessor.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/services/codefixes/generateAccessors.ts b/src/services/codefixes/generateAccessors.ts index 7fed793a2f1ac..904e52d29c586 100644 --- a/src/services/codefixes/generateAccessors.ts +++ b/src/services/codefixes/generateAccessors.ts @@ -104,12 +104,13 @@ namespace ts.codefix { return modifierFlags; } - export function getAccessorConvertiblePropertyAtPosition(file: SourceFile, start: number, end: number): Info | undefined { + export function getAccessorConvertiblePropertyAtPosition(file: SourceFile, start: number, end: number, userRequested = true): Info | undefined { const node = getTokenAtPosition(file, start); + const cursorRequest = start === end && userRequested; const declaration = findAncestor(node.parent, isAcceptedDeclaration); // make sure declaration have AccessibilityModifier or Static Modifier or Readonly Modifier const meaning = ModifierFlags.AccessibilityModifier | ModifierFlags.Static | ModifierFlags.Readonly; - if (!declaration || !nodeOverlapsWithStartEnd(declaration.name, file, start, end) + if (!declaration || !(nodeOverlapsWithStartEnd(declaration.name, file, start, end) || cursorRequest) || !isConvertibleName(declaration.name) || (getEffectiveModifierFlags(declaration) | meaning) !== meaning) return undefined; const name = declaration.name.text; diff --git a/src/services/refactors/convertExport.ts b/src/services/refactors/convertExport.ts index cbcc4c13871aa..b6440de228444 100644 --- a/src/services/refactors/convertExport.ts +++ b/src/services/refactors/convertExport.ts @@ -32,7 +32,7 @@ namespace ts.refactor { const span = getRefactorContextSpan(context); const token = getTokenAtPosition(file, span.start); const cursorRequest = userRequested && span; - const exportNode = !!(getModifierFlags(token.parent) & ModifierFlags.Export) && cursorRequest ? token.parent : getParentNodeInSpan(token, file, span); + const exportNode = !!(getSyntacticModifierFlags(token.parent) & ModifierFlags.Export) && cursorRequest ? token.parent : getParentNodeInSpan(token, file, span); if (!exportNode || (!isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent)))) { return undefined; } diff --git a/src/services/refactors/generateGetAccessorAndSetAccessor.ts b/src/services/refactors/generateGetAccessorAndSetAccessor.ts index e942305f6b92c..53bdf728fbe94 100644 --- a/src/services/refactors/generateGetAccessorAndSetAccessor.ts +++ b/src/services/refactors/generateGetAccessorAndSetAccessor.ts @@ -19,7 +19,7 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { }, getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] { if (!context.endPosition) return emptyArray; - if (!codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition)) return emptyArray; + if (!codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition, context.triggerReason === "invoked")) return emptyArray; return [{ name: actionName, From eb01d0c7016fb5816c44deadc4639cdb328fc483 Mon Sep 17 00:00:00 2001 From: csigs Date: Tue, 2 Jun 2020 16:10:34 +0000 Subject: [PATCH 37/48] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 6bbb07d3ba676..4e827d2dc4f53 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11981,6 +11981,24 @@ + + + + + + + + + + + + + + + + + + From f0da6d120375fd04253a96176a24772fffb9bc6b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 2 Jun 2020 11:49:21 -0700 Subject: [PATCH 38/48] Some changes to tsc baselines for clarity (#38850) * Baseline programs in tsc -b and tsc -incremental mode as well * Refactor outFile * Tests * Distinct input and output * Add helper to baseline serialized invocations of tsc on incremental edits * Input and output in watch mode * Update src/testRunner/unittests/tsbuild/helpers.ts Co-authored-by: Wesley Wigham Co-authored-by: Wesley Wigham --- src/compiler/builder.ts | 12 +- src/compiler/builderState.ts | 6 +- src/compiler/checker.ts | 4 +- src/compiler/emitter.ts | 16 +- src/compiler/factory.ts | 2 +- src/compiler/program.ts | 30 +- src/compiler/transformers/module/module.ts | 2 +- src/compiler/transformers/module/system.ts | 2 +- src/compiler/tsbuildPublic.ts | 2 +- src/compiler/utilities.ts | 6 +- src/compiler/watchPublic.ts | 2 +- src/harness/vfsUtil.ts | 4 +- src/server/project.ts | 4 +- src/server/session.ts | 2 +- src/services/sourcemaps.ts | 2 +- .../tsbuild/containerOnlyReferenced.ts | 4 +- .../unittests/tsbuild/emitDeclarationOnly.ts | 14 +- src/testRunner/unittests/tsbuild/helpers.ts | 206 ++++- .../inferredTypeFromTransitiveModule.ts | 6 +- .../tsbuild/javascriptProjectEmit.ts | 2 +- .../unittests/tsbuild/lateBoundSymbol.ts | 2 +- .../unittests/tsbuild/noEmitOnError.ts | 48 +- src/testRunner/unittests/tsbuild/outFile.ts | 4 +- .../unittests/tsbuild/resolveJsonModule.ts | 12 +- src/testRunner/unittests/tsbuild/sample.ts | 26 +- src/testRunner/unittests/tsbuild/watchMode.ts | 350 ++++---- src/testRunner/unittests/tsc/helpers.ts | 70 +- src/testRunner/unittests/tsc/incremental.ts | 64 +- .../unittests/tscWatch/consoleClearing.ts | 30 +- src/testRunner/unittests/tscWatch/emit.ts | 196 +++-- .../unittests/tscWatch/emitAndErrorUpdates.ts | 79 +- .../forceConsistentCasingInFileNames.ts | 16 +- src/testRunner/unittests/tscWatch/helpers.ts | 108 ++- .../unittests/tscWatch/incremental.ts | 13 +- .../unittests/tscWatch/programUpdates.ts | 432 ++++----- .../unittests/tscWatch/resolutionCache.ts | 106 +-- .../unittests/tscWatch/watchEnvironment.ts | 171 ++-- .../modules-and-globals-mixed-in-amd.js | 15 +- .../multiple-emitHelpers-in-all-projects.js | 19 +- .../multiple-prologues-in-all-projects.js | 15 +- .../shebang-in-all-projects.js | 17 +- .../stripInternal.js | 65 +- .../triple-slash-refs-in-all-projects.js | 15 +- .../multiple-emitHelpers-in-all-projects.js | 15 +- .../multiple-prologues-in-all-projects.js | 17 +- .../stripInternal.js | 65 +- .../modules-and-globals-mixed-in-amd.js | 75 +- .../multiple-emitHelpers-in-all-projects.js | 140 +-- .../multiple-prologues-in-all-projects.js | 133 +-- .../initial-build/shebang-in-all-projects.js | 91 +- .../initial-build/stripInternal.js | 150 ++-- .../triple-slash-refs-in-all-projects.js | 101 ++- ...e-resolution-finds-original-source-file.js | 94 +- .../builds-after-fixing-config-file-errors.js | 15 +- ...ntax-errors-after-change-to-config-file.js | 29 +- ...s-syntax-errors-after-change-to-ts-file.js | 15 +- .../reports-syntax-errors-in-config-file.js | 41 +- .../when-tsconfig-extends-the-missing-file.js | 39 +- .../reports-syntax-errors-in-config-file.js | 9 +- ...ter-initial-build-doesnt-build-anything.js | 108 ++- ...ter-initial-build-doesnt-build-anything.js | 18 - ...s-not-in-rootDir-at-the-import-location.js | 158 +++- ...ts-the-error-about-it-by-stopping-build.js | 105 ++- ...ng-setup-correctly-and-reports-no-error.js | 151 +++- ...-emitDeclarationOnly-and-declarationMap.js | 126 --- ...import-project-with-emitDeclarationOnly.js | 119 --- ...mports-project-with-emitDeclarationOnly.js | 104 --- ...mports-project-with-emitDeclarationOnly.js | 94 -- ...-emitDeclarationOnly-and-declarationMap.js | 208 ++++- ...import-project-with-emitDeclarationOnly.js | 217 ++++- ...mports-project-with-emitDeclarationOnly.js | 276 +++++- ...es-is-empty-and-references-are-provided.js | 57 +- ...is-empty-and-no-references-are-provided.js | 34 +- .../initial-build/test-exit-code.js | 12 +- ...-transitive-module-with-isolatedModules.js | 116 --- .../inferred-type-from-transitive-module.js | 116 --- ...hange-in-signature-with-isolatedModules.js | 31 - ...-transitive-module-with-isolatedModules.js | 206 ++++- .../inferred-type-from-transitive-module.js | 200 ++++- ...hange-in-signature-with-isolatedModules.js | 125 ++- ...rojects-and-concatenates-them-correctly.js | 254 ------ ...based-projects-and-emits-them-correctly.js | 125 ++- ...ved-json-files-and-emits-them-correctly.js | 121 ++- ...rojects-and-concatenates-them-correctly.js | 120 ++- ...rojects-and-concatenates-them-correctly.js | 380 +++++++- ...s-merged-and-contains-late-bound-member.js | 83 -- ...s-merged-and-contains-late-bound-member.js | 143 ++- ...zed-module-specifiers-resolve-correctly.js | 122 ++- ...is-empty-and-no-references-are-provided.js | 18 - .../semantic-errors-with-incremental.js | 201 +++++ .../initial-build/semantic-errors.js | 154 ++++ .../syntax-errors-with-incremental.js | 209 +++++ .../initial-build/syntax-errors.js | 162 ++++ .../outFile/initial-build/clean-projects.js | 149 +++- .../non-module-projects-without-prepend.js | 200 +++-- ...erated-when-incremental-is-set-to-false.js | 160 +++- ...-buildInfo-absence-results-in-new-build.js | 367 +++++++- .../outFile/no-change-run/clean-projects.js | 5 - .../baseline-sectioned-sourcemaps.js | 37 +- .../emitHelpers-in-all-projects.js | 41 +- .../multiple-prologues-in-all-projects.js | 39 +- .../shebang-in-all-projects.js | 39 +- .../strict-in-all-projects.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- .../stripInternal.js | 37 +- .../triple-slash-refs-in-all-projects.js | 37 +- .../baseline-sectioned-sourcemaps.js | 37 +- .../emitHelpers-in-all-projects.js | 41 +- ...tHelpers-in-only-one-dependency-project.js | 37 +- .../multiple-emitHelpers-in-all-projects.js | 41 +- ...tiple-emitHelpers-in-different-projects.js | 41 +- .../multiple-prologues-in-all-projects.js | 39 +- ...ultiple-prologues-in-different-projects.js | 37 +- .../shebang-in-all-projects.js | 39 +- .../shebang-in-only-one-dependency-project.js | 37 +- .../strict-in-all-projects.js | 37 +- .../strict-in-one-dependency.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- .../stripInternal-jsdoc-style-comment.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...-jsdoc-style-with-comments-emit-enabled.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...tripInternal-with-comments-emit-enabled.js | 37 +- .../stripInternal.js | 37 +- .../triple-slash-refs-in-all-projects.js | 37 +- .../triple-slash-refs-in-one-project.js | 37 +- ...t-composite-but-uses-project-references.js | 37 +- ...-source-files-are-empty-in-the-own-file.js | 37 +- .../emitHelpers-in-all-projects.js | 37 +- ...tHelpers-in-only-one-dependency-project.js | 41 +- .../multiple-emitHelpers-in-all-projects.js | 37 +- ...tiple-emitHelpers-in-different-projects.js | 37 +- .../multiple-prologues-in-all-projects.js | 41 +- ...ultiple-prologues-in-different-projects.js | 39 +- .../strict-in-all-projects.js | 39 +- .../strict-in-one-dependency.js | 39 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- .../stripInternal-jsdoc-style-comment.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...tripInternal-with-comments-emit-enabled.js | 37 +- .../stripInternal.js | 37 +- .../baseline-sectioned-sourcemaps.js | 137 ++- .../declarationMap-and-sourceMap-disabled.js | 161 +++- .../emitHelpers-in-all-projects.js | 182 +++- ...tHelpers-in-only-one-dependency-project.js | 169 +++- .../multiple-emitHelpers-in-all-projects.js | 276 +++--- ...tiple-emitHelpers-in-different-projects.js | 202 +++-- .../multiple-prologues-in-all-projects.js | 251 +++--- ...ultiple-prologues-in-different-projects.js | 208 +++-- .../initial-build/shebang-in-all-projects.js | 182 +++- .../shebang-in-only-one-dependency-project.js | 153 +++- .../initial-build/strict-in-all-projects.js | 200 +++-- .../initial-build/strict-in-one-dependency.js | 155 +++- ...hen-internal-is-inside-another-internal.js | 230 +++-- ...en-one-two-three-are-prepended-in-order.js | 260 +++--- .../stripInternal-jsdoc-style-comment.js | 240 +++-- ...en-one-two-three-are-prepended-in-order.js | 282 +++--- ...-jsdoc-style-with-comments-emit-enabled.js | 280 +++--- ...l-when-few-members-of-enum-are-internal.js | 220 +++-- ...en-one-two-three-are-prepended-in-order.js | 260 +++--- ...nal-when-prepend-is-completely-internal.js | 63 +- ...en-one-two-three-are-prepended-in-order.js | 282 +++--- ...tripInternal-with-comments-emit-enabled.js | 280 +++--- .../initial-build/stripInternal.js | 240 +++-- .../triple-slash-refs-in-all-projects.js | 190 +++- .../triple-slash-refs-in-one-project.js | 161 +++- ...roject-is-not-composite-but-incremental.js | 160 +++- ...t-composite-but-uses-project-references.js | 160 +++- ...final-project-specifies-tsBuildInfoFile.js | 162 +++- ...-source-files-are-empty-in-the-own-file.js | 138 ++- .../initial-build/builds-correctly.js | 63 +- ...nfo-file-because-no-rootDir-in-the-base.js | 77 +- ...reports-error-for-same-tsbuildinfo-file.js | 51 +- ...eports-no-error-when-tsbuildinfo-differ.js | 53 +- .../files-containing-json-file.js | 60 +- ...ting-json-module-from-project-reference.js | 97 ++- .../initial-build/include-and-files.js | 63 +- ...r-include-and-file-name-matches-ts-file.js | 67 +- ...nclude-of-json-along-with-other-include.js | 60 +- .../initial-build/include-only.js | 60 +- .../initial-build/sourcemap.js | 91 +- .../initial-build/without-outDir.js | 93 +- ...ting-json-module-from-project-reference.js | 14 - .../no-change-run/sourcemap.js | 10 - .../no-change-run/without-outDir.js | 10 - ...-type-only-changes-in-upstream-projects.js | 21 +- .../listEmittedFiles.js | 223 ----- .../listFiles.js | 225 ----- ...uilds-from-start-if-force-option-is-set.js | 9 +- ...uilds-when-extended-config-file-changes.js | 89 -- .../rebuilds-when-tsconfig-changes.js | 39 +- .../incremental-declaration-changes/sample.js | 380 -------- .../when-declaration-option-changes.js | 75 -- .../when-esModuleInterop-option-changes.js | 133 --- ...en-logic-config-changes-declaration-dir.js | 181 ---- .../when-module-option-changes.js | 84 -- .../when-target-option-changes.js | 98 --- .../Only-builds-the-leaf-node-project.js | 15 +- ...it-would-skip-builds-during-a-dry-build.js | 9 +- .../listEmittedFiles.js | 79 -- .../listFiles.js | 79 -- .../sample.js | 105 --- .../always-builds-under-with-force-option.js | 129 ++- ...rectly-when-declarationDir-is-specified.js | 95 +- ...ilds-correctly-when-outDir-is-specified.js | 95 +- ...composite-or-doesnt-have-any-references.js | 76 +- .../can-detect-when-and-what-to-rebuild.js | 270 +++++- ...ojects-if-upstream-projects-have-errors.js | 105 ++- ...does-not-write-any-files-in-a-dry-build.js | 73 +- .../sample1/initial-build/listEmittedFiles.js | 425 ++++++++- .../sample1/initial-build/listFiles.js | 427 ++++++++- ...uilds-when-extended-config-file-changes.js | 216 ++++- .../removes-all-files-it-built.js | 126 ++- .../tsbuild/sample1/initial-build/sample.js | 824 +++++++++++++++++- .../when-declaration-option-changes.js | 139 ++- .../when-esModuleInterop-option-changes.js | 232 ++++- .../when-logic-specifies-tsBuildInfoFile.js | 121 ++- .../when-module-option-changes.js | 150 +++- .../when-target-option-changes.js | 189 +++- .../always-builds-under-with-force-option.js | 19 - .../removes-all-files-it-built.js | 5 - .../tsbuild/sample1/no-change-run/sample.js | 23 - ...roject-uses-different-module-resolution.js | 70 +- .../initial-build/builds-correctly.js | 75 +- ...de-resolution-with-external-module-name.js | 65 +- .../reports-syntax-errors-in-config-file.js | 82 +- .../demo/updates-with-bad-reference.js | 6 +- .../demo/updates-with-circular-reference.js | 208 ++--- ...mit-any-files-on-error-with-incremental.js | 567 ++++++++++++ .../does-not-emit-any-files-on-error.js | 309 ++++++- .../creates-solution-in-watch-mode.js | 158 ++-- .../incremental-updates-in-verbose-mode.js | 304 +++---- .../when-file-with-no-error-changes.js | 82 +- ...ing-errors-only-changed-file-is-emitted.js | 92 +- .../when-file-with-no-error-changes.js | 6 +- ...ixing-error-files-all-files-are-emitted.js | 76 +- .../when-preserveWatchOutput-is-not-used.js | 162 ++-- ...veWatchOutput-is-passed-on-command-line.js | 160 ++-- ...tches-config-files-that-are-not-present.js | 178 ++-- ...e-down-stream-project-and-then-fixes-it.js | 202 ++--- ...ncing-project-even-for-non-local-change.js | 160 ++-- ...le-is-added,-and-its-subsequent-updates.js | 266 +++--- ...hanges-and-reports-found-errors-message.js | 374 ++++---- ...not-start-build-of-referencing-projects.js | 192 ++-- ...le-is-added,-and-its-subsequent-updates.js | 266 +++--- ...hanges-and-reports-found-errors-message.js | 374 ++++---- ...not-start-build-of-referencing-projects.js | 192 ++-- ...hen-noUnusedParameters-changes-to-false.js | 14 +- .../reexport/Reports-errors-correctly.js | 230 ++--- ...and-line-but-has-tsbuild-info-in-config.js | 40 +- ...and-line-but-has-tsbuild-info-in-config.js | 40 +- ...setting-composite-false-on-command-line.js | 39 +- ...-setting-composite-null-on-command-line.js | 39 +- ...rough-indirect-symlink-moduleCaseChange.js | 60 +- ...ibling-package-through-indirect-symlink.js | 60 +- ...ther-symlinked-package-moduleCaseChange.js | 58 +- ...age-with-indirect-link-moduleCaseChange.js | 40 +- ...er-symlinked-package-with-indirect-link.js | 40 +- ...gh-source-and-another-symlinked-package.js | 58 +- .../with-noEmitOnError.js | 78 -- .../with-only-dts-files.js | 44 - ...g-filename-for-buildinfo-on-commandline.js | 49 +- .../when-passing-rootDir-from-commandline.js | 46 +- ...when-passing-rootDir-is-in-the-tsconfig.js | 47 +- .../with-noEmitOnError-semantic-errors.js | 211 +++++ .../with-noEmitOnError-syntax-errors.js | 227 +++++ .../initial-build/with-noEmitOnError.js | 18 - .../initial-build/with-only-dts-files.js | 94 +- ...g-filename-for-buildinfo-on-commandline.js | 5 - .../when-passing-rootDir-from-commandline.js | 5 - ...when-passing-rootDir-is-in-the-tsconfig.js | 5 - .../no-change-run/with-only-dts-files.js | 5 - .../initial-build/combined-with-watch.js | 15 +- .../listFilesOnly/initial-build/loose-file.js | 27 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 12 +- .../createWatchOfConfigFile.js | 20 +- ...Result-on-WatchCompilerHostOfConfigFile.js | 20 +- .../consoleClearing/with---diagnostics.js | 20 +- .../with---extendedDiagnostics.js | 20 +- .../with---preserveWatchOutput.js | 20 +- ...---diagnostics-or---extendedDiagnostics.js | 20 +- ...ms-correctly-in-incremental-compilation.js | 46 +- ...s-deleted-and-created-as-part-of-change.js | 20 +- ...ndles-new-lines-carriageReturn-lineFeed.js | 28 +- .../handles-new-lines-lineFeed.js | 28 +- .../should-emit-specified-file.js | 70 +- ...elf-if-'--isolatedModules'-is-specified.js | 82 +- ...-if-'--out'-or-'--outFile'-is-specified.js | 114 +-- ...should-be-up-to-date-with-deleted-files.js | 84 +- ...-be-up-to-date-with-newly-created-files.js | 96 +- ...-to-date-with-the-reference-map-changes.js | 158 ++-- ...les-referencing-it-if-its-shape-changed.js | 100 ++- ...should-detect-changes-in-non-root-files.js | 66 +- .../should-detect-non-existing-code-file.js | 56 +- .../should-detect-removed-code-file.js | 42 +- ...ll-files-if-a-global-file-changed-shape.js | 86 +- ...ould-return-cascaded-affected-file-list.js | 148 ++-- ...fine-for-files-with-circular-references.js | 52 +- .../config-does-not-have-out-or-outFile.js | 30 +- .../config-has-out.js | 26 +- .../config-has-outFile.js | 26 +- ...ltiple-declaration-files-in-the-program.js | 36 +- ...ltiple-declaration-files-in-the-program.js | 42 +- ...-recursive-directory-watcher-is-invoked.js | 32 +- ...es-errors-when-deep-import-file-changes.js | 96 +- ...import-through-declaration-file-changes.js | 22 +- ...g-a-deep-multilevel-import-that-changes.js | 90 +- ...n-there-are-circular-import-and-exports.js | 128 +-- ...here-are-no-circular-import-and-exports.js | 120 +-- .../with-noEmitOnError-with-incremental.js | 534 ++++++++++++ .../with-noEmitOnError.js | 284 +++++- ...es-errors-when-deep-import-file-changes.js | 116 +-- ...import-through-declaration-file-changes.js | 30 +- ...g-a-deep-multilevel-import-that-changes.js | 166 ++-- ...n-there-are-circular-import-and-exports.js | 142 +-- ...here-are-no-circular-import-and-exports.js | 134 +-- .../with-noEmitOnError-with-incremental.js | 551 ++++++++++++ .../with-noEmitOnError.js | 285 +++++- ...es-errors-when-deep-import-file-changes.js | 96 +- ...import-through-declaration-file-changes.js | 22 +- ...g-a-deep-multilevel-import-that-changes.js | 90 +- ...n-there-are-circular-import-and-exports.js | 128 +-- ...here-are-no-circular-import-and-exports.js | 120 +-- .../with-noEmitOnError-with-incremental.js | 538 ++++++++++++ .../default/with-noEmitOnError.js | 284 +++++- ...es-errors-when-deep-import-file-changes.js | 128 +-- ...import-through-declaration-file-changes.js | 32 +- ...g-a-deep-multilevel-import-that-changes.js | 170 ++-- ...n-there-are-circular-import-and-exports.js | 152 ++-- ...here-are-no-circular-import-and-exports.js | 142 +-- .../with-noEmitOnError-with-incremental.js | 549 ++++++++++++ .../defaultAndD/with-noEmitOnError.js | 285 +++++- ...es-errors-when-deep-import-file-changes.js | 94 +- ...import-through-declaration-file-changes.js | 22 +- ...g-a-deep-multilevel-import-that-changes.js | 88 +- ...n-there-are-circular-import-and-exports.js | 126 +-- ...here-are-no-circular-import-and-exports.js | 118 +-- .../with-noEmitOnError-with-incremental.js | 534 ++++++++++++ .../isolatedModules/with-noEmitOnError.js | 284 +++++- ...es-errors-when-deep-import-file-changes.js | 128 +-- ...import-through-declaration-file-changes.js | 32 +- ...g-a-deep-multilevel-import-that-changes.js | 168 ++-- ...n-there-are-circular-import-and-exports.js | 150 ++-- ...here-are-no-circular-import-and-exports.js | 140 +-- .../with-noEmitOnError-with-incremental.js | 551 ++++++++++++ .../isolatedModulesAndD/with-noEmitOnError.js | 285 +++++- ...nging-module-name-with-different-casing.js | 54 +- ...hen-renaming-file-with-different-casing.js | 44 +- ...al-with-circular-references-incremental.js | 80 +- ...remental-with-circular-references-watch.js | 128 +-- .../own-file-emit-with-errors-incremental.js | 80 +- .../own-file-emit-with-errors-watch.js | 114 +-- ...wn-file-emit-without-errors-incremental.js | 62 +- .../own-file-emit-without-errors-watch.js | 102 +-- .../with---out-incremental.js | 44 +- .../module-compilation/with---out-watch.js | 80 +- .../own-file-emit-with-errors-incremental.js | 80 +- .../own-file-emit-with-errors-watch.js | 114 +-- ...eters-that-are-not-relative-incremental.js | 62 +- ...-parameters-that-are-not-relative-watch.js | 102 +-- ...without-commandline-options-incremental.js | 62 +- .../without-commandline-options-watch.js | 102 +-- ...declaration-file-is-deleted-incremental.js | 80 +- ...lobal-declaration-file-is-deleted-watch.js | 112 +-- .../incremental/with---out-incremental.js | 44 +- .../tscWatch/incremental/with---out-watch.js | 76 +- ...nerated-when-the-config-file-has-errors.js | 12 +- ...configFile-contents-when-options-change.js | 14 +- ...rs-document-is-not-contained-in-project.js | 10 +- ...rts-errors-when-the-config-file-changes.js | 16 +- ...nostics-when-'--noUnusedLabels'-changes.js | 16 +- ...-a-configured-program-without-file-list.js | 24 +- ...hould-remove-the-module-not-found-error.js | 38 +- ...has-changed-(new-file-in-list-of-files).js | 24 +- ...ot-files-has-changed-(new-file-on-disk).js | 24 +- ...config-file-name-with-difference-casing.js | 12 +- ...-when-set-of-root-files-was-not-changed.js | 32 +- ...iles-are-reflected-in-project-structure.js | 74 +- .../config-file-includes-the-file.js | 42 +- .../programUpdates/config-file-is-deleted.js | 22 +- ...s-changes-in-lib-section-of-config-file.js | 16 +- ...te-configured-project-without-file-list.js | 20 +- .../create-watch-without-config-file.js | 18 +- ...eleted-files-affect-project-structure-2.js | 86 +- .../deleted-files-affect-project-structure.js | 86 +- ...iles-explicitly-excluded-in-config-file.js | 20 +- .../handle-recreated-files-correctly.js | 30 +- ...se-they-were-added-with-tripleSlashRefs.js | 26 +- ...esnt-have-errors,-they-are-not-reported.js | 12 +- ...ndle-@types-if-input-file-list-is-empty.js | 4 +- ...e-tolerated-without-crashing-the-server.js | 4 +- ...tore-the-states-for-configured-projects.js | 66 +- ...estore-the-states-for-inferred-projects.js | 62 +- ...rors-correctly-with-file-not-in-rootDir.js | 32 +- ...s-errors-correctly-with-isolatedModules.js | 46 +- ...non-existing-directories-in-config-file.js | 12 +- ...ting-files-specified-in-the-config-file.js | 12 +- .../declarationDir-is-specified.js | 56 +- ...-outDir-and-declarationDir-is-specified.js | 56 +- .../when-outDir-is-specified.js | 40 +- .../with-outFile.js | 34 +- .../without-outDir-or-outFile-is-specified.js | 40 +- ...odule-resolution-changes-in-config-file.js | 28 +- .../should-reflect-change-in-config-file.js | 24 +- ...errors-and-still-try-to-build-a-project.js | 20 +- ...when-file-changes-from-global-to-module.js | 50 +- ...-from-config-file-path-if-config-exists.js | 12 +- ...tes-diagnostics-and-emit-for-decorators.js | 96 +- ...it-when-useDefineForClassFields-changes.js | 52 +- ...mit-when-importsNotUsedAsValues-changes.js | 78 +- ...on-emit-is-disabled-in-compiler-options.js | 12 +- .../with-default-options.js | 22 +- .../with-skipDefaultLibCheck.js | 22 +- .../with-skipLibCheck.js | 22 +- .../with-default-options.js | 34 +- .../with-skipDefaultLibCheck.js | 34 +- .../with-skipLibCheck.js | 34 +- ...when-ambient-modules-of-program-changes.js | 24 +- ...orceConsistentCasingInFileNames-changes.js | 40 +- ...s-errors-when-noErrorTruncation-changes.js | 14 +- ...es-errors-when-strictNullChecks-changes.js | 18 +- ...solution-when-resolveJsonModule-changes.js | 18 +- ...and-new-file-is-added-as-part-of-change.js | 22 +- ...ibCheck-and-skipDefaultLibCheck-changes.js | 22 +- ...-file-is-changed-but-its-content-havent.js | 28 +- .../watch-with-configFile.js | 16 +- .../watch-without-configFile.js | 16 +- ...are-global-and-installed-at-later-point.js | 18 +- .../with-modules-linked-to-sibling-folder.js | 14 +- ...cluded-file-with-ambient-module-changes.js | 18 +- ...le-resolution-changes-to-ambient-module.js | 18 +- ...der-that-already-contains-@types-folder.js | 18 +- ...rogram-with-files-from-external-library.js | 50 +- ...polling-when-renaming-file-in-subfolder.js | 18 +- ...rectory-when-renaming-file-in-subfolder.js | 18 +- ...tchFile-when-renaming-file-in-subfolder.js | 18 +- ...ymlinks-to-folders-in-recursive-folders.js | 14 +- .../with-non-synchronous-watch-directory.js | 34 +- .../using-dynamic-priority-polling.js | 28 +- .../with-fallbackPolling-option.js | 20 +- .../with-watchDirectory-option.js | 20 +- ...th-watchFile-as-watch-options-to-extend.js | 20 +- .../watchOptions/with-watchFile-option.js | 20 +- 445 files changed, 29291 insertions(+), 13370 deletions(-) delete mode 100644 tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js delete mode 100644 tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js delete mode 100644 tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js delete mode 100644 tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js delete mode 100644 tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js delete mode 100644 tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js delete mode 100644 tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js delete mode 100644 tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js delete mode 100644 tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js delete mode 100644 tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js delete mode 100644 tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js delete mode 100644 tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js delete mode 100644 tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js delete mode 100644 tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js create mode 100644 tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js delete mode 100644 tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js delete mode 100644 tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js create mode 100644 tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js create mode 100644 tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js delete mode 100644 tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index d5a1e16f2f1d1..3eb2115daaf7b 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -173,7 +173,7 @@ namespace ts { const compilerOptions = newProgram.getCompilerOptions(); state.compilerOptions = compilerOptions; // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them - if (!compilerOptions.outFile && !compilerOptions.out) { + if (!outFile(compilerOptions)) { state.semanticDiagnosticsPerFile = createMap(); } state.changedFilesSet = createMap(); @@ -197,7 +197,7 @@ namespace ts { if (changedFilesSet) { copyEntries(changedFilesSet, state.changedFilesSet); } - if (!compilerOptions.outFile && !compilerOptions.out && oldState!.affectedFilesPendingEmit) { + if (!outFile(compilerOptions) && oldState!.affectedFilesPendingEmit) { state.affectedFilesPendingEmit = oldState!.affectedFilesPendingEmit.slice(); state.affectedFilesPendingEmitKind = cloneMapOrUndefined(oldState!.affectedFilesPendingEmitKind); state.affectedFilesPendingEmitIndex = oldState!.affectedFilesPendingEmitIndex; @@ -374,7 +374,7 @@ namespace ts { // so operations are performed directly on program, return program const program = Debug.checkDefined(state.program); const compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { + if (outFile(compilerOptions)) { Debug.assert(!state.semanticDiagnosticsPerFile); return program; } @@ -700,7 +700,7 @@ namespace ts { * Gets the program information to be emitted in buildInfo so that we can use it to create new program */ function getProgramBuildInfo(state: Readonly, getCanonicalFileName: GetCanonicalFileName): ProgramBuildInfo | undefined { - if (state.compilerOptions.outFile || state.compilerOptions.out) return undefined; + if (outFile(state.compilerOptions)) return undefined; const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory(); const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions)!, currentDirectory)); const fileInfos: MapLike = {}; @@ -933,7 +933,7 @@ namespace ts { let emitKind = BuilderFileEmit.Full; let isPendingEmitFile = false; if (!affected) { - if (!state.compilerOptions.out && !state.compilerOptions.outFile) { + if (!outFile(state.compilerOptions)) { const pendingAffectedFile = getNextAffectedFilePendingEmit(state); if (!pendingAffectedFile) { if (state.emittedBuildInfo) { @@ -1071,7 +1071,7 @@ namespace ts { function getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[] { assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); const compilerOptions = Debug.checkDefined(state.program).getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { + if (outFile(compilerOptions)) { Debug.assert(!state.semanticDiagnosticsPerFile); // We dont need to cache the diagnostics just return them from program return Debug.checkDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken); diff --git a/src/compiler/builderState.ts b/src/compiler/builderState.ts index 44beb3a015d7e..315e67bdbb2d5 100644 --- a/src/compiler/builderState.ts +++ b/src/compiler/builderState.ts @@ -403,7 +403,7 @@ namespace ts { export function getAllDependencies(state: BuilderState, programOfThisState: Program, sourceFile: SourceFile): readonly string[] { const compilerOptions = programOfThisState.getCompilerOptions(); // With --out or --outFile all outputs go into single file, all files depend on each other - if (compilerOptions.outFile || compilerOptions.out) { + if (outFile(compilerOptions)) { return getAllFileNames(state, programOfThisState); } @@ -519,7 +519,7 @@ namespace ts { const compilerOptions = programOfThisState.getCompilerOptions(); // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project, // so returning the file itself is good enough. - if (compilerOptions && (compilerOptions.out || compilerOptions.outFile)) { + if (compilerOptions && outFile(compilerOptions)) { return [sourceFileWithUpdatedShape]; } return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); @@ -534,7 +534,7 @@ namespace ts { } const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { + if (compilerOptions && (compilerOptions.isolatedModules || outFile(compilerOptions))) { return [sourceFileWithUpdatedShape]; } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cf13225e2b5e4..d3ff399e9a5dd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1352,7 +1352,7 @@ namespace ts { const declContainer = getEnclosingBlockScopeContainer(declaration); if (declarationFile !== useFile) { if ((moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) || - (!compilerOptions.outFile && !compilerOptions.out) || + (!outFile(compilerOptions)) || isInTypeQuery(usage) || declaration.flags & NodeFlags.Ambient) { // nodes are in different files and order cannot be determined @@ -5201,7 +5201,7 @@ namespace ts { const links = getSymbolLinks(symbol); let specifier = links.specifierCache && links.specifierCache.get(contextFile.path); if (!specifier) { - const isBundle = (compilerOptions.out || compilerOptions.outFile); + const isBundle = !!outFile(compilerOptions); // For declaration bundles, we need to generate absolute paths relative to the common source dir for imports, // just like how the declaration emitter does for the ambient module declarations - we can easily accomplish this // using the `baseUrl` compiler option (which we would otherwise never use in declaration emit) and a non-relative diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 10b6f7b786d4d..aea8ba3875e53 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -25,7 +25,7 @@ namespace ts { includeBuildInfo?: boolean) { const sourceFiles = isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit); const options = host.getCompilerOptions(); - if (options.outFile || options.out) { + if (outFile(options)) { const prepends = host.getPrependNodes(); if (sourceFiles.length || prepends.length) { const bundle = createBundle(sourceFiles, prepends); @@ -45,7 +45,7 @@ namespace ts { } } if (includeBuildInfo) { - const buildInfoPath = getTsBuildInfoEmitOutputFilePath(host.getCompilerOptions()); + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); if (buildInfoPath) return action({ buildInfoPath }, /*sourceFileOrBundle*/ undefined); } } @@ -55,7 +55,7 @@ namespace ts { const configFile = options.configFilePath; if (!isIncrementalCompilation(options)) return undefined; if (options.tsBuildInfoFile) return options.tsBuildInfoFile; - const outPath = options.outFile || options.out; + const outPath = outFile(options); let buildInfoExtensionLess: string; if (outPath) { buildInfoExtensionLess = removeFileExtension(outPath); @@ -74,7 +74,7 @@ namespace ts { /*@internal*/ export function getOutputPathsForBundle(options: CompilerOptions, forceDtsPaths: boolean): EmitFileNames { - const outPath = options.outFile || options.out!; + const outPath = outFile(options)!; const jsFilePath = options.emitDeclarationOnly ? undefined : outPath; const sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); const declarationFilePath = (forceDtsPaths || getEmitDeclarations(options)) ? removeFileExtension(outPath) + Extension.Dts : undefined; @@ -210,7 +210,7 @@ namespace ts { /*@internal*/ export function getAllProjectOutputs(configFile: ParsedCommandLine, ignoreCase: boolean): readonly string[] { const { addOutput, getOutputs } = createAddOutput(); - if (configFile.options.outFile || configFile.options.out) { + if (outFile(configFile.options)) { getSingleOutputFileNames(configFile, addOutput); } else { @@ -226,7 +226,7 @@ namespace ts { inputFileName = normalizePath(inputFileName); Debug.assert(contains(commandLine.fileNames, inputFileName), `Expected fileName to be present in command line`); const { addOutput, getOutputs } = createAddOutput(); - if (commandLine.options.outFile || commandLine.options.out) { + if (outFile(commandLine.options)) { getSingleOutputFileNames(commandLine, addOutput); } else { @@ -237,7 +237,7 @@ namespace ts { /*@internal*/ export function getFirstProjectOutput(configFile: ParsedCommandLine, ignoreCase: boolean): string { - if (configFile.options.outFile || configFile.options.out) { + if (outFile(configFile.options)) { const { jsFilePath } = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false); return Debug.checkDefined(jsFilePath, `project ${configFile.options.configFilePath} expected to have at least one output`); } @@ -404,7 +404,7 @@ namespace ts { const sourceFiles = isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles; const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson); // Setup and perform the transformation to retrieve declarations from the input files - const inputListOrBundle = (compilerOptions.outFile || compilerOptions.out) ? [createBundle(filesForEmit, !isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : filesForEmit; + const inputListOrBundle = outFile(compilerOptions) ? [createBundle(filesForEmit, !isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : filesForEmit; if (emitOnlyDtsFiles && !getEmitDeclarations(compilerOptions)) { // Checker wont collect the linked aliases since thats only done when declaration is enabled. // Do that here when emitting only dts files diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 833da8c8a6a56..795c1cdcea15d 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -1581,7 +1581,7 @@ namespace ts { if (file.moduleName) { return createLiteral(file.moduleName); } - if (!file.isDeclarationFile && (options.out || options.outFile)) { + if (!file.isDeclarationFile && outFile(options)) { return createLiteral(getExternalModuleNameFromPath(host, file.fileName)); } return undefined; diff --git a/src/compiler/program.ts b/src/compiler/program.ts index c8847d0435896..c9a3f88476fc6 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -834,7 +834,7 @@ namespace ts { if (rootNames.length) { for (const parsedRef of resolvedProjectReferences) { if (!parsedRef) continue; - const out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out; + const out = outFile(parsedRef.commandLine.options); if (useSourceOfProjectReferenceRedirect) { if (out || getEmitModuleKind(parsedRef.commandLine.options) === ModuleKind.None) { for (const fileName of parsedRef.commandLine.fileNames) { @@ -1503,7 +1503,7 @@ namespace ts { } function emitBuildInfo(writeFileCallback?: WriteFileCallback): EmitResult { - Debug.assert(!options.out && !options.outFile); + Debug.assert(!outFile(options)); performance.mark("beforeEmit"); const emitResult = emitFiles( notImplementedResolver, @@ -1597,7 +1597,7 @@ namespace ts { // This is because in the -out scenario all files need to be emitted, and therefore all // files need to be type checked. And the way to specify that all files need to be type // checked is to not pass the file to getEmitResolver. - const emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile, cancellationToken); + const emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(outFile(options) ? undefined : sourceFile, cancellationToken); performance.mark("beforeEmit"); @@ -1674,7 +1674,7 @@ namespace ts { function getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[] { const options = program.getCompilerOptions(); // collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit) - if (!sourceFile || options.out || options.outFile) { + if (!sourceFile || outFile(options)) { return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } else { @@ -2403,7 +2403,7 @@ namespace ts { if (refFile && !useSourceOfProjectReferenceRedirect) { const redirectProject = getProjectReferenceRedirectProject(fileName); if (redirectProject) { - if (redirectProject.commandLine.options.outFile || redirectProject.commandLine.options.out) { + if (outFile(redirectProject.commandLine.options)) { // Shouldnt create many to 1 mapping file in --out scenario return undefined; } @@ -2535,7 +2535,7 @@ namespace ts { function getProjectReferenceOutputName(referencedProject: ResolvedProjectReference, fileName: string) { - const out = referencedProject.commandLine.options.outFile || referencedProject.commandLine.options.out; + const out = outFile(referencedProject.commandLine.options); return out ? changeExtension(out, Extension.Dts) : getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames()); @@ -2577,7 +2577,7 @@ namespace ts { mapFromToProjectReferenceRedirectSource = createMap(); forEachResolvedProjectReference(resolvedRef => { if (resolvedRef) { - const out = resolvedRef.commandLine.options.outFile || resolvedRef.commandLine.options.out; + const out = outFile(resolvedRef.commandLine.options); if (out) { // Dont know which source file it means so return true? const outputDts = changeExtension(out, Extension.Dts); @@ -3001,12 +3001,13 @@ namespace ts { } } + const outputFile = outFile(options); if (options.tsBuildInfoFile) { if (!isIncrementalCompilation(options)) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "tsBuildInfoFile", "incremental", "composite"); } } - else if (options.incremental && !options.outFile && !options.out && !options.configFilePath) { + else if (options.incremental && !outputFile && !options.configFilePath) { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); } @@ -3087,7 +3088,7 @@ namespace ts { if (!getEmitDeclarations(options)) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationDir", "declaration", "composite"); } - if (options.out || options.outFile) { + if (outputFile) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "declarationDir", options.out ? "out" : "outFile"); } } @@ -3105,7 +3106,6 @@ namespace ts { } const languageVersion = options.target || ScriptTarget.ES3; - const outFile = options.outFile || options.out; const firstNonAmbientExternalModuleSourceFile = find(files, f => isExternalModule(f) && !f.isDeclarationFile); if (options.isolatedModules) { @@ -3126,7 +3126,7 @@ namespace ts { } // Cannot specify module gen that isn't amd or system with --out - if (outFile && !options.emitDeclarationOnly) { + if (outputFile && !options.emitDeclarationOnly) { if (options.module && !(options.module === ModuleKind.AMD || options.module === ModuleKind.System)) { createDiagnosticForOptionName(Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile", "module"); } @@ -3286,7 +3286,7 @@ namespace ts { } } if (ref.prepend) { - const out = options.outFile || options.out; + const out = outFile(options); if (out) { if (!host.fileExists(out)) { createDiagnosticForReference(parentFile, index, Diagnostics.Output_file_0_from_project_1_does_not_exist, out, ref.path); @@ -3421,7 +3421,7 @@ namespace ts { } // If options have --outFile or --out just check that - const out = options.outFile || options.out; + const out = outFile(options); if (out) { return isSameFile(filePath, out) || isSameFile(filePath, removeFileExtension(out) + Extension.Dts); } @@ -3504,7 +3504,7 @@ namespace ts { mapOfDeclarationDirectories = createMap(); host.forEachResolvedProjectReference(ref => { if (!ref) return; - const out = ref.commandLine.options.outFile || ref.commandLine.options.out; + const out = outFile(ref.commandLine.options); if (out) { mapOfDeclarationDirectories!.set(getDirectoryPath(host.toPath(out)), true); } @@ -3704,7 +3704,7 @@ namespace ts { const ref = projectReferences[i]; const resolvedRefOpts = getCommandLine(ref, i); if (ref.prepend && resolvedRefOpts && resolvedRefOpts.options) { - const out = resolvedRefOpts.options.outFile || resolvedRefOpts.options.out; + const out = outFile(resolvedRefOpts.options); // Upstream project didn't have outFile set -- skip (error will have been issued earlier) if (!out) continue; diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index edecee9d17686..b0b0fc17da99e 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -56,7 +56,7 @@ namespace ts { if (node.isDeclarationFile || !(isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & TransformFlags.ContainsDynamicImport || - (isJsonSourceFile(node) && hasJsonModuleEmitEnabled(compilerOptions) && (compilerOptions.out || compilerOptions.outFile)))) { + (isJsonSourceFile(node) && hasJsonModuleEmitEnabled(compilerOptions) && outFile(compilerOptions)))) { return node; } diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index 6d0a7ee6b523b..750b4525e74e9 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -119,7 +119,7 @@ namespace ts { ) ), EmitFlags.NoTrailingComments); - if (!(compilerOptions.outFile || compilerOptions.out)) { + if (!outFile(compilerOptions)) { moveEmitHelpers(updated, moduleBodyBlock, helper => !helper.scoped); } diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 3eb793b7599bb..a55712c44944b 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -1799,7 +1799,7 @@ namespace ts { } // If options have --outFile or --out, check if its that - const out = configFile.options.outFile || configFile.options.out; + const out = outFile(configFile.options); if (out && (isSameFile(state, fileName, out) || isSameFile(state, fileName, removeFileExtension(out) + Extension.Dts))) { return true; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 06d4c9020143b..29d5cdfe74f0b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3858,6 +3858,10 @@ namespace ts { return removeFileExtension(path) + Extension.Dts; } + export function outFile(options: CompilerOptions) { + return options.outFile || options.out; + } + export interface EmitFileNames { jsFilePath?: string | undefined; sourceMapFilePath?: string | undefined; @@ -3877,7 +3881,7 @@ namespace ts { */ export function getSourceFilesToEmit(host: EmitHost, targetSourceFile?: SourceFile, forceDtsEmit?: boolean): readonly SourceFile[] { const options = host.getCompilerOptions(); - if (options.outFile || options.out) { + if (outFile(options)) { const moduleKind = getEmitModuleKind(options); const moduleEmitEnabled = options.emitDeclarationOnly || moduleKind === ModuleKind.AMD || moduleKind === ModuleKind.System; // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index d7b9f3b058795..5b7e7c357ee7c 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -5,7 +5,7 @@ namespace ts { readFile(fileName: string): string | undefined; } export function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost) { - if (compilerOptions.out || compilerOptions.outFile) return undefined; + if (outFile(compilerOptions)) return undefined; const buildInfoPath = getTsBuildInfoEmitOutputFilePath(compilerOptions); if (!buildInfoPath) return undefined; const content = host.readFile(buildInfoPath); diff --git a/src/harness/vfsUtil.ts b/src/harness/vfsUtil.ts index 88fc73ebca9be..71d95b4d4ab60 100644 --- a/src/harness/vfsUtil.ts +++ b/src/harness/vfsUtil.ts @@ -34,6 +34,7 @@ namespace vfs { export interface DiffOptions { includeChangedFileWithSameContent?: boolean; + baseIsNotShadowRoot?: boolean; } /** @@ -697,7 +698,8 @@ namespace vfs { * Generates a `FileSet` patch containing all the entries in this `FileSystem` that are not in `base`. * @param base The base file system. If not provided, this file system's `shadowRoot` is used (if present). */ - public diff(base = this.shadowRoot, options: DiffOptions = {}) { + public diff(base?: FileSystem | undefined, options: DiffOptions = {}) { + if (!base && !options.baseIsNotShadowRoot) base = this.shadowRoot; const differences: FileSet = {}; const hasDifferences = base ? FileSystem.rootDiff(differences, this, base, options) : diff --git a/src/server/project.ts b/src/server/project.ts index ee007b0b2131f..a3645fdddd1f3 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -1035,7 +1035,7 @@ namespace ts.server { ); if (this.generatedFilesMap) { - const outPath = this.compilerOptions.outFile && this.compilerOptions.out; + const outPath = outFile(this.compilerOptions); if (isGeneratedFileWatcher(this.generatedFilesMap)) { // --out if (!outPath || !this.isValidGeneratedFileWatcher( @@ -1209,7 +1209,7 @@ namespace ts.server { /* @internal */ addGeneratedFileWatch(generatedFile: string, sourceFile: string) { - if (this.compilerOptions.outFile || this.compilerOptions.out) { + if (outFile(this.compilerOptions)) { // Single watcher if (!this.generatedFilesMap) { this.generatedFilesMap = this.createGeneratedFileWatcher(generatedFile); diff --git a/src/server/session.ts b/src/server/session.ts index 3f0321074a994..28681eb6c0a86 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1721,7 +1721,7 @@ namespace ts.server { return { projectFileName: project.getProjectName(), fileNames: project.getCompileOnSaveAffectedFileList(info), - projectUsesOutFile: !!compilationSettings.outFile || !!compilationSettings.out + projectUsesOutFile: !!outFile(compilationSettings) }; } ); diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index b582ba0065d86..e095708ed94d0 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -76,7 +76,7 @@ namespace ts { } const options = program.getCompilerOptions(); - const outPath = options.outFile || options.out; + const outPath = outFile(options); const declarationPath = outPath ? removeFileExtension(outPath) + Extension.Dts : diff --git a/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts b/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts index 8a208a698fa6a..8ccfbe5fe4742 100644 --- a/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts +++ b/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts @@ -1,11 +1,11 @@ namespace ts { describe("unittests:: tsbuild:: when containerOnly project is referenced", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "containerOnlyReferenced", subScenario: "verify that subsequent builds after initial build doesnt build anything", fs: () => loadProjectFromDisk("tests/projects/containerOnlyReferenced"), commandLineArgs: ["--b", "/src", "--verbose"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); }); } diff --git a/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts b/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts index e7dff56ab9fa9..c673cd11bcd6a 100644 --- a/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts +++ b/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts @@ -9,7 +9,7 @@ namespace ts { }); function verifyEmitDeclarationOnly(disableMap?: true) { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: `only dts output in circular import project with emitDeclarationOnly${disableMap ? "" : " and declarationMap"}`, fs: () => projFs, scenario: "emitDeclarationOnly", @@ -26,7 +26,7 @@ namespace ts { verifyEmitDeclarationOnly(); verifyEmitDeclarationOnly(/*disableMap*/ true); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: `only dts output in non circular imports project with emitDeclarationOnly`, fs: () => projFs, scenario: "emitDeclarationOnly", @@ -36,17 +36,17 @@ namespace ts { replaceText(fs, "/src/src/a.ts", `import { B } from "./b";`, `export class B { prop = "hello"; }`); }, incrementalScenarios: [ - { - buildKind: BuildKind.IncrementalDtsChange, - modifyFs: fs => replaceText(fs, "/src/src/a.ts", "b: B;", "b: B; foo: any;"), - - }, { buildKind: BuildKind.IncrementalDtsUnchanged, modifyFs: fs => replaceText(fs, "/src/src/a.ts", "export interface A {", `class C { } export interface A {`), }, + { + buildKind: BuildKind.IncrementalDtsChange, + modifyFs: fs => replaceText(fs, "/src/src/a.ts", "b: B;", "b: B; foo: any;"), + + }, ], }); }); diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index cadfa8bde60cc..f6b1572ed8bd8 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -240,7 +240,7 @@ interface Symbol { sys: System & { writtenFiles: Map; }, originalReadCall?: System["readFile"] ) { - const out = options.outFile || options.out; + const out = outFile(options); if (!out) return; const { buildInfoPath, jsFilePath, declarationFilePath } = getOutputPathsForBundle(options, /*forceDts*/ false); if (!buildInfoPath || !sys.writtenFiles.has(buildInfoPath)) return; @@ -260,6 +260,42 @@ interface Symbol { sys.writeFile(`${buildInfoPath}.baseline.txt`, text); } + interface VerifyIncrementalCorrectness { + scenario: TscCompile["scenario"]; + subScenario: TscCompile["subScenario"]; + commandLineArgs: TscCompile["commandLineArgs"]; + modifyFs: TscCompile["modifyFs"]; + incrementalModifyFs: TscIncremental["modifyFs"]; + tick: () => void; + baseFs: vfs.FileSystem; + newSys: TscCompileSystem; + } + function verifyIncrementalCorrectness(input: () => VerifyIncrementalCorrectness) { + it(`Verify emit output file text is same when built clean`, () => { + const { + scenario, subScenario, commandLineArgs, + modifyFs, incrementalModifyFs, + tick, baseFs, newSys + } = input(); + const sys = tscCompile({ + scenario, + subScenario, + fs: () => baseFs.makeReadonly(), + commandLineArgs, + modifyFs: fs => { + tick(); + if (modifyFs) modifyFs(fs); + incrementalModifyFs(fs); + }, + }); + for (const outputFile of arrayFrom(sys.writtenFiles.keys())) { + const expectedText = sys.readFile(outputFile); + const actualText = newSys.readFile(outputFile); + assert.equal(actualText, expectedText, `File: ${outputFile}`); + } + }); + } + export interface TscIncremental { buildKind: BuildKind; modifyFs: (fs: vfs.FileSystem) => void; @@ -267,20 +303,34 @@ interface Symbol { commandLineArgs?: readonly string[]; } - export interface VerifyTsBuildInput extends TscCompile { - incrementalScenarios: TscIncremental[]; + export interface VerifyTsBuildInput extends VerifyTsBuildInputWorker { + baselineIncremental?: boolean; } - export function verifyTscIncrementalEdits({ + export function verifyTscIncrementalEdits(input: VerifyTsBuildInput) { + verifyTscIncrementalEditsWorker(input); + if (input.baselineIncremental) { + verifyTscIncrementalEditsWorker({ + ...input, + subScenario: `${input.subScenario} with incremental`, + commandLineArgs: [...input.commandLineArgs, "--incremental"], + }); + } + } + + export interface VerifyTsBuildInputWorker extends TscCompile { + incrementalScenarios: TscIncremental[]; + } + function verifyTscIncrementalEditsWorker({ subScenario, fs, scenario, commandLineArgs, - baselineSourceMap, modifyFs, baselineReadFileCalls, + baselineSourceMap, modifyFs, baselineReadFileCalls, baselinePrograms, incrementalScenarios - }: VerifyTsBuildInput) { + }: VerifyTsBuildInputWorker) { describe(`tsc ${commandLineArgs.join(" ")} ${scenario}:: ${subScenario}`, () => { let tick: () => void; let sys: TscCompileSystem; + let baseFs: vfs.FileSystem; before(() => { - let baseFs: vfs.FileSystem; ({ fs: baseFs, tick } = getFsWithTime(fs())); sys = tscCompile({ scenario, @@ -292,11 +342,13 @@ interface Symbol { tick(); }, baselineSourceMap, - baselineReadFileCalls + baselineReadFileCalls, + baselinePrograms }); Debug.assert(!!incrementalScenarios.length, `${scenario}/${subScenario}:: No incremental scenarios, you probably want to use verifyTsc instead.`); }); after(() => { + baseFs = undefined!; sys = undefined!; tick = undefined!; }); @@ -306,7 +358,7 @@ interface Symbol { for (const { buildKind, - modifyFs, + modifyFs: incrementalModifyFs, subScenario: incrementalSubScenario, commandLineArgs: incrementalCommandLineArgs } of incrementalScenarios) { @@ -323,43 +375,133 @@ interface Symbol { commandLineArgs: incrementalCommandLineArgs || commandLineArgs, modifyFs: fs => { tick(); - modifyFs(fs); + incrementalModifyFs(fs); tick(); }, baselineSourceMap, - baselineReadFileCalls + baselineReadFileCalls, + baselinePrograms }); }); after(() => { newSys = undefined!; }); verifyTscBaseline(() => newSys); - it(`Verify emit output file text is same when built clean`, () => { - const sys = tscCompile({ - scenario, - subScenario, - fs: () => newSys.vfs, - commandLineArgs, - modifyFs: fs => { - tick(); - // Delete output files - const host = fakes.SolutionBuilderHost.create(fs); - const builder = createSolutionBuilder(host, commandLineArgs, { clean: true }); - builder.clean(); - }, - }); - - for (const outputFile of arrayFrom(sys.writtenFiles.keys())) { - const expectedText = sys.readFile(outputFile); - const actualText = newSys.readFile(outputFile); - assert.equal(actualText, expectedText, `File: ${outputFile}`); - } - }); + verifyIncrementalCorrectness(() => ({ + scenario, + subScenario, + baseFs, + newSys, + commandLineArgs, + incrementalModifyFs, + modifyFs, + tick + })); }); } }); } + export function verifyTscSerializedIncrementalEdits(input: VerifyTsBuildInput) { + verifyTscSerializedIncrementalEditsWorker(input); + if (input.baselineIncremental) { + verifyTscSerializedIncrementalEditsWorker({ + ...input, + subScenario: `${input.subScenario} with incremental`, + commandLineArgs: [...input.commandLineArgs, "--incremental"], + }); + } + } + function verifyTscSerializedIncrementalEditsWorker({ + subScenario, fs, scenario, commandLineArgs, + baselineSourceMap, modifyFs, baselineReadFileCalls, baselinePrograms, + incrementalScenarios + }: VerifyTsBuildInputWorker) { + describe(`tsc ${commandLineArgs.join(" ")} ${scenario}:: ${subScenario} serializedEdits`, () => { + Debug.assert(!!incrementalScenarios.length, `${scenario}/${subScenario}:: No incremental scenarios, you probably want to use verifyTsc instead.`); + let tick: () => void; + let sys: TscCompileSystem; + let baseFs: vfs.FileSystem; + let incrementalSys: TscCompileSystem[]; + before(() => { + ({ fs: baseFs, tick } = getFsWithTime(fs())); + sys = tscCompile({ + scenario, + subScenario, + fs: () => baseFs.makeReadonly(), + commandLineArgs, + modifyFs: fs => { + if (modifyFs) modifyFs(fs); + tick(); + }, + baselineSourceMap, + baselineReadFileCalls, + baselinePrograms + }); + incrementalScenarios.forEach(( + { buildKind, modifyFs, subScenario: incrementalSubScenario, commandLineArgs: incrementalCommandLineArgs }, + index + ) => { + Debug.assert(buildKind !== BuildKind.Initial, "Incremental edit cannot be initial compilation"); + tick(); + (incrementalSys || (incrementalSys = [])).push(tscCompile({ + scenario, + subScenario: incrementalSubScenario || subScenario, + buildKind, + fs: () => index === 0 ? sys.vfs : incrementalSys[index - 1].vfs, + commandLineArgs: incrementalCommandLineArgs || commandLineArgs, + modifyFs: fs => { + tick(); + modifyFs(fs); + tick(); + }, + baselineSourceMap, + baselineReadFileCalls, + baselinePrograms + })); + }); + }); + after(() => { + baseFs = undefined!; + sys = undefined!; + tick = undefined!; + incrementalSys = undefined!; + }); + describe("serializedBuild", () => { + + verifyTscBaseline(() => ({ + baseLine: () => { + const { file, text } = sys.baseLine(); + const texts: string[] = [text]; + incrementalSys.forEach((sys, index) => { + const incrementalScenario = incrementalScenarios[index]; + texts.push(""); + texts.push(`Change:: ${incrementalScenario.subScenario || incrementalScenario.buildKind}`); + texts.push(sys.baseLine().text); + }); + return { file, text: texts.join("\r\n") }; + } + })); + }); + describe("incremental correctness", () => { + incrementalScenarios.forEach((_, index) => verifyIncrementalCorrectness(() => ({ + scenario, + subScenario, + baseFs, + newSys: incrementalSys[index], + commandLineArgs, + incrementalModifyFs: fs => { + for (let i = 0; i <= index; i++) { + incrementalScenarios[i].modifyFs(fs); + } + }, + modifyFs, + tick + }))); + }); + }); + } + export function enableStrict(fs: vfs.FileSystem, path: string) { replaceText(fs, path, `"strict": false`, `"strict": true`); } diff --git a/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts b/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts index eb3658d14ccaa..f5037f304cef0 100644 --- a/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts +++ b/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts @@ -8,7 +8,7 @@ namespace ts { projFs = undefined!; }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "inferredTypeFromTransitiveModule", subScenario: "inferred type from transitive module", fs: () => projFs, @@ -19,7 +19,7 @@ namespace ts { }], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "inferred type from transitive module with isolatedModules", fs: () => projFs, scenario: "inferredTypeFromTransitiveModule", @@ -31,7 +31,7 @@ namespace ts { }] }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "inferredTypeFromTransitiveModule", subScenario: "reports errors in files affected by change in signature with isolatedModules", fs: () => projFs, diff --git a/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts b/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts index 2f8284849cfae..450da2cd14f92 100644 --- a/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts +++ b/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts @@ -183,7 +183,7 @@ namespace ts { fs: () => projFs, commandLineArgs: ["-b", "/src"] }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "javascriptProjectEmit", subScenario: `modifies outfile js projects and concatenates them correctly`, fs: () => projFs, diff --git a/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts b/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts index 15ac34c222c0c..5ea071a0ca2bf 100644 --- a/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts +++ b/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts @@ -1,6 +1,6 @@ namespace ts { describe("unittests:: tsbuild:: lateBoundSymbol:: interface is merged and contains late bound member", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "interface is merged and contains late bound member", fs: () => loadProjectFromDisk("tests/projects/lateBoundSymbol"), scenario: "lateBoundSymbol", diff --git a/src/testRunner/unittests/tsbuild/noEmitOnError.ts b/src/testRunner/unittests/tsbuild/noEmitOnError.ts index 41afbca2dd905..75e17f66203e9 100644 --- a/src/testRunner/unittests/tsbuild/noEmitOnError.ts +++ b/src/testRunner/unittests/tsbuild/noEmitOnError.ts @@ -1,10 +1,48 @@ namespace ts { describe("unittests:: tsbuild - with noEmitOnError", () => { - verifyTsc({ - scenario: "noEmitOnError", - subScenario: "has empty files diagnostic when files is empty and no references are provided", - fs: () => loadProjectFromDisk("tests/projects/noEmitOnError"), - commandLineArgs: ["--b", "/src/tsconfig.json"], + let projFs: vfs.FileSystem; + before(() => { + projFs = loadProjectFromDisk("tests/projects/noEmitOnError"); }); + after(() => { + projFs = undefined!; + }); + + function verifyNoEmitOnError(subScenario: string, fixModifyFs: TscIncremental["modifyFs"], modifyFs?: TscIncremental["modifyFs"]) { + verifyTscSerializedIncrementalEdits({ + scenario: "noEmitOnError", + subScenario, + fs: () => projFs, + modifyFs, + commandLineArgs: ["--b", "/src/tsconfig.json"], + incrementalScenarios: [ + noChangeRun, + { + subScenario: "Fix error", + buildKind: BuildKind.IncrementalDtsChange, + modifyFs: fixModifyFs, + }, + noChangeRun, + ], + baselinePrograms: true, + baselineIncremental: true + }); + } + + verifyNoEmitOnError( + "syntax errors", + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +};`, "utf-8") + ); + + verifyNoEmitOnError( + "semantic errors", + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = "hello";`, "utf-8"), + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = 10;`, "utf-8") + ); }); } diff --git a/src/testRunner/unittests/tsbuild/outFile.ts b/src/testRunner/unittests/tsbuild/outFile.ts index a4594409042d8..58d130d2ea973 100644 --- a/src/testRunner/unittests/tsbuild/outFile.ts +++ b/src/testRunner/unittests/tsbuild/outFile.ts @@ -169,12 +169,12 @@ namespace ts { return fs; } - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "outFile", subScenario: "clean projects", fs: getOutFileFsAfterBuild, commandLineArgs: ["--b", "/src/third", "--clean"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); verifyTsc({ diff --git a/src/testRunner/unittests/tsbuild/resolveJsonModule.ts b/src/testRunner/unittests/tsbuild/resolveJsonModule.ts index 0a5144da7c2eb..4b8c999f46cc3 100644 --- a/src/testRunner/unittests/tsbuild/resolveJsonModule.ts +++ b/src/testRunner/unittests/tsbuild/resolveJsonModule.ts @@ -51,32 +51,32 @@ export default hello.hello`); commandLineArgs: ["--b", "/src/tsconfig_withIncludeAndFiles.json"], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "resolveJsonModule", subScenario: "sourcemap", fs: () => projFs, commandLineArgs: ["--b", "src/tsconfig_withFiles.json", "--verbose"], modifyFs: fs => replaceText(fs, "src/tsconfig_withFiles.json", `"composite": true,`, `"composite": true, "sourceMap": true,`), - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "resolveJsonModule", subScenario: "without outDir", fs: () => projFs, commandLineArgs: ["--b", "src/tsconfig_withFiles.json", "--verbose"], modifyFs: fs => replaceText(fs, "src/tsconfig_withFiles.json", `"outDir": "dist",`, ""), - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); }); describe("unittests:: tsbuild:: with resolveJsonModule option on project importJsonFromProjectReference", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "resolveJsonModule", subScenario: "importing json module from project reference", fs: () => loadProjectFromDisk("tests/projects/importJsonFromProjectReference"), commandLineArgs: ["--b", "src/tsconfig.json", "--verbose"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); }); } diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index 10fe37cb33fa7..4550595ded23c 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -65,12 +65,12 @@ namespace ts { }); describe("clean builds", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "removes all files it built", fs: getSampleFsAfterBuild, commandLineArgs: ["--b", "/src/tests", "--clean"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); it("cleans till project specified", () => { @@ -98,12 +98,12 @@ namespace ts { }); describe("force builds", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "always builds under with force option", fs: () => projFs, commandLineArgs: ["--b", "/src/tests", "--force"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); }); @@ -201,7 +201,7 @@ namespace ts { ); }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "rebuilds when extended config file changes", fs: () => projFs, @@ -367,19 +367,19 @@ export class someClass { }`), { buildKind: BuildKind.IncrementalDtsUnchanged, modifyFs: fs => appendText(fs, "/src/core/index.ts", ` -class someClass { }`), +class someClass2 { }`), } ]; describe("lists files", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "listFiles", fs: () => projFs, commandLineArgs: ["--b", "/src/tests", "--listFiles"], incrementalScenarios: coreChanges }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "listEmittedFiles", fs: () => projFs, @@ -389,7 +389,7 @@ class someClass { }`), }); describe("emit output", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "sample", fs: () => projFs, scenario: "sample1", @@ -419,7 +419,7 @@ class someClass { }`), baselineReadFileCalls: true }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "when declaration option changes", fs: () => projFs, scenario: "sample1", @@ -436,7 +436,7 @@ class someClass { }`), }], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "when target option changes", fs: () => projFs, scenario: "sample1", @@ -462,7 +462,7 @@ class someClass { }`), }], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "when module option changes", fs: () => projFs, scenario: "sample1", @@ -479,7 +479,7 @@ class someClass { }`), }], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "when esModuleInterop option changes", fs: () => projFs, scenario: "sample1", diff --git a/src/testRunner/unittests/tsbuild/watchMode.ts b/src/testRunner/unittests/tsbuild/watchMode.ts index 69faba35c318e..3c17690a4eb1b 100644 --- a/src/testRunner/unittests/tsbuild/watchMode.ts +++ b/src/testRunner/unittests/tsbuild/watchMode.ts @@ -93,14 +93,16 @@ namespace ts.tscWatch { return result; } - function changeFile(sys: WatchedSystem, fileName: string, content: string, caption: string) { - sys.writeFile(fileName, content); - sys.checkTimeoutQueueLengthAndRun(1); // Builds core - return caption; + function changeFile(fileName: string | (() => string), content: string | (() => string), caption: string): TscWatchCompileChange { + return { + caption, + change: sys => sys.writeFile(isString(fileName) ? fileName : fileName(), isString(content) ? content : content()), + timeouts: checkSingleTimeoutQueueLengthAndRun, // Builds core + }; } - function changeCore(sys: WatchedSystem, content: string, caption: string) { - return changeFile(sys, core[1].path, content, caption); + function changeCore(content: () => string, caption: string) { + return changeFile(() => core[1].path, content, caption); } let core: SubProjectFiles; @@ -161,6 +163,13 @@ namespace ts.tscWatch { return system; }); + const buildTests: TscWatchCompileChange = { + caption: "Build Tests", + change: noop, + // Build tests + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, + }; + describe("validates the changes and watched files", () => { const newFileWithoutExtension = "newFile"; const newFile: File = { @@ -169,16 +178,12 @@ namespace ts.tscWatch { }; function verifyProjectChanges(subScenario: string, allFilesGetter: () => readonly File[]) { - function buildLogicOrUpdateTimeStamps(sys: WatchedSystem) { - sys.checkTimeoutQueueLengthAndRun(1); // Builds logic or updates timestamps - return "Build logic or update time stamps"; - } + const buildLogicOrUpdateTimeStamps: TscWatchCompileChange = { + caption: "Build logic or update time stamps", + change: noop, + timeouts: checkSingleTimeoutQueueLengthAndRun, // Builds logic or updates timestamps + }; - function buildTests(sys: WatchedSystem) { - sys.checkTimeoutQueueLengthAndRun(1); // Build tests - sys.checkTimeoutQueueLength(0); - return "Build Tests"; - } verifyTscWatch({ scenario, subScenario: `${subScenario}/change builds changes and reports found errors message`, @@ -188,24 +193,26 @@ namespace ts.tscWatch { { currentDirectory: projectsLocation } ), changes: [ - sys => changeCore(sys, `${core[1].content} + changeCore(() => `${core[1].content} export class someClass { }`, "Make change to core"), buildLogicOrUpdateTimeStamps, buildTests, // Another change requeues and builds it - sys => changeCore(sys, core[1].content, "Revert core file"), + changeCore(() => core[1].content, "Revert core file"), buildLogicOrUpdateTimeStamps, buildTests, - sys => { - const change1 = `${core[1].content} + { + caption: "Make two changes", + change: sys => { + const change1 = `${core[1].content} export class someClass { }`; - sys.writeFile(core[1].path, change1); - assert.equal(sys.writtenFiles.size, 1); - sys.writtenFiles.clear(); - sys.writeFile(core[1].path, `${change1} + sys.writeFile(core[1].path, change1); + assert.equal(sys.writtenFiles.size, 1); + sys.writtenFiles.clear(); + sys.writeFile(core[1].path, `${change1} export class someClass2 { }`); - sys.checkTimeoutQueueLengthAndRun(1); // Builds core - return "Make two changes"; + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, // Builds core }, buildLogicOrUpdateTimeStamps, buildTests, @@ -221,15 +228,15 @@ export class someClass2 { }`); { currentDirectory: projectsLocation } ), changes: [ - sys => changeCore(sys, `${core[1].content} + changeCore(() => `${core[1].content} function foo() { }`, "Make local change to core"), buildLogicOrUpdateTimeStamps, buildTests ] }); - function changeNewFile(sys: WatchedSystem, newFileContent: string) { - return changeFile(sys, newFile.path, newFileContent, "Change to new File and build core"); + function changeNewFile(newFileContent: string) { + return changeFile(newFile.path, newFileContent, "Change to new File and build core"); } verifyTscWatch({ scenario, @@ -240,10 +247,10 @@ function foo() { }`, "Make local change to core"), { currentDirectory: projectsLocation } ), changes: [ - sys => changeNewFile(sys, newFile.content), + changeNewFile(newFile.content), buildLogicOrUpdateTimeStamps, buildTests, - sys => changeNewFile(sys, `${newFile.content} + changeNewFile(`${newFile.content} export class someClass2 { }`), buildLogicOrUpdateTimeStamps, buildTests @@ -285,16 +292,12 @@ export class someClass2 { }`), { currentDirectory: projectsLocation } ), changes: [ - sys => { - sys.writeFile(logic[0].path, logic[0].content); - sys.checkTimeoutQueueLengthAndRun(1); // Builds logic - return "Write logic tsconfig and build logic"; + { + caption: "Write logic tsconfig and build logic", + change: sys => sys.writeFile(logic[0].path, logic[0].content), + timeouts: checkSingleTimeoutQueueLengthAndRun, // Builds logic }, - sys => { - sys.checkTimeoutQueueLengthAndRun(1); // Builds tests - sys.checkTimeoutQueueLength(0); - return "Build tests"; - } + buildTests ] }); @@ -309,11 +312,12 @@ export class someClass2 { }`), after(() => { coreIndex = undefined!; }); - function buildLogic(sys: WatchedSystem) { - sys.checkTimeoutQueueLengthAndRun(1); // Builds logic - sys.checkTimeoutQueueLength(0); - return "Build logic"; - } + const buildLogic: TscWatchCompileChange = { + caption: "Build logic", + change: noop, + // Builds logic + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, + }; verifyTscWatch({ scenario, subScenario: "when referenced using prepend builds referencing project even for non local change", @@ -339,10 +343,10 @@ export class someClass2 { }`), return createWatchedSystem([libFile, coreTsConfig, coreIndex, logicTsConfig, logicIndex], { currentDirectory: projectsLocation }); }, changes: [ - sys => changeCore(sys, `${coreIndex.content} + changeCore(() => `${coreIndex.content} function myFunc() { return 10; }`, "Make non local change and build core"), buildLogic, - sys => changeCore(sys, `${coreIndex.content} + changeCore(() => `${coreIndex.content} function myFunc() { return 100; }`, "Make local change and build core"), buildLogic, ] @@ -390,19 +394,23 @@ createSomeObject().message;` return createWatchedSystem(files, { currentDirectory: `${projectsLocation}/${project}` }); }, changes: [ - sys => { + { + caption: "Introduce error", // Change message in library to message2 - sys.writeFile(libraryTs.path, libraryTs.content.replace(/message/g, "message2")); - sys.checkTimeoutQueueLengthAndRun(1); // Build library - sys.checkTimeoutQueueLengthAndRun(1); // Build App - return "Introduce error"; + change: sys => sys.writeFile(libraryTs.path, libraryTs.content.replace(/message/g, "message2")), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // Build library + sys.checkTimeoutQueueLengthAndRun(1); // Build App + }, }, - sys => { + { + caption: "Fix error", // Revert library changes - sys.writeFile(libraryTs.path, libraryTs.content); - sys.checkTimeoutQueueLengthAndRun(1); // Build library - sys.checkTimeoutQueueLengthAndRun(1); // Build App - return "Fix error"; + change: sys => sys.writeFile(libraryTs.path, libraryTs.content), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // Build library + sys.checkTimeoutQueueLengthAndRun(1); // Build App + }, }, ] }); @@ -417,21 +425,19 @@ createSomeObject().message;` commandLineArgs: ["-b", "-w", `${project}/${SubProject.tests}`, ...buildOptions], sys: () => createWatchedSystem(allFiles, { currentDirectory: projectsLocation }), changes: [ - sys => { - sys.writeFile(logic[1].path, `${logic[1].content} -let y: string = 10;`); - - sys.checkTimeoutQueueLengthAndRun(1); // Builds logic - sys.checkTimeoutQueueLength(0); - return "change logic"; + { + caption: "change logic", + change: sys => sys.writeFile(logic[1].path, `${logic[1].content} +let y: string = 10;`), + // Builds logic + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, }, - sys => { - sys.writeFile(core[1].path, `${core[1].content} -let x: string = 10;`); - - sys.checkTimeoutQueueLengthAndRun(1); // Builds core - sys.checkTimeoutQueueLength(0); - return "change core"; + { + caption: "change core", + change: sys => sys.writeFile(core[1].path, `${core[1].content} +let x: string = 10;`), + // Builds core + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, } ] }); @@ -468,18 +474,18 @@ let x: string = 10;`); sys.checkTimeoutQueueLength(0); } - function fixError(sys: WatchedSystem) { + const fixError: TscWatchCompileChange = { + caption: "Fix error in fileWithError", // Fix error - sys.writeFile(fileWithError.path, fileWithFixedError.content); - incrementalBuild(sys); - return "Fix error in fileWithError"; - } + change: sys => sys.writeFile(fileWithError.path, fileWithFixedError.content), + timeouts: incrementalBuild + }; - function changeFileWithoutError(sys: WatchedSystem) { - sys.writeFile(fileWithoutError.path, fileWithoutError.content.replace(/myClass/g, "myClass2")); - incrementalBuild(sys); - return "Change fileWithoutError"; - } + const changeFileWithoutError: TscWatchCompileChange = { + caption: "Change fileWithoutError", + change: sys => sys.writeFile(fileWithoutError.path, fileWithoutError.content.replace(/myClass/g, "myClass2")), + timeouts: incrementalBuild + }; verifyTscWatch({ scenario, @@ -508,11 +514,11 @@ let x: string = 10;`); }); describe("when reporting errors on introducing error", () => { - function introduceError(sys: WatchedSystem) { - sys.writeFile(fileWithError.path, fileWithError.content); - incrementalBuild(sys); - return "Introduce error"; - } + const introduceError: TscWatchCompileChange = { + caption: "Introduce error", + change: sys => sys.writeFile(fileWithError.path, fileWithError.content), + timeouts: incrementalBuild, + }; verifyTscWatch({ scenario, @@ -1122,19 +1128,23 @@ export function gfoo() { commandLineArgs: ["-b", "-w", `${project}/${SubProject.tests}`, "-verbose"], sys: () => createWatchedSystem(allFiles, { currentDirectory: projectsLocation }), changes: [ - sys => { - sys.writeFile(logic[1].path, `${logic[1].content} -function someFn() { }`); - sys.checkTimeoutQueueLengthAndRun(1); // build logic - sys.checkTimeoutQueueLengthAndRun(1); // build tests - return "Make non dts change"; + { + caption: "Make non dts change", + change: sys => sys.writeFile(logic[1].path, `${logic[1].content} +function someFn() { }`), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // build logic + sys.checkTimeoutQueueLengthAndRun(1); // build tests + }, }, - sys => { - sys.writeFile(logic[1].path, `${logic[1].content} -export function someFn() { }`); - sys.checkTimeoutQueueLengthAndRun(1); // build logic - sys.checkTimeoutQueueLengthAndRun(1); // build tests - return "Make dts change"; + { + caption: "Make dts change", + change: sys => sys.writeFile(logic[1].path, `${logic[1].content} +export function someFn() { }`), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // build logic + sys.checkTimeoutQueueLengthAndRun(1); // build tests + }, } ], }); @@ -1159,14 +1169,14 @@ export function someFn() { }`); return createWatchedSystem([index, configFile, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ + { + caption: "Change tsconfig to set noUnusedParameters to false", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { noUnusedParameters: false } - })); - sys.runQueuedTimeoutCallbacks(); - return "Change tsconfig to set noUnusedParameters to false"; + })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1216,14 +1226,16 @@ export function someFn() { }`); return sys; }, changes: [ - sys => { - sys.writeFile(coreFiles[0].path, coreFiles[0].content); - sys.checkTimeoutQueueLengthAndRun(1); // build core - sys.checkTimeoutQueueLengthAndRun(1); // build animals - sys.checkTimeoutQueueLengthAndRun(1); // build zoo - sys.checkTimeoutQueueLengthAndRun(1); // build solution - sys.checkTimeoutQueueLength(0); - return "Fix error"; + { + caption: "Fix error", + change: sys => sys.writeFile(coreFiles[0].path, coreFiles[0].content), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // build core + sys.checkTimeoutQueueLengthAndRun(1); // build animals + sys.checkTimeoutQueueLengthAndRun(1); // build zoo + sys.checkTimeoutQueueLengthAndRun(1); // build solution + sys.checkTimeoutQueueLength(0); + }, } ] }); @@ -1239,13 +1251,13 @@ ${coreFiles[1].content}`); return sys; }, changes: [ - sys => { - sys.writeFile(coreFiles[1].path, ` + { + caption: "Prepend a line", + change: sys => sys.writeFile(coreFiles[1].path, ` import * as A from '../animals'; -${coreFiles[1].content}`); - sys.checkTimeoutQueueLengthAndRun(1); // build core - sys.checkTimeoutQueueLength(0); - return "Prepend a line"; +${coreFiles[1].content}`), + // build core + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, } ] }); @@ -1260,6 +1272,21 @@ ${coreFiles[1].content}`); }); describe("unittests:: tsbuild:: watchMode:: with noEmitOnError", () => { + function change(caption: string, content: string): TscWatchCompileChange { + return { + caption, + change: sys => sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, content), + // build project + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, + }; + } + + const noChange: TscWatchCompileChange = { + caption: "No change", + change: sys => sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, sys.readFile(`${projectsLocation}/noEmitOnError/src/main.ts`)!), + // build project + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, + }; verifyTscWatch({ scenario: "noEmitOnError", subScenario: "does not emit any files on error", @@ -1273,20 +1300,29 @@ ${coreFiles[1].content}`); { currentDirectory: `${projectsLocation}/noEmitOnError` } ), changes: [ - sys => { - sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, `import { A } from "../shared/types/db"; + noChange, + change("Fix Syntax error", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' -};`); - sys.checkTimeoutQueueLengthAndRun(1); // build project - sys.checkTimeoutQueueLength(0); - return "Fix error"; - } - ] +};`), + change("Semantic Error", `import { A } from "../shared/types/db"; +const a: string = 10;`), + noChange, + change("Fix Semantic Error", `import { A } from "../shared/types/db"; +const a: string = "hello";`), + noChange, + ], + baselineIncremental: true }); }); describe("unittests:: tsbuild:: watchMode:: with reexport when referenced project reexports definitions from another file", () => { + function build(sys: WatchedSystem) { + sys.checkTimeoutQueueLengthAndRun(1); // build src/pure + sys.checkTimeoutQueueLengthAndRun(1); // build src/main + sys.checkTimeoutQueueLengthAndRun(1); // build src + sys.checkTimeoutQueueLength(0); + } verifyTscWatch({ scenario: "reexport", subScenario: "Reports errors correctly", @@ -1304,27 +1340,25 @@ const a = { { currentDirectory: `${projectsLocation}/reexport` } ), changes: [ - sys => { - replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "// ", ""); - sys.checkTimeoutQueueLengthAndRun(1); // build src/pure - sys.checkTimeoutQueueLengthAndRun(1); // build src/main - sys.checkTimeoutQueueLengthAndRun(1); // build src - sys.checkTimeoutQueueLength(0); - return "Introduce error"; + { + caption: "Introduce error", + change: sys => replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "// ", ""), + timeouts: build, }, - sys => { - replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "bar: ", "// bar: "); - sys.checkTimeoutQueueLengthAndRun(1); // build src/pure - sys.checkTimeoutQueueLengthAndRun(1); // build src/main - sys.checkTimeoutQueueLengthAndRun(1); // build src - sys.checkTimeoutQueueLength(0); - return "Fix error"; + { + caption: "Fix error", + change: sys => replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "bar: ", "// bar: "), + timeouts: build } ] }); }); describe("unittests:: tsbuild:: watchMode:: configFileErrors:: reports syntax errors in config file", () => { + function build(sys: WatchedSystem) { + sys.checkTimeoutQueueLengthAndRun(1); // build the project + sys.checkTimeoutQueueLength(0); + } verifyTscWatch({ scenario: "configFileErrors", subScenario: "reports syntax errors in config file", @@ -1351,33 +1385,29 @@ const a = { ), commandLineArgs: ["--b", "-w"], changes: [ - sys => { - replaceFileText(sys, `${projectRoot}/tsconfig.json`, ",", `, - "declaration": true,`); - sys.checkTimeoutQueueLengthAndRun(1); // build the project - sys.checkTimeoutQueueLength(0); - return "reports syntax errors after change to config file"; + { + caption: "reports syntax errors after change to config file", + change: sys => replaceFileText(sys, `${projectRoot}/tsconfig.json`, ",", `, + "declaration": true,`), + timeouts: build, }, - sys => { - replaceFileText(sys, `${projectRoot}/a.ts`, "foo", "fooBar"); - sys.checkTimeoutQueueLengthAndRun(1); // build the project - sys.checkTimeoutQueueLength(0); - return "reports syntax errors after change to ts file"; + { + caption: "reports syntax errors after change to ts file", + change: sys => replaceFileText(sys, `${projectRoot}/a.ts`, "foo", "fooBar"), + timeouts: build, }, - sys => { - replaceFileText(sys, `${projectRoot}/tsconfig.json`, "", ""); - sys.checkTimeoutQueueLengthAndRun(1); // build the project - sys.checkTimeoutQueueLength(0); - return "reports error when there is no change to tsconfig file"; + { + caption: "reports error when there is no change to tsconfig file", + change: sys => replaceFileText(sys, `${projectRoot}/tsconfig.json`, "", ""), + timeouts: build, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ + { + caption: "builds after fixing config file errors", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { composite: true, declaration: true }, files: ["a.ts", "b.ts"] - })); - sys.checkTimeoutQueueLengthAndRun(1); // build the project - sys.checkTimeoutQueueLength(0); - return "builds after fixing config file errors"; + })), + timeouts: build, } ] }); diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index e2a38981ed280..d546d685571bf 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -1,7 +1,7 @@ namespace ts { export type TscCompileSystem = fakes.System & { writtenFiles: Map; - baseLine(): void; + baseLine(): { file: string; text: string; }; }; export enum BuildKind { @@ -16,6 +16,7 @@ namespace ts { buildKind: BuildKind.NoChangeRun, modifyFs: noop }; + export const noChangeOnlyRuns = [noChangeRun]; export interface TscCompile { scenario: string; @@ -27,6 +28,7 @@ namespace ts { modifyFs?: (fs: vfs.FileSystem) => void; baselineSourceMap?: boolean; baselineReadFileCalls?: boolean; + baselinePrograms?: boolean; } export type CommandLineProgram = [Program, EmitAndSemanticDiagnosticsBuilderProgram?]; @@ -69,14 +71,16 @@ namespace ts { } export function tscCompile(input: TscCompile) { - const baseFs = input.fs(); - const fs = baseFs.shadow(); + const initialFs = input.fs(); + const inputFs = initialFs.shadow(); const { scenario, subScenario, buildKind, commandLineArgs, modifyFs, - baselineSourceMap, baselineReadFileCalls + baselineSourceMap, baselineReadFileCalls, baselinePrograms } = input; - if (modifyFs) modifyFs(fs); + if (modifyFs) modifyFs(inputFs); + inputFs.makeReadonly(); + const fs = inputFs.shadow(); // Create system const sys = new fakes.System(fs, { executingFilePath: "/lib/tsc" }) as TscCompileSystem; @@ -100,49 +104,67 @@ namespace ts { sys.write(`${sys.getExecutingFilePath()} ${commandLineArgs.join(" ")}\n`); sys.exit = exitCode => sys.exitCode = exitCode; + const { cb, getPrograms } = commandLineCallbacks(sys, originalReadFile); executeCommandLine( sys, - commandLineCallbacks(sys, originalReadFile).cb, + cb, commandLineArgs, ); sys.write(`exitCode:: ExitStatus.${ExitStatus[sys.exitCode as ExitStatus]}\n`); + if (baselinePrograms) { + const baseline: string[] = []; + tscWatch.baselinePrograms(baseline, getPrograms); + sys.write(baseline.join("\n")); + } if (baselineReadFileCalls) { sys.write(`readFiles:: ${JSON.stringify(actualReadFileMap, /*replacer*/ undefined, " ")} `); } if (baselineSourceMap) generateSourceMapBaselineFiles(sys); - // Baseline the errors - fs.writeFileSync(`/lib/${buildKind || BuildKind.Initial}Output.txt`, sys.output.join("")); fs.makeReadonly(); sys.baseLine = () => { - const patch = fs.diff(baseFs, { includeChangedFileWithSameContent: true }); - // eslint-disable-next-line no-null/no-null - Harness.Baseline.runBaseline(`${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}/${scenario}/${buildKind || BuildKind.Initial}/${subScenario.split(" ").join("-")}.js`, patch ? vfs.formatPatch(patch) : null); + const baseFsPatch = !buildKind || buildKind === BuildKind.Initial ? + inputFs.diff(/*base*/ undefined, { baseIsNotShadowRoot: true }) : + inputFs.diff(initialFs, { includeChangedFileWithSameContent: true }); + const patch = fs.diff(inputFs, { includeChangedFileWithSameContent: true }); + return { + file: `${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}/${scenario}/${buildKind || BuildKind.Initial}/${subScenario.split(" ").join("-")}.js`, + text: `Input:: +${baseFsPatch ? vfs.formatPatch(baseFsPatch) : ""} + +Output:: +${sys.output.join("")} + +${patch ? vfs.formatPatch(patch) : ""}` + }; }; return sys; } - export function verifyTscBaseline(sys: () => TscCompileSystem) { + export function verifyTscBaseline(sys: () => { baseLine: TscCompileSystem["baseLine"]; }) { it(`Generates files matching the baseline`, () => { - sys().baseLine(); + const { file, text } = sys().baseLine(); + Harness.Baseline.runBaseline(file, text); }); } export function verifyTsc(input: TscCompile) { - describe(input.scenario, () => { - describe(input.subScenario, () => { - let sys: TscCompileSystem; - before(() => { - sys = tscCompile({ - ...input, - fs: () => getFsWithTime(input.fs()).fs.makeReadonly() + describe(`tsc ${input.commandLineArgs.join(" ")} ${input.scenario}:: ${input.subScenario}`, () => { + describe(input.scenario, () => { + describe(input.subScenario, () => { + let sys: TscCompileSystem; + before(() => { + sys = tscCompile({ + ...input, + fs: () => getFsWithTime(input.fs()).fs.makeReadonly() + }); }); + after(() => { + sys = undefined!; + }); + verifyTscBaseline(() => sys); }); - after(() => { - sys = undefined!; - }); - verifyTscBaseline(() => sys); }); }); } diff --git a/src/testRunner/unittests/tsc/incremental.ts b/src/testRunner/unittests/tsc/incremental.ts index 862e5cdf6b458..b231b439858dc 100644 --- a/src/testRunner/unittests/tsc/incremental.ts +++ b/src/testRunner/unittests/tsc/incremental.ts @@ -1,6 +1,6 @@ namespace ts { describe("unittests:: tsc:: incremental::", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "incremental", subScenario: "when passing filename for buildinfo on commandline", fs: () => loadProjectFromFiles({ @@ -17,10 +17,10 @@ namespace ts { }`, }), commandLineArgs: ["--incremental", "--p", "src/project", "--tsBuildInfoFile", "src/project/.tsbuildinfo"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "incremental", subScenario: "when passing rootDir from commandline", fs: () => loadProjectFromFiles({ @@ -34,10 +34,10 @@ namespace ts { }`, }), commandLineArgs: ["--p", "src/project", "--rootDir", "src/project/src"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "incremental", subScenario: "with only dts files", fs: () => loadProjectFromFiles({ @@ -55,7 +55,7 @@ namespace ts { ] }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "incremental", subScenario: "when passing rootDir is in the tsconfig", fs: () => loadProjectFromFiles({ @@ -70,23 +70,51 @@ namespace ts { }`, }), commandLineArgs: ["--p", "src/project"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); - verifyTscIncrementalEdits({ - scenario: "incremental", - subScenario: "with noEmitOnError", - fs: () => loadProjectFromDisk("tests/projects/noEmitOnError"), - commandLineArgs: ["--incremental", "-p", "src"], - incrementalScenarios: [ - { - buildKind: BuildKind.IncrementalDtsUnchanged, - modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; + describe("with noEmitOnError", () => { + let projFs: vfs.FileSystem; + before(() => { + projFs = loadProjectFromDisk("tests/projects/noEmitOnError"); + }); + after(() => { + projFs = undefined!; + }); + + function verifyNoEmitOnError(subScenario: string, fixModifyFs: TscIncremental["modifyFs"], modifyFs?: TscIncremental["modifyFs"]) { + verifyTscSerializedIncrementalEdits({ + scenario: "incremental", + subScenario, + fs: () => projFs, + commandLineArgs: ["--incremental", "-p", "src"], + modifyFs, + incrementalScenarios: [ + noChangeRun, + { + buildKind: BuildKind.IncrementalDtsUnchanged, + modifyFs: fixModifyFs + }, + noChangeRun, + ], + baselinePrograms: true + }); + } + verifyNoEmitOnError( + "with noEmitOnError syntax errors", + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' };`, "utf-8") - } - ] + ); + + verifyNoEmitOnError( + "with noEmitOnError semantic errors", + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = "hello";`, "utf-8"), + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = 10;`, "utf-8"), + ); }); }); } diff --git a/src/testRunner/unittests/tscWatch/consoleClearing.ts b/src/testRunner/unittests/tscWatch/consoleClearing.ts index 66476b6a31776..c874c32e04b31 100644 --- a/src/testRunner/unittests/tscWatch/consoleClearing.ts +++ b/src/testRunner/unittests/tscWatch/consoleClearing.ts @@ -6,11 +6,11 @@ namespace ts.tscWatch { content: "" }; - function makeChangeToFile(sys: WatchedSystem) { - sys.modifyFile(file.path, "//"); - sys.runQueuedTimeoutCallbacks(); - return "Comment added to file f"; - } + const makeChangeToFile: TscWatchCompileChange[] = [{ + caption: "Comment added to file f", + change: sys => sys.modifyFile(file.path, "//"), + timeouts: runQueuedTimeoutCallbacks, + }]; function checkConsoleClearingUsingCommandLineOptions(subScenario: string, commandLineOptions?: string[]) { verifyTscWatch({ @@ -18,9 +18,7 @@ namespace ts.tscWatch { subScenario, commandLineArgs: ["--w", file.path, ...commandLineOptions || emptyArray], sys: () => createWatchedSystem([file, libFile]), - changes: [ - makeChangeToFile - ], + changes: makeChangeToFile, }); } @@ -39,20 +37,16 @@ namespace ts.tscWatch { }; const files = [file, configFile, libFile]; it("using createWatchOfConfigFile ", () => { - const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles( - createWatchedSystem(files) - ); - const watch = createWatchOfConfigFile(configFile.path, sys); + const baseline = createBaseline(createWatchedSystem(files)); + const watch = createWatchOfConfigFile(configFile.path, baseline.sys); // Initially console is cleared if --preserveOutput is not provided since the config file is yet to be parsed runWatchBaseline({ scenario, subScenario: "when preserveWatchOutput is true in config file/createWatchOfConfigFile", commandLineArgs: ["--w", "-p", configFile.path], - sys, + ...baseline, getPrograms: () => [[watch.getCurrentProgram().getProgram(), watch.getCurrentProgram()]], - changes: [ - makeChangeToFile - ], + changes: makeChangeToFile, watchOrSolution: watch }); }); @@ -61,9 +55,7 @@ namespace ts.tscWatch { subScenario: "when preserveWatchOutput is true in config file/when createWatchProgram is invoked with configFileParseResult on WatchCompilerHostOfConfigFile", commandLineArgs: ["--w", "-p", configFile.path], sys: () => createWatchedSystem(files), - changes: [ - makeChangeToFile - ], + changes: makeChangeToFile, }); }); }); diff --git a/src/testRunner/unittests/tscWatch/emit.ts b/src/testRunner/unittests/tscWatch/emit.ts index 98be86a0f7392..be2d95738829b 100644 --- a/src/testRunner/unittests/tscWatch/emit.ts +++ b/src/testRunner/unittests/tscWatch/emit.ts @@ -22,10 +22,10 @@ namespace ts.tscWatch { return createWatchedSystem([f1, f2, config, libFile]); }, changes: [ - sys => { - sys.writeFile("/a/a.ts", "let x = 11"); - sys.runQueuedTimeoutCallbacks(); - return "Make change in the file"; + { + caption: "Make change in the file", + change: sys => sys.writeFile("/a/a.ts", "let x = 11"), + timeouts: runQueuedTimeoutCallbacks } ] }); @@ -145,20 +145,20 @@ namespace ts.tscWatch { function modifyModuleFile1Shape(sys: WatchedSystem) { sys.writeFile(moduleFile1Path, `export var T: number;export function Foo() { };`); } - function changeModuleFile1Shape(sys: WatchedSystem) { - modifyModuleFile1Shape(sys); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change the content of moduleFile1 to `export var T: number;export function Foo() { };`"; - } + const changeModuleFile1Shape: TscWatchCompileChange = { + caption: "Change the content of moduleFile1 to `export var T: number;export function Foo() { };`", + change: modifyModuleFile1Shape, + timeouts: checkSingleTimeoutQueueLengthAndRun, + }; verifyTscWatchEmit({ subScenario: "should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", changes: [ changeModuleFile1Shape, - sys => { - sys.writeFile(moduleFile1Path, `export var T: number;export function Foo() { console.log('hi'); };`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };`"; + { + caption: "Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };`", + change: sys => sys.writeFile(moduleFile1Path, `export var T: number;export function Foo() { console.log('hi'); };`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -166,29 +166,31 @@ namespace ts.tscWatch { verifyTscWatchEmit({ subScenario: "should be up-to-date with the reference map changes", changes: [ - sys => { - sys.writeFile(file1Consumer1Path, `export let y = Foo();`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change file1Consumer1 content to `export let y = Foo();`"; + { + caption: "Change file1Consumer1 content to `export let y = Foo();`", + change: sys => sys.writeFile(file1Consumer1Path, `export let y = Foo();`), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, changeModuleFile1Shape, - sys => { - sys.writeFile(file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Add the import statements back to file1Consumer1"; + { + caption: "Add the import statements back to file1Consumer1", + change: sys => sys.writeFile(file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { - sys.writeFile(moduleFile1Path, `export let y = Foo();`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };`"; + { + caption: "Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };`", + change: sys => sys.writeFile(moduleFile1Path, `export let y = Foo();`), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { + { + caption: "Multiple file edits in one go", // Change file1Consumer1 content to `export let y = Foo();` // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - sys.writeFile(file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`); - modifyModuleFile1Shape(sys); - sys.checkTimeoutQueueLengthAndRun(1); - return "Multiple file edits in one go"; + change: sys => { + sys.writeFile(file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`); + modifyModuleFile1Shape(sys); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -196,11 +198,13 @@ namespace ts.tscWatch { verifyTscWatchEmit({ subScenario: "should be up-to-date with deleted files", changes: [ - sys => { - modifyModuleFile1Shape(sys); - sys.deleteFile(file1Consumer2Path); - sys.checkTimeoutQueueLengthAndRun(1); - return "change moduleFile1 shape and delete file1Consumer2"; + { + caption: "change moduleFile1 shape and delete file1Consumer2", + change: sys => { + modifyModuleFile1Shape(sys); + sys.deleteFile(file1Consumer2Path); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -208,11 +212,13 @@ namespace ts.tscWatch { verifyTscWatchEmit({ subScenario: "should be up-to-date with newly created files", changes: [ - sys => { - sys.writeFile("/a/b/file1Consumer3.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); - modifyModuleFile1Shape(sys); - sys.checkTimeoutQueueLengthAndRun(1); - return "change moduleFile1 shape and create file1Consumer3"; + { + caption: "change moduleFile1 shape and create file1Consumer3", + change: sys => { + sys.writeFile("/a/b/file1Consumer3.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); + modifyModuleFile1Shape(sys); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -222,10 +228,10 @@ namespace ts.tscWatch { configObj: { files: [file1Consumer1Path] }, changes: [ changeModuleFile1Shape, - sys => { - sys.appendFile(moduleFile1Path, "var T1: number;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "change file1 internal, and verify only file1 is affected"; + { + caption: "change file1 internal, and verify only file1 is affected", + change: sys => sys.appendFile(moduleFile1Path, "var T1: number;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -233,10 +239,10 @@ namespace ts.tscWatch { verifyTscWatchEmit({ subScenario: "should return all files if a global file changed shape", changes: [ - sys => { - sys.appendFile(globalFilePath, "var T2: string;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "change shape of global file"; + { + caption: "change shape of global file", + change: sys => sys.appendFile(globalFilePath, "var T2: string;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -264,17 +270,19 @@ namespace ts.tscWatch { content: `import {y} from "./file1Consumer1";` }], changes: [ - sys => { - sys.appendFile(file1Consumer1Path, "export var T: number;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "change file1Consumer1"; + { + caption: "change file1Consumer1", + change: sys => sys.appendFile(file1Consumer1Path, "export var T: number;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, changeModuleFile1Shape, - sys => { - sys.appendFile(file1Consumer1Path, "export var T2: number;"); - sys.writeFile(moduleFile1Path, `export var T2: number;export function Foo() { };`); - sys.checkTimeoutQueueLengthAndRun(1); - return "change file1Consumer1 and moduleFile1"; + { + caption: "change file1Consumer1 and moduleFile1", + change: sys => { + sys.appendFile(file1Consumer1Path, "export var T2: number;"); + sys.writeFile(moduleFile1Path, `export var T2: number;export function Foo() { };`); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -295,10 +303,10 @@ export var t2 = 10;` ], firstReloadFileList: [libFile.path, "/a/b/file1.ts", "/a/b/file2.ts", configFilePath], changes: [ - sys => { - sys.appendFile("/a/b/file1.ts", "export var t3 = 10;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "change file1"; + { + caption: "change file1", + change: sys => sys.appendFile("/a/b/file1.ts", "export var t3 = 10;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -312,10 +320,10 @@ export var x = Foo();` }], firstReloadFileList: [libFile.path, "/a/b/referenceFile1.ts", moduleFile1Path, configFilePath], changes: [ - sys => { - sys.deleteFile(moduleFile1Path); - sys.checkTimeoutQueueLengthAndRun(1); - return "delete moduleFile1"; + { + caption: "delete moduleFile1", + change: sys => sys.deleteFile(moduleFile1Path), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -329,15 +337,15 @@ export var x = Foo();` }], firstReloadFileList: [libFile.path, "/a/b/referenceFile1.ts", configFilePath], changes: [ - sys => { - sys.appendFile("/a/b/referenceFile1.ts", "export var yy = Foo();"); - sys.checkTimeoutQueueLengthAndRun(1); - return "edit refereceFile1"; + { + caption: "edit refereceFile1", + change: sys => sys.appendFile("/a/b/referenceFile1.ts", "export var yy = Foo();"), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { - sys.writeFile(moduleFile2Path, "export var Foo4 = 10;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "create moduleFile2"; + { + caption: "create moduleFile2", + change: sys => sys.writeFile(moduleFile2Path, "export var Foo4 = 10;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -360,10 +368,10 @@ export var x = Foo();` { newLine } ), changes: [ - sys => { - sys.appendFile("/a/app.ts", newLine + "var z = 3;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Append a line"; + { + caption: "Append a line", + change: sys => sys.appendFile("/a/app.ts", newLine + "var z = 3;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ], }); @@ -398,10 +406,10 @@ export var x = Foo();` return createWatchedSystem([file1, file2, file3, configFile, libFile]); }, changes: [ - sys => { - sys.appendFile("/a/b/f1.ts", "export function foo2() { return 2; }"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Append content to f1"; + { + caption: "Append content to f1", + change: sys => sys.appendFile("/a/b/f1.ts", "export function foo2() { return 2; }"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ], }); @@ -427,10 +435,10 @@ export var x = Foo();` return createWatchedSystem([file1, file2, file3, libFile]); }, changes: [ - sys => { - sys.appendFile("/user/someone/projects/myproject/file3.ts", "function foo2() { return 2; }"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Append content to file3"; + { + caption: "Append content to file3", + change: sys => sys.appendFile("/user/someone/projects/myproject/file3.ts", "function foo2() { return 2; }"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ], }); @@ -457,10 +465,10 @@ export var x = Foo();` return createWatchedSystem(files, { currentDirectory: projectLocation, useCaseSensitiveFileNames: true }); }, changes: [ - sys => { - sys.appendFile("/home/username/project/app/file.ts", "\nvar b = 10;", { invokeFileDeleteCreateAsPartInsteadOfChange: true }); - sys.runQueuedTimeoutCallbacks(); - return "file is deleted and then created to modify content"; + { + caption: "file is deleted and then created to modify content", + change: sys => sys.appendFile("/home/username/project/app/file.ts", "\nvar b = 10;", { invokeFileDeleteCreateAsPartInsteadOfChange: true }), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -496,14 +504,14 @@ export var x = Foo();` return createWatchedSystem([configFile, file1, file2, libFile]); }, changes: [ - sys => { - sys.modifyFile( + { + caption: "Modify typescript file", + change: sys => sys.modifyFile( "/a/rootFolder/project/Scripts/TypeScript.ts", "var zz30 = 100;", { invokeDirectoryWatcherInsteadOfFileChanged: true }, - ); - sys.runQueuedTimeoutCallbacks(); - return "Modify typescript file"; + ), + timeouts: runQueuedTimeoutCallbacks, } ], }); diff --git a/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts b/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts index 65f311ebcd100..d4da16b41fc2f 100644 --- a/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts +++ b/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts @@ -14,6 +14,7 @@ namespace ts.tscWatch { lib, configFile, changes, + baselineIncremental }: VerifyEmitAndErrorUpdatesWorker) { verifyTscWatch({ scenario: "emitAndErrorUpdates", @@ -23,7 +24,8 @@ namespace ts.tscWatch { [...files(), configFile(), lib?.() || libFile], { currentDirectory: currentDirectory || projectRoot } ), - changes + changes, + baselineIncremental }); } @@ -41,6 +43,7 @@ namespace ts.tscWatch { lib?: () => File; changes: TscWatchCompileChange[]; configFile?: () => File; + baselineIncremental?: boolean } function verifyEmitAndErrorUpdates(input: VerifyEmitAndErrorUpdates) { verifyEmitAndErrorUpdatesWorker({ @@ -94,10 +97,10 @@ console.log(b.c.d);` subScenario: `deepImportChanges/${subScenario}`, files: () => [aFile, bFile, cFile], changes: [ - sys => { - sys.writeFile(cFile.path, cFile.content.replace("d", "d2")); - sys.runQueuedTimeoutCallbacks(); - return "Rename property d to d2 of class C"; + { + caption: "Rename property d to d2 of class C", + change: sys => sys.writeFile(cFile.path, cFile.content.replace("d", "d2")), + timeouts: runQueuedTimeoutCallbacks, } ], }); @@ -194,10 +197,10 @@ getPoint().c.x;` subScenario: "file not exporting a deep multilevel import that changes", files: () => [aFile, bFile, cFile, dFile, eFile], changes: [ - sys => { - sys.writeFile(aFile.path, aFile.content.replace("x2", "x")); - sys.runQueuedTimeoutCallbacks(); - return "Rename property x2 to x of interface Coords"; + { + caption: "Rename property x2 to x of interface Coords", + change: sys => sys.writeFile(aFile.path, aFile.content.replace("x2", "x")), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -257,10 +260,10 @@ export class Data { files: () => [lib1ToolsInterface, lib1ToolsPublic, app, lib2Public, lib1Public, ...files], configFile: () => config, changes: [ - sys => { - sys.writeFile(lib1ToolsInterface.path, lib1ToolsInterface.content.replace("title", "title2")); - sys.runQueuedTimeoutCallbacks(); - return "Rename property title to title2 of interface ITest"; + { + caption: "Rename property title to title2 of interface ITest", + change: sys => sys.writeFile(lib1ToolsInterface.path, lib1ToolsInterface.content.replace("title", "title2")), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -299,23 +302,43 @@ export class Data2 { }); }); - verifyEmitAndErrorUpdates({ - subScenario: "with noEmitOnError", - currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError`, - files: () => ["shared/types/db.ts", "src/main.ts", "src/other.ts"] - .map(f => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", f)), - lib: () => ({ path: libFile.path, content: libContent }), - configFile: () => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", "tsconfig.json"), - changes: [ - sys => { - sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, `import { A } from "../shared/types/db"; + describe("with noEmitOnError", () => { + function change(caption: string, content: string): TscWatchCompileChange { + return { + caption, + change: sys => sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, content), + // build project + timeouts: checkSingleTimeoutQueueLengthAndRun + }; + } + const noChange: TscWatchCompileChange = { + caption: "No change", + change: sys => sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, sys.readFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`)!), + // build project + timeouts: checkSingleTimeoutQueueLengthAndRun, + }; + verifyEmitAndErrorUpdates({ + subScenario: "with noEmitOnError", + currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError`, + files: () => ["shared/types/db.ts", "src/main.ts", "src/other.ts"] + .map(f => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", f)), + lib: () => ({ path: libFile.path, content: libContent }), + configFile: () => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", "tsconfig.json"), + changes: [ + noChange, + change("Fix Syntax error", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' -};`); - sys.checkTimeoutQueueLengthAndRun(1); // build project - return "Fix the error"; - } - ] +};`), + change("Semantic Error", `import { A } from "../shared/types/db"; +const a: string = 10;`), + noChange, + change("Fix Semantic Error", `import { A } from "../shared/types/db"; +const a: string = "hello";`), + noChange, + ], + baselineIncremental: true + }); }); }); } diff --git a/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts b/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts index cae63450b0860..5d0741eba30ce 100644 --- a/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts +++ b/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts @@ -28,10 +28,10 @@ namespace ts.tscWatch { verifyConsistentFileNames({ subScenario: "when changing module name with different casing", changes: [ - sys => { - sys.writeFile(anotherFile.path, anotherFile.content.replace("./logger", "./Logger")); - sys.runQueuedTimeoutCallbacks(); - return "Change module name from logger to Logger"; + { + caption: "Change module name from logger to Logger", + change: sys => sys.writeFile(anotherFile.path, anotherFile.content.replace("./logger", "./Logger")), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -39,10 +39,10 @@ namespace ts.tscWatch { verifyConsistentFileNames({ subScenario: "when renaming file with different casing", changes: [ - sys => { - sys.renameFile(loggerFile.path, `${projectRoot}/Logger.ts`); - sys.runQueuedTimeoutCallbacks(); - return "Change name of file from logger to Logger"; + { + caption: "Change name of file from logger to Logger", + change: sys => sys.renameFile(loggerFile.path, `${projectRoot}/Logger.ts`), + timeouts: runQueuedTimeoutCallbacks, } ] }); diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index f778c98cedf34..e0c612963be33 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -270,11 +270,28 @@ namespace ts.tscWatch { return getDiagnosticOfFileFromProgram(program, file.path, file.content.indexOf(quotedModuleName), quotedModuleName.length, Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations, moduleName); } - export type TscWatchCompileChange = ( - sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles, - programs: readonly CommandLineProgram[], - watchOrSolution: ReturnType - ) => string; + export function runQueuedTimeoutCallbacks(sys: WatchedSystem) { + sys.runQueuedTimeoutCallbacks(); + } + + export function checkSingleTimeoutQueueLengthAndRun(sys: WatchedSystem) { + sys.checkTimeoutQueueLengthAndRun(1); + } + + export function checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout(sys: WatchedSystem) { + sys.checkTimeoutQueueLengthAndRun(1); + sys.checkTimeoutQueueLength(0); + } + + export interface TscWatchCompileChange { + caption: string; + change: (sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles) => void; + timeouts: ( + sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles, + programs: readonly CommandLineProgram[], + watchOrSolution: ReturnType + ) => void; + } export interface TscWatchCheckOptions { baselineSourceMap?: boolean; } @@ -290,10 +307,8 @@ namespace ts.tscWatch { export type SystemSnap = ReturnType; function tscWatchCompile(input: TscWatchCompile) { - it("Generates files matching the baseline", () => { - const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles( - fakes.patchHostForBuildInfoReadWrite(input.sys()) - ); + it("tsc-watch:: Generates files matching the baseline", () => { + const { sys, baseline, oldSnap } = createBaseline(input.sys()); const { scenario, subScenario, commandLineArgs, changes, @@ -312,6 +327,8 @@ namespace ts.tscWatch { subScenario, commandLineArgs, sys, + baseline, + oldSnap, getPrograms, baselineSourceMap, changes, @@ -320,31 +337,54 @@ namespace ts.tscWatch { }); } - export interface RunWatchBaseline extends TscWatchCompileBase { + export interface Baseline { + baseline: string[]; + sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles; + oldSnap: SystemSnap; + } + + export function createBaseline(system: WatchedSystem): Baseline { + const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles( + fakes.patchHostForBuildInfoReadWrite(system) + ); + const baseline: string[] = []; + baseline.push("Input::"); + sys.diff(baseline); + return { sys, baseline, oldSnap: sys.snap() }; + } + + export function applyChange(sys: Baseline["sys"], baseline: Baseline["baseline"], change: TscWatchCompileChange["change"], caption?: TscWatchCompileChange["caption"]) { + const oldSnap = sys.snap(); + baseline.push(`Change::${caption ? " " + caption : ""}`, ""); + change(sys); + baseline.push("Input::"); + sys.diff(baseline, oldSnap); + return sys.snap(); + } + + export interface RunWatchBaseline extends Baseline, TscWatchCompileBase { sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles; getPrograms: () => readonly CommandLineProgram[]; watchOrSolution: ReturnType; } export function runWatchBaseline({ scenario, subScenario, commandLineArgs, - getPrograms, sys, + getPrograms, sys, baseline, oldSnap, baselineSourceMap, changes, watchOrSolution }: RunWatchBaseline) { - const baseline: string[] = []; baseline.push(`${sys.getExecutingFilePath()} ${commandLineArgs.join(" ")}`); let programs = watchBaseline({ baseline, getPrograms, sys, - oldSnap: undefined, + oldSnap, baselineSourceMap }); - for (const change of changes) { - const oldSnap = sys.snap(); - const caption = change(sys, programs, watchOrSolution); - baseline.push(`Change:: ${caption}`, ""); + for (const { caption, change, timeouts } of changes) { + oldSnap = applyChange(sys, baseline, change, caption); + timeouts(sys, programs, watchOrSolution); programs = watchBaseline({ baseline, getPrograms, @@ -366,22 +406,16 @@ namespace ts.tscWatch { }); } - export interface WatchBaseline extends TscWatchCheckOptions { - baseline: string[]; - sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles; + export interface WatchBaseline extends Baseline, TscWatchCheckOptions { getPrograms: () => readonly CommandLineProgram[]; - oldSnap: SystemSnap | undefined; } export function watchBaseline({ baseline, getPrograms, sys, oldSnap, baselineSourceMap }: WatchBaseline) { if (baselineSourceMap) generateSourceMapBaselineFiles(sys); - sys.diff(baseline, oldSnap); sys.serializeOutput(baseline); - const programs = getPrograms(); - for (const program of programs) { - baselineProgram(baseline, program); - } + const programs = baselinePrograms(baseline, getPrograms); sys.serializeWatches(baseline); baseline.push(`exitCode:: ExitStatus.${ExitStatus[sys.exitCode as ExitStatus]}`, ""); + sys.diff(baseline, oldSnap); sys.writtenFiles.forEach((value, key) => { assert.equal(value, 1, `Expected to write file ${key} only once`); }); @@ -389,6 +423,14 @@ namespace ts.tscWatch { return programs; } + export function baselinePrograms(baseline: string[], getPrograms: () => readonly CommandLineProgram[]) { + const programs = getPrograms(); + for (const program of programs) { + baselineProgram(baseline, program); + } + return programs; + } + function baselineProgram(baseline: string[], [program, builderProgram]: CommandLineProgram) { const options = program.getCompilerOptions(); baseline.push(`Program root files: ${JSON.stringify(program.getRootFileNames())}`); @@ -414,11 +456,23 @@ namespace ts.tscWatch { baseline.push(""); } - export function verifyTscWatch(input: TscWatchCompile) { + export interface VerifyTscWatch extends TscWatchCompile { + baselineIncremental?: boolean; + } + export function verifyTscWatch(input: VerifyTscWatch) { describe(input.scenario, () => { describe(input.subScenario, () => { tscWatchCompile(input); }); + if (input.baselineIncremental) { + describe(`${input.subScenario} with incremental`, () => { + tscWatchCompile({ + ...input, + subScenario: `${input.subScenario} with incremental`, + commandLineArgs: [...input.commandLineArgs, "--incremental"], + }); + }); + } }); } diff --git a/src/testRunner/unittests/tscWatch/incremental.ts b/src/testRunner/unittests/tscWatch/incremental.ts index 34de6c4d7b15d..d8a61636e141b 100644 --- a/src/testRunner/unittests/tscWatch/incremental.ts +++ b/src/testRunner/unittests/tscWatch/incremental.ts @@ -28,26 +28,21 @@ namespace ts.tscWatch { { subScenario, files, optionsToExtend, modifyFs }: VerifyIncrementalWatchEmitInput, incremental: boolean ) { - const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles( - fakes.patchHostForBuildInfoReadWrite(createWatchedSystem(files(), { currentDirectory: project })) - ); + const { sys, baseline, oldSnap } = createBaseline(createWatchedSystem(files(), { currentDirectory: project })); if (incremental) sys.exit = exitCode => sys.exitCode = exitCode; const argsToPass = [incremental ? "-i" : "-w", ...(optionsToExtend || emptyArray)]; - const baseline: string[] = []; baseline.push(`${sys.getExecutingFilePath()} ${argsToPass.join(" ")}`); const { cb, getPrograms } = commandLineCallbacks(sys); - build(/*oldSnap*/ undefined); + build(oldSnap); if (modifyFs) { - const oldSnap = sys.snap(); - modifyFs(sys); - baseline.push(`Change::`, ""); + const oldSnap = applyChange(sys, baseline, modifyFs); build(oldSnap); } Harness.Baseline.runBaseline(`${isBuild(argsToPass) ? "tsbuild/watchMode" : "tscWatch"}/incremental/${subScenario.split(" ").join("-")}-${incremental ? "incremental" : "watch"}.js`, baseline.join("\r\n")); - function build(oldSnap: SystemSnap | undefined) { + function build(oldSnap: SystemSnap) { const closer = executeCommandLine( sys, cb, diff --git a/src/testRunner/unittests/tscWatch/programUpdates.ts b/src/testRunner/unittests/tscWatch/programUpdates.ts index 7e6660805e043..343c8221bf30d 100644 --- a/src/testRunner/unittests/tscWatch/programUpdates.ts +++ b/src/testRunner/unittests/tscWatch/programUpdates.ts @@ -86,10 +86,10 @@ namespace ts.tscWatch { commandLineArgs: ["-w", "-p", configFilePath], sys: () => createWatchedSystem([commonFile1, libFile, configFile]), changes: [ - sys => { - sys.writeFile(commonFile2.path, commonFile2.content); - sys.checkTimeoutQueueLengthAndRun(1); - return "Create commonFile2"; + { + caption: "Create commonFile2", + change: sys => sys.writeFile(commonFile2.path, commonFile2.content), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -122,15 +122,15 @@ namespace ts.tscWatch { return createWatchedSystem([libFile, commonFile1, commonFile2, configFile]); }, changes: [ - sys => { - sys.deleteFile(commonFile2.path); - sys.checkTimeoutQueueLengthAndRun(1); - return "delete file2"; + { + caption: "delete file2", + change: sys => sys.deleteFile(commonFile2.path), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { - sys.writeFile(commonFile2.path, commonFile2.content); - sys.checkTimeoutQueueLengthAndRun(1); - return "recreate file2"; + { + caption: "recreate file2", + change: sys => sys.writeFile(commonFile2.path, commonFile2.content), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -148,10 +148,10 @@ namespace ts.tscWatch { return createWatchedSystem([file1, libFile]); }, changes: [ - sys => { - sys.writeFile(commonFile2.path, commonFile2.content); - sys.checkTimeoutQueueLengthAndRun(1); - return "create file2"; + { + caption: "create file2", + change: sys => sys.writeFile(commonFile2.path, commonFile2.content), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -171,13 +171,13 @@ namespace ts.tscWatch { return createWatchedSystem([libFile, commonFile1, commonFile2, configFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, `{ + { + caption: "Change config", + change: sys => sys.writeFile(configFilePath, `{ "compilerOptions": {}, "files": ["${commonFile1.path}"] - }`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change config"; + }`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -190,20 +190,20 @@ namespace ts.tscWatch { const configFile: File = { path: configFilePath, content: `{ - "compilerOptions": {}, - "files": ["${commonFile1.path}", "${commonFile2.path}"] - }` + "compilerOptions": {}, + "files": ["${commonFile1.path}", "${commonFile2.path}"] + }` }; return createWatchedSystem([libFile, commonFile1, commonFile2, configFile]); }, changes: [ - sys => { - sys.modifyFile(configFilePath, `{ - "compilerOptions": {}, - "files": ["${commonFile1.path}", "${commonFile2.path}"] - }`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Modify config without changing content"; + { + caption: "Modify config without changing content", + change: sys => sys.modifyFile(configFilePath, `{ + "compilerOptions": {}, + "files": ["${commonFile1.path}", "${commonFile2.path}"] + }`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -226,19 +226,19 @@ namespace ts.tscWatch { return createWatchedSystem([libFile, aTs, tsconfig]); }, changes: [ - sys => { - sys.modifyFile("/tsconfig.json", JSON.stringify({ + { + caption: "Disable allowUnsusedLabels", + change: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({ compilerOptions: { allowUnusedLabels: false } - })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Disable allowUnsusedLabels"; + })), + timeouts: checkSingleTimeoutQueueLengthAndRun }, - sys => { - sys.modifyFile("/tsconfig.json", JSON.stringify({ + { + caption: "Enable allowUnsusedLabels", + change: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({ compilerOptions: { allowUnusedLabels: true } - })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Enable allowUnsusedLabels"; + })), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -269,19 +269,20 @@ export class A { return createWatchedSystem([libFile, aTs, bTs, tsconfig]); }, changes: [ - sys => { - sys.modifyFile("/tsconfig.json", JSON.stringify({ + { + caption: "Enable experimentalDecorators", + change: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({ compilerOptions: { target: "es6", importsNotUsedAsValues: "error", experimentalDecorators: true } - })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Enable experimentalDecorators"; + })), + timeouts: checkSingleTimeoutQueueLengthAndRun, + }, - sys => { - sys.modifyFile("/tsconfig.json", JSON.stringify({ + { + caption: "Enable emitDecoratorMetadata", + change: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({ compilerOptions: { target: "es6", importsNotUsedAsValues: "error", experimentalDecorators: true, emitDecoratorMetadata: true } - })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Enable emitDecoratorMetadata"; + })), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -336,15 +337,15 @@ export class A { return createWatchedSystem([libFile, file1, nodeModuleFile, classicModuleFile, configFile]); }, changes: [ - sys => { - sys.writeFile(configFile.path, `{ + { + caption: "Change module resolution to classic", + change: sys => sys.writeFile(configFile.path, `{ "compilerOptions": { "moduleResolution": "classic" }, "files": ["/a/b/file1.ts"] - }`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change module resolution to classic"; + }`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -389,11 +390,11 @@ export class A { return createWatchedSystem([file1, file2, file3, libFile]); }, changes: [ - sys => { + { + caption: "Modify f2 to include f3", // now inferred project should inclule file3 - sys.modifyFile("/a/b/f2.ts", `export * from "../c/f3"`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Modify f2 to include f3"; + change: sys => sys.modifyFile("/a/b/f2.ts", `export * from "../c/f3"`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -418,10 +419,10 @@ export class A { return createWatchedSystem([file1, file2, file3, libFile]); }, changes: [ - sys => { - sys.deleteFile("/a/b/f2.ts"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Delete f2"; + { + caption: "Delete f2", + change: sys => sys.deleteFile("/a/b/f2.ts"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -446,10 +447,10 @@ export class A { return createWatchedSystem([file1, file2, file3, libFile]); }, changes: [ - sys => { - sys.deleteFile("/a/b/f2.ts"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Delete f2"; + { + caption: "Delete f2", + change: sys => sys.deleteFile("/a/b/f2.ts"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -519,10 +520,10 @@ export class A { return createWatchedSystem([file1, libFile, configFile]); }, changes: [ - sys => { - sys.writeFile("/a/b/f2.ts", "let y = 1"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Write f2"; + { + caption: "Write f2", + change: sys => sys.writeFile("/a/b/f2.ts", "let y = 1"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -547,10 +548,10 @@ export class A { return createWatchedSystem([file1, file2, libFile, configFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Modify config to make f2 as root too"; + { + caption: "Modify config to make f2 as root too", + change: sys => sys.writeFile(configFilePath, JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] })), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -575,10 +576,10 @@ export class A { return createWatchedSystem([file1, file2, libFile, configFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, JSON.stringify({ compilerOptions: { outFile: "out.js" }, files: ["f1.ts", "f2.ts"] })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Modify config to set outFile option"; + { + caption: "Modify config to set outFile option", + change: sys => sys.writeFile(configFilePath, JSON.stringify({ compilerOptions: { outFile: "out.js" }, files: ["f1.ts", "f2.ts"] })), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -599,10 +600,10 @@ export class A { return createWatchedSystem([file1, file2, libFile, configFile]); }, changes: [ - sys => { - sys.deleteFile(configFilePath); - sys.checkTimeoutQueueLengthAndRun(1); - return "Delete config file"; + { + caption: "Delete config file", + change: sys => sys.deleteFile(configFilePath), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -661,8 +662,9 @@ declare const eval: any` return createWatchedSystem([libES5, libES2015Promise, app, config1], { executingFilePath: "/compiler/tsc.js" }); }, changes: [ - sys => { - sys.writeFile("/src/tsconfig.json", JSON.stringify( + { + caption: "Change the lib in config", + change: sys => sys.writeFile("/src/tsconfig.json", JSON.stringify( { compilerOptions: { module: "commonjs", @@ -675,9 +677,8 @@ declare const eval: any` ] } }) - ); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change the lib in config"; + ), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -706,17 +707,19 @@ declare const eval: any` changes: emptyArray }); - function changeModuleFileToModuleFile1(sys: WatchedSystem) { - sys.renameFile("/a/b/moduleFile.ts", "/a/b/moduleFile1.ts"); - sys.deleteFile("/a/b/moduleFile.js"); - sys.runQueuedTimeoutCallbacks(); - return "Rename moduleFile to moduleFile1"; - } - function changeModuleFile1ToModuleFile(sys: WatchedSystem) { - sys.renameFile("/a/b/moduleFile1.ts", "/a/b/moduleFile.ts"); - sys.runQueuedTimeoutCallbacks(); - return "Rename moduleFile1 back to moduleFile"; - } + const changeModuleFileToModuleFile1: TscWatchCompileChange = { + caption: "Rename moduleFile to moduleFile1", + change: sys => { + sys.renameFile("/a/b/moduleFile.ts", "/a/b/moduleFile1.ts"); + sys.deleteFile("/a/b/moduleFile.js"); + }, + timeouts: runQueuedTimeoutCallbacks + }; + const changeModuleFile1ToModuleFile: TscWatchCompileChange = { + caption: "Rename moduleFile1 back to moduleFile", + change: sys => sys.renameFile("/a/b/moduleFile1.ts", "/a/b/moduleFile.ts"), + timeouts: runQueuedTimeoutCallbacks, + }; verifyTscWatch({ scenario, @@ -797,10 +800,10 @@ declare const eval: any` return createWatchedSystem([file1, libFile]); }, changes: [ - sys => { - sys.writeFile("/a/b/moduleFile.ts", "export function bar() { }"); - sys.runQueuedTimeoutCallbacks(); - return "Create module file"; + { + caption: "Create module file", + change: sys => sys.writeFile("/a/b/moduleFile.ts", "export function bar() { }"), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -860,22 +863,22 @@ declare const eval: any` return createWatchedSystem([file, configFile, libFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, `{ + { + caption: "change config file to add error", + change: sys => sys.writeFile(configFilePath, `{ "compilerOptions": { "haha": 123 } - }`); - sys.runQueuedTimeoutCallbacks(); - return "change config file to add error"; + }`), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(configFilePath, `{ + { + caption: "change config file to remove error", + change: sys => sys.writeFile(configFilePath, `{ "compilerOptions": { } - }`); - sys.runQueuedTimeoutCallbacks(); - return "change config file to remove error"; + }`), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -964,16 +967,16 @@ declare const eval: any` return createWatchedSystem([file, libFile, configFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, ` + { + caption: "Remove the comment from config file", + change: sys => sys.writeFile(configFilePath, ` { "compilerOptions": { "inlineSourceMap": true, "mapRoot": "./" } -}`); - sys.runQueuedTimeoutCallbacks(); - return "Remove the comment from config file"; +}`), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -1046,15 +1049,16 @@ function two() { return createWatchedSystem([file, libFile]); }, changes: [ - sys => { - sys.writeFile("/a/b/file.ts", `function one() {} + { + caption: "Change file to module", + change: sys => sys.writeFile("/a/b/file.ts", `function one() {} export function two() { return function three() { one(); } -}`); - sys.runQueuedTimeoutCallbacks(); - return "Change file to module"; +}`), + timeouts: runQueuedTimeoutCallbacks, + } ] }); @@ -1076,18 +1080,20 @@ export function two() { return createWatchedSystem([file, libFile, configFile]); }, changes: [ - sys => { - sys.renameFile("/home/username/project/src/file1.ts", "/home/username/project/src/file2.ts"); - sys.runQueuedTimeoutCallbacks(); - return "Rename file1 to file2"; + { + caption: "Rename file1 to file2", + change: sys => sys.renameFile("/home/username/project/src/file1.ts", "/home/username/project/src/file2.ts"), + timeouts: runQueuedTimeoutCallbacks, } ] }); - function changeParameterTypeOfBFile(sys: WatchedSystem, parameterName: string, toType: string) { - replaceFileText(sys, `${projectRoot}/b.ts`, new RegExp(`${parameterName}\: [a-z]*`), `${parameterName}: ${toType}`); - sys.runQueuedTimeoutCallbacks(); - return `Changed ${parameterName} type to ${toType}`; + function changeParameterTypeOfBFile(parameterName: string, toType: string): TscWatchCompileChange { + return { + caption: `Changed ${parameterName} type to ${toType}`, + change: sys => replaceFileText(sys, `${projectRoot}/b.ts`, new RegExp(`${parameterName}\: [a-z]*`), `${parameterName}: ${toType}`), + timeouts: runQueuedTimeoutCallbacks, + }; } verifyTscWatch({ @@ -1120,10 +1126,10 @@ export default test;` return createWatchedSystem([aFile, bFile, libFile, tsconfigFile], { currentDirectory: projectRoot }); }, changes: [ - sys => changeParameterTypeOfBFile(sys, "x", "string"), - sys => changeParameterTypeOfBFile(sys, "x", "number"), - sys => changeParameterTypeOfBFile(sys, "y", "string"), - sys => changeParameterTypeOfBFile(sys, "y", "number"), + changeParameterTypeOfBFile("x", "string"), + changeParameterTypeOfBFile("x", "number"), + changeParameterTypeOfBFile("y", "string"), + changeParameterTypeOfBFile("y", "number"), ] }); @@ -1144,20 +1150,20 @@ foo().hello` return createWatchedSystem([aFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { strictNullChecks: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable strict null checks"; + { + caption: "Enable strict null checks", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { strictNullChecks: true } })), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { strict: true, alwaysStrict: false } })); // Avoid changing 'alwaysStrict' or must re-bind - sys.runQueuedTimeoutCallbacks(); - return "Set always strict false"; + { + caption: "Set always strict false", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { strict: true, alwaysStrict: false } })), // Avoid changing 'alwaysStrict' or must re-bind + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: {} })); - sys.runQueuedTimeoutCallbacks(); - return "Disable strict"; + { + caption: "Disable strict", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: {} })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1187,10 +1193,10 @@ v === 'foo';` return createWatchedSystem([aFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { noErrorTruncation: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable noErrorTruncation"; + { + caption: "Enable noErrorTruncation", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { noErrorTruncation: true } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1212,10 +1218,10 @@ class D extends C { prop = 1; }` return createWatchedSystem([aFile, config, libFile]); }, changes: [ - sys => { - sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { target: "es6", useDefineForClassFields: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable useDefineForClassFields"; + { + caption: "Enable useDefineForClassFields", + change: sys => sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { target: "es6", useDefineForClassFields: true } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1241,20 +1247,20 @@ export function f(p: C) { return p; }` return createWatchedSystem([aFile, bFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "remove" } })); - sys.runQueuedTimeoutCallbacks(); - return 'Set to "remove"'; + { + caption: 'Set to "remove"', + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "remove" } })), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "error" } })); - sys.runQueuedTimeoutCallbacks(); - return 'Set to "error"'; + { + caption: 'Set to "error"', + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "error" } })), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "preserve" } })); - sys.runQueuedTimeoutCallbacks(); - return 'Set to "preserve"'; + { + caption: 'Set to "preserve"', + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "preserve" } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1280,10 +1286,10 @@ export function f(p: C) { return p; }` return createWatchedSystem([aFile, bFile, config, libFile], { useCaseSensitiveFileNames: false }); }, changes: [ - sys => { - sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { forceConsistentCasingInFileNames: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable forceConsistentCasingInFileNames"; + { + caption: "Enable forceConsistentCasingInFileNames", + change: sys => sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { forceConsistentCasingInFileNames: true } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1308,10 +1314,10 @@ export function f(p: C) { return p; }` return createWatchedSystem([aFile, jsonFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { moduleResolution: "node", resolveJsonModule: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable resolveJsonModule"; + { + caption: "Enable resolveJsonModule", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { moduleResolution: "node", resolveJsonModule: true } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1334,18 +1340,18 @@ export function f(p: C) { return p; }` return createWatchedSystem([aFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { + { + caption: "Create b.ts with same content", // Create bts with same file contents - sys.writeFile(`${projectRoot}/b.ts`, `declare module 'a' { + change: sys => sys.writeFile(`${projectRoot}/b.ts`, `declare module 'a' { type foo = number; -}`); - sys.runQueuedTimeoutCallbacks(); - return "Create b.ts with same content"; +}`), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.deleteFile(`${projectRoot}/b.ts`); - sys.runQueuedTimeoutCallbacks(); - return "Delete b.ts"; + { + caption: "Delete b.ts", + change: sys => sys.deleteFile(`${projectRoot}/b.ts`), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1372,15 +1378,15 @@ interface Document { commandLineArgs: ["-w", aFile.path, ...commandLineOptions], sys: () => createWatchedSystem([aFile, libFileWithDocument], { currentDirectory: projectRoot }), changes: [ - sys => { - sys.writeFile(aFile.path, aFile.content.replace(fieldWithoutReadonly, "var x: string;")); - sys.runQueuedTimeoutCallbacks(); - return "Remove document declaration from file"; + { + caption: "Remove document declaration from file", + change: sys => sys.writeFile(aFile.path, aFile.content.replace(fieldWithoutReadonly, "var x: string;")), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(aFile.path, aFile.content); - sys.runQueuedTimeoutCallbacks(); - return "Rever the file to contain document declaration"; + { + caption: "Rever the file to contain document declaration", + change: sys => sys.writeFile(aFile.path, aFile.content), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1413,11 +1419,13 @@ var y: number; }); }); - function changeWhenLibCheckChanges(sys: WatchedSystem, compilerOptions: CompilerOptions) { + function changeWhenLibCheckChanges(compilerOptions: CompilerOptions): TscWatchCompileChange { const configFileContent = JSON.stringify({ compilerOptions }); - sys.writeFile(`${projectRoot}/tsconfig.json`, configFileContent); - sys.runQueuedTimeoutCallbacks(); - return `Changing config to ${configFileContent}`; + return { + caption: `Changing config to ${configFileContent}`, + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, configFileContent), + timeouts: runQueuedTimeoutCallbacks, + }; } verifyTscWatch({ @@ -1452,12 +1460,12 @@ interface Document { return createWatchedSystem([aFile, bFile, configFile, libFileWithDocument], { currentDirectory: projectRoot }); }, changes: [ - sys => changeWhenLibCheckChanges(sys, { skipLibCheck: true }), - sys => changeWhenLibCheckChanges(sys, { skipDefaultLibCheck: true }), - sys => changeWhenLibCheckChanges(sys, {}), - sys => changeWhenLibCheckChanges(sys, { skipDefaultLibCheck: true }), - sys => changeWhenLibCheckChanges(sys, { skipLibCheck: true }), - sys => changeWhenLibCheckChanges(sys, {}), + changeWhenLibCheckChanges({ skipLibCheck: true }), + changeWhenLibCheckChanges({ skipDefaultLibCheck: true }), + changeWhenLibCheckChanges({}), + changeWhenLibCheckChanges({ skipDefaultLibCheck: true }), + changeWhenLibCheckChanges({ skipLibCheck: true }), + changeWhenLibCheckChanges({}), ] }); @@ -1486,10 +1494,10 @@ const b: string = a;` return createWatchedSystem([aFile, bFile, configFile, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/a.ts`, `export const a: number = 1`); - sys.runQueuedTimeoutCallbacks(); - return "Change shape of a"; + { + caption: "Change shape of a", + change: sys => sys.writeFile(`${projectRoot}/a.ts`, `export const a: number = 1`), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1519,12 +1527,12 @@ const b: string = a;` return createWatchedSystem([aFile, bFile, configFile, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/a.ts`, ` + { + caption: "Make changes to file a", + change: sys => sys.writeFile(`${projectRoot}/a.ts`, ` -import { x } from "../b";`); - sys.runQueuedTimeoutCallbacks(); - return "Make changes to file a"; +import { x } from "../b";`), + timeouts: runQueuedTimeoutCallbacks, }, ] }); diff --git a/src/testRunner/unittests/tscWatch/resolutionCache.ts b/src/testRunner/unittests/tscWatch/resolutionCache.ts index f04d481746355..9de81f08410f2 100644 --- a/src/testRunner/unittests/tscWatch/resolutionCache.ts +++ b/src/testRunner/unittests/tscWatch/resolutionCache.ts @@ -185,26 +185,28 @@ namespace ts.tscWatch { content: `import * as fs from "fs";` }, libFile], { currentDirectory: "/a/b" }), changes: [ - sys => { - sys.ensureFileOrFolder({ - path: "/a/b/node_modules/@types/node/package.json", - content: ` + { + caption: "npm install node types", + change: sys => { + sys.ensureFileOrFolder({ + path: "/a/b/node_modules/@types/node/package.json", + content: ` { "main": "" } ` - }); - sys.ensureFileOrFolder({ - path: "/a/b/node_modules/@types/node/index.d.ts", - content: ` + }); + sys.ensureFileOrFolder({ + path: "/a/b/node_modules/@types/node/index.d.ts", + content: ` declare module "fs" { export interface Stats { isFile(): boolean; } }` - }); - sys.runQueuedTimeoutCallbacks(); - return "npm install node types"; + }); + }, + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -235,16 +237,16 @@ declare module "url" { return createWatchedSystem([root, file, libFile], { currentDirectory: "/a/b" }); }, changes: [ - sys => { - sys.appendFile("/a/b/bar.d.ts", ` + { + caption: "Add fs definition", + change: sys => sys.appendFile("/a/b/bar.d.ts", ` declare module "fs" { export interface Stats { isFile(): boolean; } } -`); - sys.runQueuedTimeoutCallbacks(); - return "Add fs definition"; +`), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -282,10 +284,10 @@ declare module "fs" { return createWatchedSystem([file1, file2, module1, libFile, configFile], { currentDirectory: "/a/b/projects/myProject/" }); }, changes: [ - sys => { - sys.appendFile("/a/b/projects/myProject/src/file1.ts", "\n;"); - sys.runQueuedTimeoutCallbacks(); - return "Add new line to file1"; + { + caption: "Add new line to file1", + change: sys => sys.appendFile("/a/b/projects/myProject/src/file1.ts", "\n;"), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -306,10 +308,10 @@ declare module "fs" { return createWatchedSystem([file, libFile, module], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.renameFolder(`${projectRoot}/node_modules2`, `${projectRoot}/node_modules`); - sys.runQueuedTimeoutCallbacks(); - return "npm install"; + { + caption: "npm install", + change: sys => sys.renameFolder(`${projectRoot}/node_modules2`, `${projectRoot}/node_modules`), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -336,14 +338,13 @@ declare module "fs" { return createWatchedSystem([libFile, file1, file2, config]); }, changes: [ - sys => { - const npmCacheFile: File = { + { + caption: "npm install file and folder that start with '.'", + change: sys => sys.ensureFileOrFolder({ path: `${projectRoot}/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts`, content: JSON.stringify({ something: 10 }) - }; - sys.ensureFileOrFolder(npmCacheFile); - sys.checkTimeoutQueueLength(0); - return "npm install file and folder that start with '.'"; + }), + timeouts: sys => sys.checkTimeoutQueueLength(0), } ] }); @@ -373,30 +374,35 @@ declare module "fs" { return createWatchedSystem([app, tsconfig, libFile]); }, changes: [ - sys => { - sys.ensureFileOrFolder({ - path: `${projectRoot}/node_modules/@myapp/ts-types/package.json`, - content: JSON.stringify({ - version: "1.65.1", - types: "types/somefile.define.d.ts" - }) - }); - sys.ensureFileOrFolder({ - path: `${projectRoot}/node_modules/@myapp/ts-types/types/somefile.define.d.ts`, - content: ` + { + caption: "npm install ts-types", + change: sys => { + sys.ensureFileOrFolder({ + path: `${projectRoot}/node_modules/@myapp/ts-types/package.json`, + content: JSON.stringify({ + version: "1.65.1", + types: "types/somefile.define.d.ts" + }) + }); + sys.ensureFileOrFolder({ + path: `${projectRoot}/node_modules/@myapp/ts-types/types/somefile.define.d.ts`, + content: ` declare namespace myapp { function component(str: string): number; }` - }); - sys.checkTimeoutQueueLengthAndRun(1); - return "npm install ts-types"; + }); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - (sys, [[oldProgram, oldBuilderProgram]], watchorSolution) => { - sys.checkTimeoutQueueLength(0); - const newProgram = (watchorSolution as Watch).getProgram(); - assert.strictEqual(newProgram, oldBuilderProgram, "No change so builder program should be same"); - assert.strictEqual(newProgram.getProgram(), oldProgram, "No change so program should be same"); - return "No change, just check program"; + { + caption: "No change, just check program", + change: noop, + timeouts: (sys, [[oldProgram, oldBuilderProgram]], watchorSolution) => { + sys.checkTimeoutQueueLength(0); + const newProgram = (watchorSolution as Watch).getProgram(); + assert.strictEqual(newProgram, oldBuilderProgram, "No change so builder program should be same"); + assert.strictEqual(newProgram.getProgram(), oldProgram, "No change so program should be same"); + } } ] }); diff --git a/src/testRunner/unittests/tscWatch/watchEnvironment.ts b/src/testRunner/unittests/tscWatch/watchEnvironment.ts index 3df1e2f4aea94..3e61757125387 100644 --- a/src/testRunner/unittests/tscWatch/watchEnvironment.ts +++ b/src/testRunner/unittests/tscWatch/watchEnvironment.ts @@ -17,43 +17,51 @@ namespace ts.tscWatch { return createWatchedSystem([file1, libFile], { environmentVariables }); }, changes: [ - (sys, programs) => { - const initialProgram = programs[0][0]; - const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; - for (let index = 0; index < mediumPollingIntervalThreshold; index++) { - // Transition libFile and file1 to low priority queue - sys.checkTimeoutQueueLengthAndRun(1); - assert.deepEqual(programs[0][0], initialProgram); - } - return "Time spent to Transition libFile and file1 to low priority queue"; + { + caption: "Time spent to Transition libFile and file1 to low priority queue", + change: noop, + timeouts: (sys, programs) => { + const initialProgram = programs[0][0]; + const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; + for (let index = 0; index < mediumPollingIntervalThreshold; index++) { + // Transition libFile and file1 to low priority queue + sys.checkTimeoutQueueLengthAndRun(1); + assert.deepEqual(programs[0][0], initialProgram); + } + return; + }, }, - sys => { + { + caption: "Make change to file", // Make a change to file - sys.writeFile("/a/username/project/typescript.ts", "var zz30 = 100;"); - + change: sys => sys.writeFile("/a/username/project/typescript.ts", "var zz30 = 100;"), // During this timeout the file would be detected as unchanged - sys.checkTimeoutQueueLengthAndRun(1); - return "Make change to file"; + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { + { + caption: "Callbacks: medium priority + high priority queue and scheduled program update", + change: noop, // Callbacks: medium priority + high priority queue and scheduled program update - sys.checkTimeoutQueueLengthAndRun(3); // This should detect change in the file - return "Callbacks: medium priority + high priority queue and scheduled program update"; + timeouts: sys => sys.checkTimeoutQueueLengthAndRun(3), }, - (sys, programs) => { - const initialProgram = programs[0][0]; - const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; - const newThreshold = unchangedPollThresholds[PollingInterval.Low] + mediumPollingIntervalThreshold; - for (let fileUnchangeDetected = 1; fileUnchangeDetected < newThreshold; fileUnchangeDetected++) { - // For high + Medium/low polling interval - sys.checkTimeoutQueueLengthAndRun(2); - assert.deepEqual(programs[0][0], initialProgram); - } + { + caption: "Polling queues polled and everything is in the high polling queue", + change: noop, + timeouts: (sys, programs) => { + const initialProgram = programs[0][0]; + const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; + const newThreshold = unchangedPollThresholds[PollingInterval.Low] + mediumPollingIntervalThreshold; + for (let fileUnchangeDetected = 1; fileUnchangeDetected < newThreshold; fileUnchangeDetected++) { + // For high + Medium/low polling interval + sys.checkTimeoutQueueLengthAndRun(2); + assert.deepEqual(programs[0][0], initialProgram); + } - // Everything goes in high polling interval queue - sys.checkTimeoutQueueLengthAndRun(1); - return "Polling queues polled and everything is in the high polling queue"; + // Everything goes in high polling interval queue + sys.checkTimeoutQueueLengthAndRun(1); + return; + }, } ] }); @@ -85,16 +93,19 @@ namespace ts.tscWatch { return createWatchedSystem(files, { environmentVariables }); }, changes: [ - sys => { + { + caption: "Rename file1 to file2", // Rename the file: - sys.renameFile(file.path, file.path.replace("file1.ts", "file2.ts")); - if (tscWatchDirectory === Tsc_WatchDirectory.DynamicPolling) { - // With dynamic polling the fs change would be detected only by running timeouts + change: sys => sys.renameFile(file.path, file.path.replace("file1.ts", "file2.ts")), + timeouts: sys => { + if (tscWatchDirectory === Tsc_WatchDirectory.DynamicPolling) { + // With dynamic polling the fs change would be detected only by running timeouts + sys.runQueuedTimeoutCallbacks(); + } + // Delayed update program sys.runQueuedTimeoutCallbacks(); - } - // Delayed update program - sys.runQueuedTimeoutCallbacks(); - return "Rename file1 to file2"; + return; + }, }, ], }); @@ -173,51 +184,65 @@ namespace ts.tscWatch { return createWatchedSystem(files, { runWithoutRecursiveWatches: true }); }, changes: [ - sys => { - sys.checkTimeoutQueueLengthAndRun(1); // To update directory callbacks for file1.js output - sys.checkTimeoutQueueLengthAndRun(1); // Update program again - sys.checkTimeoutQueueLength(0); - return "Pending updates because of file1.js creation"; + { + caption: "Pending updates because of file1.js creation", + change: noop, + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // To update directory callbacks for file1.js output + sys.checkTimeoutQueueLengthAndRun(1); // Update program again + sys.checkTimeoutQueueLength(0); + }, }, - sys => { + { + caption: "Remove directory node_modules", // Remove directory node_modules - sys.deleteFolder(`${projectRoot}/node_modules`, /*recursive*/ true); - sys.checkTimeoutQueueLength(2); // 1. For updating program and 2. for updating child watches - sys.runQueuedTimeoutCallbacks(sys.getNextTimeoutId() - 2); // Update program - return "Remove directory node_modules"; + change: sys => sys.deleteFolder(`${projectRoot}/node_modules`, /*recursive*/ true), + timeouts: sys => { + sys.checkTimeoutQueueLength(2); // 1. For updating program and 2. for updating child watches + sys.runQueuedTimeoutCallbacks(sys.getNextTimeoutId() - 2); // Update program + }, }, - sys => { - sys.checkTimeoutQueueLengthAndRun(1); // To update directory watchers - sys.checkTimeoutQueueLengthAndRun(1); // To Update program - sys.checkTimeoutQueueLength(0); - return "Pending directory watchers and program update"; + { + caption: "Pending directory watchers and program update", + change: noop, + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // To update directory watchers + sys.checkTimeoutQueueLengthAndRun(1); // To Update program + sys.checkTimeoutQueueLength(0); + }, }, - sys => { + { + caption: "Start npm install", // npm install - sys.createDirectory(`${projectRoot}/node_modules`); - sys.checkTimeoutQueueLength(1); // To update folder structure - return "Start npm install"; + change: sys => sys.createDirectory(`${projectRoot}/node_modules`), + timeouts: sys => sys.checkTimeoutQueueLength(1), // To update folder structure + }, + { + caption: "npm install folder creation of file2", + change: sys => sys.createDirectory(`${projectRoot}/node_modules/file2`), + timeouts: sys => sys.checkTimeoutQueueLength(1), // To update folder structure }, - sys => { - sys.createDirectory(`${projectRoot}/node_modules/file2`); - sys.checkTimeoutQueueLength(1); // To update folder structure - return "npm install folder creation of file2"; + { + caption: "npm install index file in file2", + change: sys => sys.writeFile(`${projectRoot}/node_modules/file2/index.d.ts`, `export const x = 10;`), + timeouts: sys => sys.checkTimeoutQueueLength(1), // To update folder structure }, - sys => { - sys.writeFile(`${projectRoot}/node_modules/file2/index.d.ts`, `export const x = 10;`); - sys.checkTimeoutQueueLength(1); // To update folder structure - return "npm install index file in file2"; + { + caption: "Updates the program", + change: noop, + timeouts: sys => { + sys.runQueuedTimeoutCallbacks(); + sys.checkTimeoutQueueLength(1); // To Update the program + }, }, - sys => { - sys.runQueuedTimeoutCallbacks(); - sys.checkTimeoutQueueLength(1); // To Update the program - return "Updates the program"; + { + caption: "Pending updates", + change: noop, + timeouts: sys => { + sys.runQueuedTimeoutCallbacks(); + sys.checkTimeoutQueueLength(0); + }, }, - sys => { - sys.runQueuedTimeoutCallbacks(); - sys.checkTimeoutQueueLength(0); - return "Pending updates"; - } ], }); }); diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/modules-and-globals-mixed-in-amd.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/modules-and-globals-mixed-in-amd.js index c2d1035fc8c2e..18a90930a3d7c 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/modules-and-globals-mixed-in-amd.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/modules-and-globals-mixed-in-amd.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +21,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] var myGlob = 20; define("file1", ["require", "exports"], function (require, exports) { @@ -357,9 +363,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js index 30ce5e95cefa5..15f1cddb0f277 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,12 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;function forlibfile1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +23,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] var __read = (this && this.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; @@ -915,11 +923,6 @@ declare function appfile4Spread(...b: number[]): void; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;function forlibfile1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js index 03ae15191b9d8..fc32cc1ebd096 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +21,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] "use strict"; "myPrologue"; @@ -507,9 +513,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/shebang-in-all-projects.js index 3fc4cacb86df1..176d6a0d2468b 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/shebang-in-all-projects.js @@ -1,4 +1,11 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +#!someshebang lib file1 +export const x = 10;console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +22,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] #!someshebang lib file0 var myGlob = 20; @@ -362,10 +369,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -#!someshebang lib file1 -export const x = 10;console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/stripInternal.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/stripInternal.js index b5bddf5859669..1b74e80929944 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/stripInternal.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/stripInternal.js @@ -1,4 +1,35 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10; +export class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +export namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ export class internalC {} +/*@internal*/ export function internalfoo() {} +/*@internal*/ export namespace internalNamespace { export class someClass {} } +/*@internal*/ export namespace internalOther.something { export class someClass {} } +/*@internal*/ export import internalImport = internalNamespace.someClass; +/*@internal*/ export type internalType = internalC; +/*@internal*/ export const internalConst = 10; +/*@internal*/ export enum internalEnum { a, b, c }console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +46,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] /*@internal*/ var myGlob = 20; define("file1", ["require", "exports"], function (require, exports) { @@ -1893,34 +1924,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10; -export class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -export namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ export class internalC {} -/*@internal*/ export function internalfoo() {} -/*@internal*/ export namespace internalNamespace { export class someClass {} } -/*@internal*/ export namespace internalOther.something { export class someClass {} } -/*@internal*/ export import internalImport = internalNamespace.someClass; -/*@internal*/ export type internalType = internalC; -/*@internal*/ export const internalConst = 10; -/*@internal*/ export enum internalEnum { a, b, c }console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js index 688ca0cc27e6e..5678035f987b9 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +21,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] /// var file0Const = new libfile0(); @@ -457,9 +463,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js index fbad9dae2e765..675e7469a49ef 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;function forlibfile1Rest() { } + + + +Output:: /lib/tsc --b /src/app --verbose [12:08:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +21,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] var __read = (this && this.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; @@ -800,9 +806,6 @@ declare function appfile4Spread(...b: number[]): void; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;function forlibfile1Rest() { } - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js index 685305aa38d4a..ad23914083586 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js @@ -1,4 +1,11 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/lib/file1.ts] +"myPrologue5" +export const x = 10; + + + +Output:: /lib/tsc --b /src/app --verbose [12:08:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +22,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.d.ts.map] {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../lib/file0.ts","../lib/file1.ts","../lib/file2.ts","../lib/global.ts","file3.ts","file4.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,KAAK,CAAC;;ICAlB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;;ICApB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,WAAW,KAAK,CAAC;;ICAvB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,KAAK,KAAK,CAAC"} @@ -671,10 +678,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -"myPrologue5" -export const x = 10; - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["file0.ts","file1.ts","file2.ts","global.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,KAAK,CAAC;;ICAlB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;;ICApB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,WAAW,KAAK,CAAC"} diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/stripInternal.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/stripInternal.js index ebe8a5f929513..cb26d9f069cd8 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/stripInternal.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/stripInternal.js @@ -1,4 +1,35 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/lib/file1.ts] +/*@internal*/ export const x = 10; +export class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +export namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ export class internalC {} +/*@internal*/ export function internalfoo() {} +/*@internal*/ export namespace internalNamespace { export class someClass {} } +/*@internal*/ export namespace internalOther.something { export class someClass {} } +/*@internal*/ export import internalImport = internalNamespace.someClass; +/*@internal*/ export type internalType = internalC; +/*@internal*/ export const internalConst = 10; +/*@internal*/ export enum internalEnum { a, b, c } + + + +Output:: /lib/tsc --b /src/app --verbose [12:08:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,8 +44,8 @@ [12:08:00 AM] Updating output of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.d.ts] declare module "file1" { export class normalC { @@ -2069,34 +2100,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -/*@internal*/ export const x = 10; -export class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -export namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ export class internalC {} -/*@internal*/ export function internalfoo() {} -/*@internal*/ export namespace internalNamespace { export class someClass {} } -/*@internal*/ export namespace internalOther.something { export class someClass {} } -/*@internal*/ export import internalImport = internalNamespace.someClass; -/*@internal*/ export type internalType = internalC; -/*@internal*/ export const internalConst = 10; -/*@internal*/ export enum internalEnum { a, b, c } - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["file0.ts","file1.ts","file2.ts","global.ts"],"names":[],"mappings":"AAAc,QAAA,MAAM,MAAM,KAAK,CAAC;;ICAlB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAClC,MAAM,OAAO,OAAO;;QAEF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM;QACN,IAAI,CAAC,IACM,MAAM,CADK;QACtB,IAAI,CAAC,CAAC,KAAK,MAAM,EAAK;KACvC;IACD,MAAM,WAAW,OAAO,CAAC;QACP,MAAa,CAAC;SAAI;QAClB,SAAgB,GAAG,SAAK;QACxB,UAAiB,aAAa,CAAC;YAAE,MAAa,CAAC;aAAG;SAAE;QACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;YAAE,MAAa,SAAS;aAAG;SAAE;QAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;QAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;QAC9B,MAAM,aAAa,KAAK,CAAC;QAChC,KAAY,YAAY;YAAG,CAAC,IAAA;YAAE,CAAC,IAAA;YAAE,CAAC,IAAA;SAAE;KACrD;IACa,MAAM,OAAO,SAAS;KAAG;IACzB,MAAM,UAAU,WAAW,SAAK;IAChC,MAAM,WAAW,iBAAiB,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAChE,MAAM,WAAW,aAAa,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IACtE,MAAM,QAAQ,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;IAC3D,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,MAAM,CAAC,MAAM,aAAa,KAAK,CAAC;IAChC,MAAM,MAAM,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;;;ICzBlD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,WAAW,KAAK,CAAC"} diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/modules-and-globals-mixed-in-amd.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/modules-and-globals-mixed-in-amd.js index be5554e722dc6..8d5dd5eed34e4 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/modules-and-globals-mixed-in-amd.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/modules-and-globals-mixed-in-amd.js @@ -1,4 +1,73 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,8 +82,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.d.ts] declare const myGlob = 20; declare module "file1" { diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-emitHelpers-in-all-projects.js index 97aabafd08c18..893b4c37771f0 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,83 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "file1";function forappfile3Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/app/file4.ts] +const myVar = 30; +function appfile4Spread(...b: number[]) { } +appfile4Spread(...[10, 20, 30]); + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +const myGlob = 20; +function libfile0Spread(...b: number[]) { } +libfile0Spread(...[10, 20, 30]); + +//// [/src/lib/file1.ts] +export const x = 10;function forlibfile1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "downlevelIteration": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,19 +92,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file3.ts] -export const z = 30; -import { x } from "file1";function forappfile3Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/app/file4.ts] -const myVar = 30; -function appfile4Spread(...b: number[]) { } -appfile4Spread(...[10, 20, 30]); - + + //// [/src/app/module.d.ts] declare const myGlob = 20; declare function libfile0Spread(...b: number[]): void; @@ -1145,34 +1213,6 @@ declare function appfile4Spread(...b: number[]): void; ====================================================================== -//// [/src/app/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"], - "references": [ - { "path": "../lib", "prepend": true } - ] -} - -//// [/src/lib/file0.ts] -const myGlob = 20; -function libfile0Spread(...b: number[]) { } -libfile0Spread(...[10, 20, 30]); - -//// [/src/lib/file1.ts] -export const x = 10;function forlibfile1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/lib/module.d.ts] declare const myGlob = 20; declare function libfile0Spread(...b: number[]): void; @@ -1881,19 +1921,3 @@ declare const globalConst = 10; ====================================================================== -//// [/src/lib/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "sourceMap": true, - "declarationMap": true, - "strict": false, - "downlevelIteration": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"] - -} - diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-prologues-in-all-projects.js index 49dac70814c7a..fb3e881a8dc1b 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-prologues-in-all-projects.js @@ -1,4 +1,78 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +"myPrologue" +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +"myPrologue2"; +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +"myPrologue" +const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; + +//// [/src/lib/file2.ts] +"myPrologueFile" +export const y = 20; + +//// [/src/lib/global.ts] +"myPrologue3" +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,17 +87,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file3.ts] -"myPrologue" -export const z = 30; -import { x } from "file1"; - -//// [/src/app/file4.ts] -"myPrologue2"; -const myVar = 30; - + + //// [/src/app/module.d.ts] declare const myGlob = 20; declare module "file1" { @@ -677,35 +742,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/app/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"], - "references": [ - { "path": "../lib", "prepend": true } - ] -} - -//// [/src/lib/file0.ts] -"myPrologue" -const myGlob = 20; - -//// [/src/lib/file2.ts] -"myPrologueFile" -export const y = 20; - -//// [/src/lib/global.ts] -"myPrologue3" -const globalConst = 10; - //// [/src/lib/module.d.ts] declare const myGlob = 20; declare module "file1" { @@ -1167,18 +1203,3 @@ declare const globalConst = 10; ====================================================================== -//// [/src/lib/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "sourceMap": true, - "declarationMap": true, - "strict": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"] - -} - diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/shebang-in-all-projects.js index 74bab6f42298b..1869f50a4c4ad 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/shebang-in-all-projects.js @@ -1,4 +1,76 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +#!someshebang app file3 +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +#!someshebang lib file0 +const myGlob = 20; + +//// [/src/lib/file1.ts] +#!someshebang lib file1 +export const x = 10; + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,13 +85,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file3.ts] -#!someshebang app file3 -export const z = 30; -import { x } from "file1"; - + + //// [/src/app/module.d.ts] #!someshebang lib file0 declare const myGlob = 20; @@ -528,14 +595,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file0.ts] -#!someshebang lib file0 -const myGlob = 20; - -//// [/src/lib/file1.ts] -#!someshebang lib file1 -export const x = 10; - //// [/src/lib/module.d.ts] #!someshebang lib file0 declare const myGlob = 20; diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/stripInternal.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/stripInternal.js index d235c145f991b..bb809835351b2 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/stripInternal.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/stripInternal.js @@ -1,4 +1,99 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, +"stripInternal": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +/*@internal*/ const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; +export class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +export namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ export class internalC {} +/*@internal*/ export function internalfoo() {} +/*@internal*/ export namespace internalNamespace { export class someClass {} } +/*@internal*/ export namespace internalOther.something { export class someClass {} } +/*@internal*/ export import internalImport = internalNamespace.someClass; +/*@internal*/ export type internalType = internalC; +/*@internal*/ export const internalConst = 10; +/*@internal*/ export enum internalEnum { a, b, c } + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,8 +108,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.d.ts] declare module "file1" { export const x = 10; @@ -2089,55 +2184,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/app/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, -"stripInternal": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"], - "references": [ - { "path": "../lib", "prepend": true } - ] -} - -//// [/src/lib/file0.ts] -/*@internal*/ const myGlob = 20; - -//// [/src/lib/file1.ts] -export const x = 10; -export class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -export namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ export class internalC {} -/*@internal*/ export function internalfoo() {} -/*@internal*/ export namespace internalNamespace { export class someClass {} } -/*@internal*/ export namespace internalOther.something { export class someClass {} } -/*@internal*/ export import internalImport = internalNamespace.someClass; -/*@internal*/ export type internalType = internalC; -/*@internal*/ export const internalConst = 10; -/*@internal*/ export enum internalEnum { a, b, c } - //// [/src/lib/module.d.ts] declare const myGlob = 20; declare module "file1" { diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/triple-slash-refs-in-all-projects.js index af0e9a6ea5f66..f5f4e8c323dd9 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/triple-slash-refs-in-all-projects.js @@ -1,4 +1,83 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +/// +const file4Const = new appfile4(); +const myVar = 30; + +//// [/src/app/tripleRef.d.ts] +declare class appfile4 { } + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +/// +const file0Const = new libfile0(); +const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tripleRef.d.ts] +declare class libfile0 { } + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,13 +92,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file4.ts] -/// -const file4Const = new appfile4(); -const myVar = 30; - + + //// [/src/app/module.d.ts] /// /// @@ -668,14 +742,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/app/tripleRef.d.ts] -declare class appfile4 { } - -//// [/src/lib/file0.ts] -/// -const file0Const = new libfile0(); -const myGlob = 20; - //// [/src/lib/module.d.ts] /// declare const file0Const: libfile0; @@ -1086,6 +1152,3 @@ declare const globalConst = 10; ====================================================================== -//// [/src/lib/tripleRef.d.ts] -declare class libfile0 { } - diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/when-the-module-resolution-finds-original-source-file.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/when-the-module-resolution-finds-original-source-file.js index 04d3212b9935e..b070bcef95566 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/when-the-module-resolution-finds-original-source-file.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/when-the-module-resolution-finds-original-source-file.js @@ -1,4 +1,73 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "lib/file1"; + +//// [/src/app/file4.ts] +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "../module.js", "rootDir": "../" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc -b /src/app --verbose [12:00:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,12 +82,8 @@ [12:00:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file3.ts] -export const z = 30; -import { x } from "lib/file1"; - + + //// [/src/app/module.d.ts] declare const myGlob = 20; declare module "lib/file1" { @@ -518,21 +583,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "sourceMap": true, - "declarationMap": true, - "strict": false, - "outFile": "../module.js", "rootDir": "../" - }, - "exclude": ["module.d.ts"] - -} - //// [/src/module.d.ts] declare const myGlob = 20; declare module "lib/file1" { diff --git a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-changes/builds-after-fixing-config-file-errors.js b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-changes/builds-after-fixing-config-file-errors.js index 0d5e1c5125cfb..907c37c49d20a 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-changes/builds-after-fixing-config-file-errors.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-changes/builds-after-fixing-config-file-errors.js @@ -1,8 +1,14 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true},"files":["a.ts","b.ts"]} + + + +Output:: /lib/tsc --b /src/tsconfig.json exitCode:: ExitStatus.Success - - + + //// [/src/a.d.ts] export declare function foo(): void; @@ -27,9 +33,6 @@ function bar() { } exports.bar = bar; -//// [/src/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true},"files":["a.ts","b.ts"]} - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-config-file.js index e9c41eb95c65a..47aa64fe1a1ab 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-config-file.js @@ -1,16 +1,4 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --b /src/tsconfig.json -src/tsconfig.json:8:9 - error TS1005: ',' expected. - -8 "b.ts" -   ~~~~~~ - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - +Input:: //// [/src/tsconfig.json] { "compilerOptions": { @@ -23,3 +11,18 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped ] } + + +Output:: +/lib/tsc --b /src/tsconfig.json +src/tsconfig.json:8:9 - error TS1005: ',' expected. + +8 "b.ts" +   ~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-ts-file.js b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-ts-file.js index a69f31cf4d4ef..15011c5129363 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-ts-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-ts-file.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/a.ts] +export function foo() { }export function fooBar() { } + + + +Output:: /lib/tsc --b /src/tsconfig.json src/tsconfig.json:7:9 - error TS1005: ',' expected. @@ -9,8 +15,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - -//// [/src/a.ts] -export function foo() { }export function fooBar() { } - + + diff --git a/tests/baselines/reference/tsbuild/configFileErrors/initial-build/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/initial-build/reports-syntax-errors-in-config-file.js index baa0311442172..ef55c7e7b4ceb 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/initial-build/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/initial-build/reports-syntax-errors-in-config-file.js @@ -1,4 +1,39 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/a.ts] +export function foo() { } + +//// [/src/b.ts] +export function bar() { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + }, + "files": [ + "a.ts" + "b.ts" + ] +} + + + +Output:: /lib/tsc --b /src/tsconfig.json src/tsconfig.json:7:9 - error TS1005: ',' expected. @@ -9,5 +44,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/configFileErrors/initial-build/when-tsconfig-extends-the-missing-file.js b/tests/baselines/reference/tsbuild/configFileErrors/initial-build/when-tsconfig-extends-the-missing-file.js index 0403cf03bb88e..b948e6af2015f 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/initial-build/when-tsconfig-extends-the-missing-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/initial-build/when-tsconfig-extends-the-missing-file.js @@ -1,4 +1,37 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/tsconfig.first.json] +{ + "extends": "./foobar.json", + "compilerOptions": { + "composite": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./tsconfig.first.json" }, + { "path": "./tsconfig.second.json" } + ] +} + +//// [/src/tsconfig.second.json] +{ + "extends": "./foobar.json", + "compilerOptions": { + "composite": true + } +} + + + +Output:: /lib/tsc --b /src/tsconfig.json error TS5083: Cannot read file '/src/foobar.json'. @@ -12,5 +45,5 @@ Found 4 errors. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/configFileErrors/no-change-run/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/no-change-run/reports-syntax-errors-in-config-file.js index a3a339da3c8e4..0ae857d8deb97 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/no-change-run/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/no-change-run/reports-syntax-errors-in-config-file.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tsconfig.json src/tsconfig.json:7:9 - error TS1005: ',' expected. @@ -9,5 +12,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js index 3fc8dac542226..ec854279fbfdc 100644 --- a/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js +++ b/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js @@ -1,4 +1,82 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/folder/index.ts] +export const x = 10; + +//// [/src/src/folder/tsconfig.json] +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + } +} + +//// [/src/src/folder2/index.ts] +export const x = 10; + +//// [/src/src/folder2/tsconfig.json] +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + } +} + +//// [/src/src/tsconfig.json] +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./folder" }, + { "path": "./folder2"} + ] + } + +//// [/src/tests/index.ts] +export const x = 10; + +//// [/src/tests/tsconfig.json] +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../src" } + ] +} + +//// [/src/tsconfig.json] +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./src" }, + { "path": "./tests"} + ] +} + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/src/folder/tsconfig.json @@ -20,8 +98,8 @@ [12:01:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/src/folder/index.d.ts] export declare const x = 10; @@ -142,3 +220,27 @@ exports.x = 10; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/src/folder/tsconfig.json + * src/src/folder2/tsconfig.json + * src/src/tsconfig.json + * src/tests/tsconfig.json + * src/tsconfig.json + +[12:04:00 AM] Project 'src/src/folder/tsconfig.json' is up to date because newest input 'src/src/folder/index.ts' is older than oldest output 'src/src/folder/index.js' + +[12:04:00 AM] Project 'src/src/folder2/tsconfig.json' is up to date because newest input 'src/src/folder2/index.ts' is older than oldest output 'src/src/folder2/index.js' + +[12:04:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js deleted file mode 100644 index fa95a039a613e..0000000000000 --- a/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/src/folder/tsconfig.json - * src/src/folder2/tsconfig.json - * src/src/tsconfig.json - * src/tests/tsconfig.json - * src/tsconfig.json - -[12:04:00 AM] Project 'src/src/folder/tsconfig.json' is up to date because newest input 'src/src/folder/index.ts' is older than oldest output 'src/src/folder/index.js' - -[12:04:00 AM] Project 'src/src/folder2/tsconfig.json' is up to date because newest input 'src/src/folder2/index.ts' is older than oldest output 'src/src/folder2/index.js' - -[12:04:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' - -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js b/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js index ad10d21163026..e70f1f9d5aa39 100644 --- a/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js +++ b/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js @@ -1,4 +1,142 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/animals/animal.ts] +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} + + +//// [/src/animals/dog.ts] +import Animal from '.'; +import { makeRandomName } from '../core/utilities'; + +export interface Dog extends Animal { + woof(): void; + name: string; +} + +export function createDog(): Dog { + return ({ + size: "medium", + woof: function(this: Dog) { + console.log(`${this.name} says "Woof"!`); + }, + name: makeRandomName() + }); +} + + + +//// [/src/animals/index.ts] +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; + + +//// [/src/animals/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": ".", + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/core/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + } +} + +//// [/src/core/utilities.ts] +import * as A from '../animals'; + +export function makeRandomName() { + return "Bob!?! "; +} + +export function lastElementOf(arr: T[]): T | undefined { + if (arr.length === 0) return undefined; + return arr[arr.length - 1]; +} + + + +//// [/src/tsconfig-base.json] +{ + "compilerOptions": { + "declaration": true, + "target": "es5", + "module": "commonjs", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true + } +} + +//// [/src/tsconfig.json] +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals" + }, + { + "path": "./zoo" + } + ] +} + +//// [/src/zoo/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} + +//// [/src/zoo/zoo.ts] + + + + +Output:: /lib/tsc --b /src/tsconfig.json --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -57,19 +195,5 @@ Found 7 errors. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - -//// [/src/core/utilities.ts] -import * as A from '../animals'; - -export function makeRandomName() { - return "Bob!?! "; -} - -export function lastElementOf(arr: T[]): T | undefined { - if (arr.length === 0) return undefined; - return arr[arr.length - 1]; -} - - - + + diff --git a/tests/baselines/reference/tsbuild/demo/initial-build/in-circular-branch-reports-the-error-about-it-by-stopping-build.js b/tests/baselines/reference/tsbuild/demo/initial-build/in-circular-branch-reports-the-error-about-it-by-stopping-build.js index 759404e0d1933..f84d662938dfd 100644 --- a/tests/baselines/reference/tsbuild/demo/initial-build/in-circular-branch-reports-the-error-about-it-by-stopping-build.js +++ b/tests/baselines/reference/tsbuild/demo/initial-build/in-circular-branch-reports-the-error-about-it-by-stopping-build.js @@ -1,20 +1,27 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: - * src/animals/tsconfig.json - * src/zoo/tsconfig.json - * src/core/tsconfig.json - * src/tsconfig.json +Input:: +//// [/lib/lib.d.ts] -error TS6202: Project references may not form a circular graph. Cycle detected: /src/tsconfig.json -/src/core/tsconfig.json -/src/zoo/tsconfig.json -/src/animals/tsconfig.json +//// [/src/animals/animal.ts] -Found 1 error. -exitCode:: ExitStatus.ProjectReferenceCycle_OutputsSkupped +//// [/src/animals/dog.ts] + + +//// [/src/animals/index.ts] + + +//// [/src/animals/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": ".", + }, + "references": [ + { "path": "../core" } + ] +} //// [/src/core/tsconfig.json] @@ -31,3 +38,75 @@ exitCode:: ExitStatus.ProjectReferenceCycle_OutputsSkupped ] } +//// [/src/core/utilities.ts] + + +//// [/src/tsconfig-base.json] +{ + "compilerOptions": { + "declaration": true, + "target": "es5", + "module": "commonjs", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true + } +} + +//// [/src/tsconfig.json] +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals" + }, + { + "path": "./zoo" + } + ] +} + +//// [/src/zoo/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} + +//// [/src/zoo/zoo.ts] + + + + +Output:: +/lib/tsc --b /src/tsconfig.json --verbose +[12:00:00 AM] Projects in this build: + * src/animals/tsconfig.json + * src/zoo/tsconfig.json + * src/core/tsconfig.json + * src/tsconfig.json + +error TS6202: Project references may not form a circular graph. Cycle detected: /src/tsconfig.json +/src/core/tsconfig.json +/src/zoo/tsconfig.json +/src/animals/tsconfig.json + + +Found 1 error. + +exitCode:: ExitStatus.ProjectReferenceCycle_OutputsSkupped + + diff --git a/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js b/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js index 56c9f505b67a1..54546e00acb22 100644 --- a/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js +++ b/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js @@ -1,4 +1,149 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/animals/animal.ts] +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} + + +//// [/src/animals/dog.ts] +import Animal from '.'; +import { makeRandomName } from '../core/utilities'; + +export interface Dog extends Animal { + woof(): void; + name: string; +} + +export function createDog(): Dog { + return ({ + size: "medium", + woof: function(this: Dog) { + console.log(`${this.name} says "Woof"!`); + }, + name: makeRandomName() + }); +} + + + +//// [/src/animals/index.ts] +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; + + +//// [/src/animals/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": ".", + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/core/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + } +} + +//// [/src/core/utilities.ts] + +export function makeRandomName() { + return "Bob!?! "; +} + +export function lastElementOf(arr: T[]): T | undefined { + if (arr.length === 0) return undefined; + return arr[arr.length - 1]; +} + + + +//// [/src/tsconfig-base.json] +{ + "compilerOptions": { + "declaration": true, + "target": "es5", + "module": "commonjs", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true + } +} + +//// [/src/tsconfig.json] +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals" + }, + { + "path": "./zoo" + } + ] +} + +//// [/src/zoo/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} + +//// [/src/zoo/zoo.ts] +import { Dog, createDog } from '../animals/index'; + +export function createZoo(): Array { + return [ + createDog() + ]; +} + + + + + +Output:: /lib/tsc --b /src/tsconfig.json --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -19,8 +164,8 @@ [12:00:00 AM] Building project '/src/zoo/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/animals/animal.d.ts] export declare type Size = "small" | "medium" | "large"; export default interface Animal { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js deleted file mode 100644 index 45ebd6052bebb..0000000000000 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js +++ /dev/null @@ -1,126 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/lib/a.d.ts] -import { B } from "./b"; -export interface A { - b: B; - foo: any; -} -//# sourceMappingURL=a.d.ts.map - -//// [/src/lib/a.d.ts.map] -{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAChB"} - -//// [/src/lib/b.d.ts] file written with same contents -//// [/src/lib/b.d.ts.map] file written with same contents -//// [/src/lib/c.d.ts] file written with same contents -//// [/src/lib/c.d.ts.map] file written with same contents -//// [/src/lib/index.d.ts] file written with same contents -//// [/src/lib/index.d.ts.map] file written with same contents -//// [/src/src/a.ts] -import { B } from "./b"; - -export interface A { - b: B; foo: any; -} - - -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/c.ts": { - "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", - "affectsGlobalScope": false - }, - "./src/b.ts": { - "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", - "affectsGlobalScope": false - }, - "./src/a.ts": { - "version": "-14761736732-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}\n", - "signature": "-11119001497-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", - "affectsGlobalScope": false - }, - "./src/index.ts": { - "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", - "signature": "14762544269-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "target": 1, - "module": 1, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "./lib", - "composite": true, - "strict": true, - "esModuleInterop": true, - "alwaysStrict": true, - "rootDir": "./src", - "emitDeclarationOnly": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/a.ts": [ - "./src/b.ts" - ], - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ], - "./src/index.ts": [ - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "exportedModulesMap": { - "./src/a.ts": [ - "./src/b.ts" - ], - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ], - "./src/index.ts": [ - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/a.ts", - "./src/b.ts", - "./src/c.ts", - "./src/index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js deleted file mode 100644 index e7f944f1896ce..0000000000000 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js +++ /dev/null @@ -1,119 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/lib/a.d.ts] -import { B } from "./b"; -export interface A { - b: B; - foo: any; -} - - -//// [/src/lib/b.d.ts] file written with same contents -//// [/src/lib/c.d.ts] file written with same contents -//// [/src/lib/index.d.ts] file written with same contents -//// [/src/src/a.ts] -import { B } from "./b"; - -export interface A { - b: B; foo: any; -} - - -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/c.ts": { - "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n", - "affectsGlobalScope": false - }, - "./src/b.ts": { - "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n", - "affectsGlobalScope": false - }, - "./src/a.ts": { - "version": "-14761736732-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}\n", - "signature": "-7639584379-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n", - "affectsGlobalScope": false - }, - "./src/index.ts": { - "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", - "signature": "-6009477228-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "target": 1, - "module": 1, - "declaration": true, - "sourceMap": true, - "outDir": "./lib", - "composite": true, - "strict": true, - "esModuleInterop": true, - "alwaysStrict": true, - "rootDir": "./src", - "emitDeclarationOnly": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/a.ts": [ - "./src/b.ts" - ], - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ], - "./src/index.ts": [ - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "exportedModulesMap": { - "./src/a.ts": [ - "./src/b.ts" - ], - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ], - "./src/index.ts": [ - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/a.ts", - "./src/b.ts", - "./src/c.ts", - "./src/index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js deleted file mode 100644 index b1de2d8635930..0000000000000 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ /dev/null @@ -1,104 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/lib/a.d.ts] -export declare class B { - prop: string; -} -export interface A { - b: B; - foo: any; -} -//# sourceMappingURL=a.d.ts.map - -//// [/src/lib/a.d.ts.map] -{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAElC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAChB"} - -//// [/src/lib/b.d.ts] file written with same contents -//// [/src/lib/b.d.ts.map] file written with same contents -//// [/src/lib/c.d.ts] file written with same contents -//// [/src/lib/c.d.ts.map] file written with same contents -//// [/src/src/a.ts] -export class B { prop = "hello"; } - -export interface A { - b: B; foo: any; -} - - -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/a.ts": { - "version": "7973388544-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B; foo: any;\n}\n", - "signature": "3224647069-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", - "affectsGlobalScope": false - }, - "./src/c.ts": { - "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", - "affectsGlobalScope": false - }, - "./src/b.ts": { - "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "target": 1, - "module": 1, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "./lib", - "composite": true, - "strict": true, - "esModuleInterop": true, - "alwaysStrict": true, - "rootDir": "./src", - "emitDeclarationOnly": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ] - }, - "exportedModulesMap": { - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js deleted file mode 100644 index 0e5f645761d8b..0000000000000 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ /dev/null @@ -1,94 +0,0 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --b /src --verbose -[12:08:00 AM] Projects in this build: - * src/tsconfig.json - -[12:08:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' - -[12:08:00 AM] Building project '/src/tsconfig.json'... - -[12:08:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/lib/a.d.ts] file written with same contents -//// [/src/lib/a.d.ts.map] -{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} - -//// [/src/src/a.ts] -export class B { prop = "hello"; } - -class C { } -export interface A { - b: B; -} - - -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/a.ts": { - "version": "6651905050-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B;\n}\n", - "signature": "-14608980923-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", - "affectsGlobalScope": false - }, - "./src/c.ts": { - "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", - "affectsGlobalScope": false - }, - "./src/b.ts": { - "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "target": 1, - "module": 1, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "./lib", - "composite": true, - "strict": true, - "esModuleInterop": true, - "alwaysStrict": true, - "rootDir": "./src", - "emitDeclarationOnly": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ] - }, - "exportedModulesMap": { - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js index 1f386297fa0a1..bdd01d10a9ac4 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -1,4 +1,74 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; +} + + +//// [/src/src/b.ts] +import { C } from "./c"; + +export interface B { + b: C; +} + + +//// [/src/src/c.ts] +import { A } from "./a"; + +export interface C { + a: A; +} + + +//// [/src/src/index.ts] +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, /* Enable incremental compilation */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + "outDir": "./lib", /* Redirect output structure to the directory. */ + "composite": true, /* Enable project compilation */ + "strict": true, /* Enable all strict type-checking options. */ + + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true + } +} + + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +78,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] import { B } from "./b"; export interface A { @@ -138,3 +208,135 @@ export { C } from "./c"; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; foo: any; +} + + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/lib/a.d.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} +//# sourceMappingURL=a.d.ts.map + +//// [/src/lib/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAChB"} + +//// [/src/lib/b.d.ts] file written with same contents +//// [/src/lib/b.d.ts.map] file written with same contents +//// [/src/lib/c.d.ts] file written with same contents +//// [/src/lib/c.d.ts.map] file written with same contents +//// [/src/lib/index.d.ts] file written with same contents +//// [/src/lib/index.d.ts.map] file written with same contents +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/c.ts": { + "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", + "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", + "affectsGlobalScope": false + }, + "./src/b.ts": { + "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", + "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", + "affectsGlobalScope": false + }, + "./src/a.ts": { + "version": "-14761736732-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}\n", + "signature": "-11119001497-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", + "affectsGlobalScope": false + }, + "./src/index.ts": { + "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "signature": "14762544269-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "target": 1, + "module": 1, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "exportedModulesMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/a.ts", + "./src/b.ts", + "./src/c.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js index 69c8b3b3879a1..e9f89ff381603 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -1,4 +1,74 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; +} + + +//// [/src/src/b.ts] +import { C } from "./c"; + +export interface B { + b: C; +} + + +//// [/src/src/c.ts] +import { A } from "./a"; + +export interface C { + a: A; +} + + +//// [/src/src/index.ts] +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, /* Enable incremental compilation */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + "outDir": "./lib", /* Redirect output structure to the directory. */ + "composite": true, /* Enable project compilation */ + "strict": true, /* Enable all strict type-checking options. */ + + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true + } +} + + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +78,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] import { B } from "./b"; export interface A { @@ -37,28 +107,131 @@ export { B } from "./b"; export { C } from "./c"; -//// [/src/tsconfig.json] +//// [/src/tsconfig.tsbuildinfo] { - "compilerOptions": { - "incremental": true, /* Enable incremental compilation */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - /* Generates a sourcemap for each corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - "outDir": "./lib", /* Redirect output structure to the directory. */ - "composite": true, /* Enable project compilation */ - "strict": true, /* Enable all strict type-checking options. */ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/c.ts": { + "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", + "signature": "-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/b.ts": { + "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", + "signature": "20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/a.ts": { + "version": "-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n", + "signature": "-4206296467-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/index.ts": { + "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "signature": "-6009477228-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "target": 1, + "module": 1, + "declaration": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "exportedModulesMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/a.ts", + "./src/b.ts", + "./src/c.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-changes +Input:: +//// [/src/src/a.ts] +import { B } from "./b"; - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - - "alwaysStrict": true, - "rootDir": "src", - "emitDeclarationOnly": true - } +export interface A { + b: B; foo: any; } + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/lib/a.d.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} + + +//// [/src/lib/b.d.ts] file written with same contents +//// [/src/lib/c.d.ts] file written with same contents +//// [/src/lib/index.d.ts] file written with same contents //// [/src/tsconfig.tsbuildinfo] { "program": { @@ -79,8 +252,8 @@ export { C } from "./c"; "affectsGlobalScope": false }, "./src/a.ts": { - "version": "-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n", - "signature": "-4206296467-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n}\r\n", + "version": "-14761736732-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}\n", + "signature": "-7639584379-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n", "affectsGlobalScope": false }, "./src/index.ts": { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js index 2f3704424a002..e779646d81116 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -1,4 +1,68 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/a.ts] +export class B { prop = "hello"; } + +export interface A { + b: B; +} + + +//// [/src/src/b.ts] +import { C } from "./c"; + +export interface B { + b: C; +} + + +//// [/src/src/c.ts] +import { A } from "./a"; + +export interface C { + a: A; +} + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, /* Enable incremental compilation */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + "outDir": "./lib", /* Redirect output structure to the directory. */ + "composite": true, /* Enable project compilation */ + "strict": true, /* Enable all strict type-checking options. */ + + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true + } +} + + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +72,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] export declare class B { prop: string; @@ -42,15 +106,106 @@ export interface C { //// [/src/lib/c.d.ts.map] {"version":3,"file":"c.d.ts","sourceRoot":"","sources":["../src/c.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} -//// [/src/src/index.ts] unlink +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/a.ts": { + "version": "11179224639-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}\n", + "signature": "-14608980923-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", + "affectsGlobalScope": false + }, + "./src/c.ts": { + "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", + "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", + "affectsGlobalScope": false + }, + "./src/b.ts": { + "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", + "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "target": 1, + "module": 1, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "exportedModulesMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-doesnt-change +Input:: //// [/src/src/a.ts] export class B { prop = "hello"; } +class C { } export interface A { b: B; } + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/lib/a.d.ts] file written with same contents +//// [/src/lib/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} + //// [/src/tsconfig.tsbuildinfo] { "program": { @@ -61,7 +216,7 @@ export interface A { "affectsGlobalScope": true }, "./src/a.ts": { - "version": "11179224639-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}\n", + "version": "6651905050-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B;\n}\n", "signature": "-14608980923-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", "affectsGlobalScope": false }, @@ -118,3 +273,114 @@ export interface A { "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/src/a.ts] +export class B { prop = "hello"; } + +class C { } +export interface A { + b: B; foo: any; +} + + + + +Output:: +/lib/tsc --b /src --verbose +[12:07:00 AM] Projects in this build: + * src/tsconfig.json + +[12:07:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' + +[12:07:00 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/lib/a.d.ts] +export declare class B { + prop: string; +} +export interface A { + b: B; + foo: any; +} +//# sourceMappingURL=a.d.ts.map + +//// [/src/lib/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAChB"} + +//// [/src/lib/b.d.ts] file written with same contents +//// [/src/lib/b.d.ts.map] file written with same contents +//// [/src/lib/c.d.ts] file written with same contents +//// [/src/lib/c.d.ts.map] file written with same contents +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/a.ts": { + "version": "5380514971-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B; foo: any;\n}\n", + "signature": "3224647069-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", + "affectsGlobalScope": false + }, + "./src/c.ts": { + "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", + "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", + "affectsGlobalScope": false + }, + "./src/b.ts": { + "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", + "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "target": 1, + "module": 1, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "exportedModulesMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/emptyFiles/initial-build/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js b/tests/baselines/reference/tsbuild/emptyFiles/initial-build/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js index 614c5b8cb4a02..a249f7d2e4ff3 100644 --- a/tests/baselines/reference/tsbuild/emptyFiles/initial-build/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js +++ b/tests/baselines/reference/tsbuild/emptyFiles/initial-build/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js @@ -1,8 +1,59 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/with-references -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/index.ts] +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/no-references/tsconfig.json] + +//// [/src/with-references/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + ], + "files": [], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + + + + +Output:: +/lib/tsc --b /src/with-references +exitCode:: ExitStatus.Success + + //// [/src/core/index.d.ts] export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map diff --git a/tests/baselines/reference/tsbuild/emptyFiles/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js b/tests/baselines/reference/tsbuild/emptyFiles/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js index 5d5d7be53949f..12eee2bc1e7c9 100644 --- a/tests/baselines/reference/tsbuild/emptyFiles/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js +++ b/tests/baselines/reference/tsbuild/emptyFiles/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js @@ -1,4 +1,32 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/core/index.ts] + + +//// [/src/core/tsconfig.json] + + +//// [/src/no-references/tsconfig.json] +{ + "references": [], + "files": [], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + + +//// [/src/with-references/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/no-references src/no-references/tsconfig.json:3:14 - error TS18002: The 'files' list in config file '/src/no-references/tsconfig.json' is empty. @@ -9,5 +37,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/initial-build/test-exit-code.js b/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/initial-build/test-exit-code.js index 96d503b040789..2a7d6272ff3ec 100644 --- a/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/initial-build/test-exit-code.js +++ b/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/initial-build/test-exit-code.js @@ -1,4 +1,10 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + + + +Output:: /lib/tsc -b bogus.json error TS5083: Cannot read file '/bogus.json'. @@ -6,5 +12,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js deleted file mode 100644 index b4c446d96703f..0000000000000 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js +++ /dev/null @@ -1,116 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/bar.ts] -interface RawAction { - (...args: any[]): Promise | void; -} -interface ActionFactory { - (target: T): T; -} -declare function foo(): ActionFactory; -export default foo()(function foobar(): void { -}); - -//// [/src/obj/bar.d.ts] -declare const _default: () => void; -export default _default; - - -//// [/src/obj/bar.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = foo()(function foobar() { -}); - - -//// [/src/obj/index.d.ts] -import { LazyAction } from './bundling'; -export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; - - -//// [/src/obj/lazyIndex.d.ts] file written with same contents -//// [/src/obj/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../bar.ts": { - "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", - "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", - "affectsGlobalScope": false - }, - "../bundling.ts": { - "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", - "affectsGlobalScope": false - }, - "../global.d.ts": { - "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", - "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", - "affectsGlobalScope": true - }, - "../lazyindex.ts": { - "version": "-6956449754-export { default as bar } from './bar';\n", - "signature": "-6224542381-export { default as bar } from './bar';\r\n", - "affectsGlobalScope": false - }, - "../index.ts": { - "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "target": 1, - "declaration": true, - "outDir": "./", - "incremental": true, - "isolatedModules": true, - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../index.ts": [ - "../bundling.ts", - "../lazyindex.ts" - ], - "../lazyindex.ts": [ - "../bar.ts" - ] - }, - "exportedModulesMap": { - "../index.ts": [ - "../bundling.ts", - "../lazyindex.ts" - ], - "../lazyindex.ts": [ - "../bar.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../bar.ts", - "../bundling.ts", - "../global.d.ts", - "../index.ts", - "../lazyindex.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js deleted file mode 100644 index b855f9cea594b..0000000000000 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js +++ /dev/null @@ -1,116 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/bar.ts] -interface RawAction { - (...args: any[]): Promise | void; -} -interface ActionFactory { - (target: T): T; -} -declare function foo(): ActionFactory; -export default foo()(function foobar(): void { -}); - -//// [/src/obj/bar.d.ts] -declare const _default: () => void; -export default _default; - - -//// [/src/obj/bar.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = foo()(function foobar() { -}); - - -//// [/src/obj/index.d.ts] -import { LazyAction } from './bundling'; -export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; - - -//// [/src/obj/lazyIndex.d.ts] file written with same contents -//// [/src/obj/lazyIndex.js] file written with same contents -//// [/src/obj/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../bar.ts": { - "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", - "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", - "affectsGlobalScope": false - }, - "../bundling.ts": { - "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", - "affectsGlobalScope": false - }, - "../global.d.ts": { - "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", - "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", - "affectsGlobalScope": true - }, - "../lazyindex.ts": { - "version": "-6956449754-export { default as bar } from './bar';\n", - "signature": "-6224542381-export { default as bar } from './bar';\r\n", - "affectsGlobalScope": false - }, - "../index.ts": { - "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "target": 1, - "declaration": true, - "outDir": "./", - "incremental": true, - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../index.ts": [ - "../bundling.ts", - "../lazyindex.ts" - ], - "../lazyindex.ts": [ - "../bar.ts" - ] - }, - "exportedModulesMap": { - "../index.ts": [ - "../bundling.ts", - "../lazyindex.ts" - ], - "../lazyindex.ts": [ - "../bar.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../bar.ts", - "../bundling.ts", - "../global.d.ts", - "../index.ts", - "../lazyindex.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js deleted file mode 100644 index 6b72fb26bc76e..0000000000000 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ /dev/null @@ -1,31 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -src/lazyIndex.ts:4:5 - error TS2554: Expected 0 arguments, but got 1. - -4 bar("hello"); -   ~~~~~~~ - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - -//// [/src/bar.ts] -interface RawAction { - (...args: any[]): Promise | void; -} -interface ActionFactory { - (target: T): T; -} -declare function foo(): ActionFactory; -export default foo()(function foobar(): void { -}); - diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js index b5cbfb4bb7429..2dba5700c2f17 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js @@ -1,4 +1,76 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); + +//// [/src/bundling.ts] +export class LazyModule { + constructor(private importCallback: () => Promise) {} +} + +export class LazyAction< + TAction extends (...args: any[]) => any, + TModule +> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) { + } +} + + +//// [/src/global.d.ts] +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} + +//// [/src/index.ts] +import { LazyAction, LazyModule } from './bundling'; +const lazyModule = new LazyModule(() => + import('./lazyIndex') +); +export const lazyBar = new LazyAction(lazyModule, m => m.bar); + +//// [/src/lazyIndex.ts] +export { default as bar } from './bar'; + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true, "isolatedModules": true + } +} + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +80,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/obj/bar.d.ts] declare const _default: (param: string) => void; export default _default; @@ -151,13 +223,125 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret "version": "FakeTSVersion" } -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "declaration": true, - "outDir": "obj", - "incremental": true, "isolatedModules": true - } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/obj/bar.d.ts] +declare const _default: () => void; +export default _default; + + +//// [/src/obj/bar.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + + +//// [/src/obj/index.d.ts] +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + + +//// [/src/obj/lazyIndex.d.ts] file written with same contents +//// [/src/obj/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../bar.ts": { + "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", + "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", + "affectsGlobalScope": false + }, + "../bundling.ts": { + "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", + "affectsGlobalScope": false + }, + "../global.d.ts": { + "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "affectsGlobalScope": true + }, + "../lazyindex.ts": { + "version": "-6956449754-export { default as bar } from './bar';\n", + "signature": "-6224542381-export { default as bar } from './bar';\r\n", + "affectsGlobalScope": false + }, + "../index.ts": { + "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "target": 1, + "declaration": true, + "outDir": "./", + "incremental": true, + "isolatedModules": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "exportedModulesMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../index.ts", + "../lazyindex.ts" + ] + }, + "version": "FakeTSVersion" } diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js index da6fb71f58d45..e2dfbce4ab8d2 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js @@ -1,4 +1,76 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); + +//// [/src/bundling.ts] +export class LazyModule { + constructor(private importCallback: () => Promise) {} +} + +export class LazyAction< + TAction extends (...args: any[]) => any, + TModule +> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) { + } +} + + +//// [/src/global.d.ts] +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} + +//// [/src/index.ts] +import { LazyAction, LazyModule } from './bundling'; +const lazyModule = new LazyModule(() => + import('./lazyIndex') +); +export const lazyBar = new LazyAction(lazyModule, m => m.bar); + +//// [/src/lazyIndex.ts] +export { default as bar } from './bar'; + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true + } +} + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +80,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/obj/bar.d.ts] declare const _default: (param: string) => void; export default _default; @@ -150,3 +222,125 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/obj/bar.d.ts] +declare const _default: () => void; +export default _default; + + +//// [/src/obj/bar.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + + +//// [/src/obj/index.d.ts] +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + + +//// [/src/obj/lazyIndex.d.ts] file written with same contents +//// [/src/obj/lazyIndex.js] file written with same contents +//// [/src/obj/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../bar.ts": { + "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", + "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", + "affectsGlobalScope": false + }, + "../bundling.ts": { + "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", + "affectsGlobalScope": false + }, + "../global.d.ts": { + "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "affectsGlobalScope": true + }, + "../lazyindex.ts": { + "version": "-6956449754-export { default as bar } from './bar';\n", + "signature": "-6224542381-export { default as bar } from './bar';\r\n", + "affectsGlobalScope": false + }, + "../index.ts": { + "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "target": 1, + "declaration": true, + "outDir": "./", + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "exportedModulesMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../index.ts", + "../lazyindex.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js index 6c8e247f4e723..abc2adbd836a1 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -1,14 +1,58 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: - * src/tsconfig.json +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); -[12:01:00 AM] Building project '/src/tsconfig.json'... +//// [/src/bundling.ts] +export class LazyModule { + constructor(private importCallback: () => Promise) {} +} -exitCode:: ExitStatus.Success +export class LazyAction< + TAction extends (...args: any[]) => any, + TModule +> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) { + } +} + + +//// [/src/global.d.ts] +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} +//// [/src/index.ts] +import { LazyAction, LazyModule } from './bundling'; +const lazyModule = new LazyModule(() => + import('./lazyIndex') +); +export const lazyBar = new LazyAction(lazyModule, m => m.bar); //// [/src/lazyIndex.ts] export { default as bar } from './bar'; @@ -16,6 +60,30 @@ export { default as bar } from './bar'; import { default as bar } from './bar'; bar("hello"); +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true, "isolatedModules": true + } +} + + + +Output:: +/lib/tsc --b /src --verbose +[12:01:00 AM] Projects in this build: + * src/tsconfig.json + +[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist + +[12:01:00 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + //// [/src/obj/bar.d.ts] declare const _default: (param: string) => void; export default _default; @@ -159,13 +227,40 @@ bar_2.default("hello"); "version": "FakeTSVersion" } -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "declaration": true, - "outDir": "obj", - "incremental": true, "isolatedModules": true - } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; } +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +src/lazyIndex.ts:4:5 - error TS2554: Expected 0 arguments, but got 1. + +4 bar("hello"); +   ~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js deleted file mode 100644 index 41f3786c4108c..0000000000000 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js +++ /dev/null @@ -1,254 +0,0 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success - - -//// [/src/sub-project/index.js] -/** - * @typedef {Nominal} MyNominal - */ -const c = /** @type {*} */(undefined); - - -//// [/src/sub-project/sub-project.d.ts] file written with same contents -//// [/src/sub-project/sub-project.js] -/** - * @template T, Name - * @typedef {T & {[Symbol.species]: Name}} Nominal - */ -/** - * @typedef {Nominal} MyNominal - */ -var c = /** @type {*} */ (undefined); - - -//// [/src/sub-project/sub-project.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "..", - "sourceFiles": [ - "./index.js" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 84, - "kind": "prepend", - "data": "../common/common.js", - "texts": [ - { - "pos": 0, - "end": 84, - "kind": "text" - } - ] - }, - { - "pos": 84, - "end": 187, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 64, - "kind": "prepend", - "data": "../common/common.d.ts", - "texts": [ - { - "pos": 0, - "end": 64, - "kind": "text" - } - ] - }, - { - "pos": 64, - "end": 220, - "kind": "text" - } - ] - } - }, - "version": "FakeTSVersion" -} - -//// [/src/sub-project/sub-project.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/sub-project/sub-project.js ----------------------------------------------------------------------- -prepend: (0-84):: ../common/common.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-84) -/** - * @template T, Name - * @typedef {T & {[Symbol.species]: Name}} Nominal - */ - ----------------------------------------------------------------------- -text: (84-187) -/** - * @typedef {Nominal} MyNominal - */ -var c = /** @type {*} */ (undefined); - -====================================================================== -====================================================================== -File:: /src/sub-project/sub-project.d.ts ----------------------------------------------------------------------- -prepend: (0-64):: ../common/common.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-64) -type Nominal = T & { - [Symbol.species]: Name; -}; - ----------------------------------------------------------------------- -text: (64-220) -/** - * @typedef {Nominal} MyNominal - */ -declare const c: any; -type MyNominal = string & { - [Symbol.species]: "MyNominal"; -}; - -====================================================================== - -//// [/src/sub-project-2/sub-project-2.js] -/** - * @template T, Name - * @typedef {T & {[Symbol.species]: Name}} Nominal - */ -/** - * @typedef {Nominal} MyNominal - */ -var c = /** @type {*} */ (undefined); -var variable = { - key: /** @type {MyNominal} */ ('value') -}; -/** - * @return {keyof typeof variable} - */ -function getVar() { - return 'key'; -} - - -//// [/src/sub-project-2/sub-project-2.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "..", - "sourceFiles": [ - "./index.js" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 187, - "kind": "prepend", - "data": "../sub-project/sub-project.js", - "texts": [ - { - "pos": 0, - "end": 187, - "kind": "text" - } - ] - }, - { - "pos": 187, - "end": 343, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 220, - "kind": "prepend", - "data": "../sub-project/sub-project.d.ts", - "texts": [ - { - "pos": 0, - "end": 220, - "kind": "text" - } - ] - }, - { - "pos": 220, - "end": 377, - "kind": "text" - } - ] - } - }, - "version": "FakeTSVersion" -} - -//// [/src/sub-project-2/sub-project-2.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/sub-project-2/sub-project-2.js ----------------------------------------------------------------------- -prepend: (0-187):: ../sub-project/sub-project.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-187) -/** - * @template T, Name - * @typedef {T & {[Symbol.species]: Name}} Nominal - */ -/** - * @typedef {Nominal} MyNominal - */ -var c = /** @type {*} */ (undefined); - ----------------------------------------------------------------------- -text: (187-343) -var variable = { - key: /** @type {MyNominal} */ ('value') -}; -/** - * @return {keyof typeof variable} - */ -function getVar() { - return 'key'; -} - -====================================================================== -====================================================================== -File:: /src/sub-project-2/sub-project-2.d.ts ----------------------------------------------------------------------- -prepend: (0-220):: ../sub-project/sub-project.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-220) -type Nominal = T & { - [Symbol.species]: Name; -}; -/** - * @typedef {Nominal} MyNominal - */ -declare const c: any; -type MyNominal = string & { - [Symbol.species]: "MyNominal"; -}; - ----------------------------------------------------------------------- -text: (220-377) -/** - * @return {keyof typeof variable} - */ -declare function getVar(): keyof typeof variable; -declare namespace variable { - const key: MyNominal; -} - -====================================================================== - diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-and-emits-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-and-emits-them-correctly.js index 9b0975176237a..9be011499262a 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-and-emits-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-and-emits-them-correctly.js @@ -1,3 +1,123 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/common/nominal.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +module.exports = {}; + + +//// [/src/common/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "include": ["nominal.js"] +} + +//// [/src/sub-project/index.js] +import { Nominal } from '../common/nominal'; + +/** + * @typedef {Nominal} MyNominal + */ + + +//// [/src/sub-project/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../common" } + ], + "include": ["./index.js"] +} + +//// [/src/sub-project-2/index.js] +import { MyNominal } from '../sub-project/index'; + +const variable = { + key: /** @type {MyNominal} */('value'), +}; + +/** + * @return {keyof typeof variable} + */ +export function getVar() { + return 'key'; +} + + +//// [/src/sub-project-2/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../sub-project" } + ], + "include": ["./index.js"] +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "../lib", + "allowJs": true, + "checkJs": true, + "declaration": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" } + ], + "include": [] +} + + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/lib/common/nominal.d.ts] export type Nominal = T & { [Symbol.species]: Name; @@ -47,11 +167,6 @@ module.exports = {}; "version": "FakeTSVersion" } -//// [/lib/initial-buildOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success - - //// [/lib/sub-project/index.d.ts] export type MyNominal = string & { [Symbol.species]: "MyNominal"; diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js index 1386d22a21a80..6b7f9e60e5932 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js @@ -1,8 +1,123 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/common/index.ts] +import x = require("./obj.json"); +export = x; + + +//// [/src/common/obj.json] +{ + "val": 42 +} + +//// [/src/common/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "outDir": null, + "composite": true + }, + "include": ["index.ts", "obj.json"] +} + +//// [/src/sub-project/index.js] +import mod from '../common'; + +export const m = mod; + + +//// [/src/sub-project/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../common" } + ], + "include": ["./index.js"] +} + +//// [/src/sub-project-2/index.js] +import { m } from '../sub-project/index'; + +const variable = { + key: m, +}; + +export function getVar() { + return variable; +} + + +//// [/src/sub-project-2/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../sub-project" } + ], + "include": ["./index.js"] +} +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "../out", + "allowJs": true, + "checkJs": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "declaration": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" } + ], + "include": [] +} + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/out/sub-project/index.d.ts] export const m: { val: number; diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js index 562866d175f90..6960991ab6a91 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js @@ -1,8 +1,122 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/common/nominal.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ + + +//// [/src/common/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "common.js" + }, + "include": ["nominal.js"] +} + +//// [/src/sub-project/index.js] +/** + * @typedef {Nominal} MyNominal + */ +const c = /** @type {*} */(null); + + +//// [/src/sub-project/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "sub-project.js" + }, + "references": [ + { "path": "../common", "prepend": true } + ], + "include": ["./index.js"] +} + +//// [/src/sub-project-2/index.js] +const variable = { + key: /** @type {MyNominal} */('value'), +}; + +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} +//// [/src/sub-project-2/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "sub-project-2.js" + }, + "references": [ + { "path": "../sub-project", "prepend": true } + ], + "include": ["./index.js"] +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "allowJs": true, + "checkJs": true, + "declaration": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outFile": "src.js" + }, + "references": [ + { "path": "./sub-project", "prepend": true }, + { "path": "./sub-project-2", "prepend": true } + ], + "include": [] +} + + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/src/common/common.d.ts] type Nominal = T & { [Symbol.species]: Name; diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js index 562866d175f90..83bfb329b9aa9 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js @@ -1,8 +1,122 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/common/nominal.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ + + +//// [/src/common/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "common.js" + }, + "include": ["nominal.js"] +} + +//// [/src/sub-project/index.js] +/** + * @typedef {Nominal} MyNominal + */ +const c = /** @type {*} */(null); + + +//// [/src/sub-project/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "sub-project.js" + }, + "references": [ + { "path": "../common", "prepend": true } + ], + "include": ["./index.js"] +} + +//// [/src/sub-project-2/index.js] +const variable = { + key: /** @type {MyNominal} */('value'), +}; + +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} +//// [/src/sub-project-2/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "sub-project-2.js" + }, + "references": [ + { "path": "../sub-project", "prepend": true } + ], + "include": ["./index.js"] +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "allowJs": true, + "checkJs": true, + "declaration": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outFile": "src.js" + }, + "references": [ + { "path": "./sub-project", "prepend": true }, + { "path": "./sub-project-2", "prepend": true } + ], + "include": [] +} + + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/src/common/common.d.ts] type Nominal = T & { [Symbol.species]: Name; @@ -340,3 +454,263 @@ declare namespace variable { ====================================================================== + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/sub-project/index.js] +/** + * @typedef {Nominal} MyNominal + */ +const c = /** @type {*} */(undefined); + + + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + +//// [/src/sub-project/sub-project.d.ts] file written with same contents +//// [/src/sub-project/sub-project.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +/** + * @typedef {Nominal} MyNominal + */ +var c = /** @type {*} */ (undefined); + + +//// [/src/sub-project/sub-project.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "./index.js" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 84, + "kind": "prepend", + "data": "../common/common.js", + "texts": [ + { + "pos": 0, + "end": 84, + "kind": "text" + } + ] + }, + { + "pos": 84, + "end": 187, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 64, + "kind": "prepend", + "data": "../common/common.d.ts", + "texts": [ + { + "pos": 0, + "end": 64, + "kind": "text" + } + ] + }, + { + "pos": 64, + "end": 220, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/src/sub-project/sub-project.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/sub-project/sub-project.js +---------------------------------------------------------------------- +prepend: (0-84):: ../common/common.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-84) +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ + +---------------------------------------------------------------------- +text: (84-187) +/** + * @typedef {Nominal} MyNominal + */ +var c = /** @type {*} */ (undefined); + +====================================================================== +====================================================================== +File:: /src/sub-project/sub-project.d.ts +---------------------------------------------------------------------- +prepend: (0-64):: ../common/common.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-64) +type Nominal = T & { + [Symbol.species]: Name; +}; + +---------------------------------------------------------------------- +text: (64-220) +/** + * @typedef {Nominal} MyNominal + */ +declare const c: any; +type MyNominal = string & { + [Symbol.species]: "MyNominal"; +}; + +====================================================================== + +//// [/src/sub-project-2/sub-project-2.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +/** + * @typedef {Nominal} MyNominal + */ +var c = /** @type {*} */ (undefined); +var variable = { + key: /** @type {MyNominal} */ ('value') +}; +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} + + +//// [/src/sub-project-2/sub-project-2.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "./index.js" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 187, + "kind": "prepend", + "data": "../sub-project/sub-project.js", + "texts": [ + { + "pos": 0, + "end": 187, + "kind": "text" + } + ] + }, + { + "pos": 187, + "end": 343, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 220, + "kind": "prepend", + "data": "../sub-project/sub-project.d.ts", + "texts": [ + { + "pos": 0, + "end": 220, + "kind": "text" + } + ] + }, + { + "pos": 220, + "end": 377, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/src/sub-project-2/sub-project-2.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/sub-project-2/sub-project-2.js +---------------------------------------------------------------------- +prepend: (0-187):: ../sub-project/sub-project.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-187) +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +/** + * @typedef {Nominal} MyNominal + */ +var c = /** @type {*} */ (undefined); + +---------------------------------------------------------------------- +text: (187-343) +var variable = { + key: /** @type {MyNominal} */ ('value') +}; +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} + +====================================================================== +====================================================================== +File:: /src/sub-project-2/sub-project-2.d.ts +---------------------------------------------------------------------- +prepend: (0-220):: ../sub-project/sub-project.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-220) +type Nominal = T & { + [Symbol.species]: Name; +}; +/** + * @typedef {Nominal} MyNominal + */ +declare const c: any; +type MyNominal = string & { + [Symbol.species]: "MyNominal"; +}; + +---------------------------------------------------------------------- +text: (220-377) +/** + * @return {keyof typeof variable} + */ +declare function getVar(): keyof typeof variable; +declare namespace variable { + const key: MyNominal; +} + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js b/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js deleted file mode 100644 index 93648fb156333..0000000000000 --- a/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js +++ /dev/null @@ -1,83 +0,0 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --b /src/tsconfig.json --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/src/hkt.js' is older than newest input 'src/src/main.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/src/main.js] -"use strict"; -exports.__esModule = true; -var sym = Symbol(); - - -//// [/src/src/main.ts] -import { HKT } from "./hkt"; - -const sym = Symbol(); - -declare module "./hkt" { - interface HKT { - [sym]: { a: T } - } -} - -type A = HKT[typeof sym]; - -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/globals.d.ts": { - "version": "-1994196675-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", - "signature": "-1994196675-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", - "affectsGlobalScope": true - }, - "./src/hkt.ts": { - "version": "675797797-export interface HKT { }", - "signature": "2373810515-export interface HKT {\r\n}\r\n", - "affectsGlobalScope": false - }, - "./src/main.ts": { - "version": "-27494779858-import { HKT } from \"./hkt\";\r\n\r\nconst sym = Symbol();\r\n\r\ndeclare module \"./hkt\" {\r\n interface HKT {\r\n [sym]: { a: T }\r\n }\r\n}\r\n\r\ntype A = HKT[typeof sym];", - "signature": "-7779857705-declare const sym: unique symbol;\r\ndeclare module \"./hkt\" {\r\n interface HKT {\r\n [sym]: {\r\n a: T;\r\n };\r\n }\r\n}\r\nexport {};\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "rootDir": "./src", - "incremental": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/main.ts": [ - "./src/hkt.ts" - ] - }, - "exportedModulesMap": { - "./src/main.ts": [ - "./src/hkt.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/globals.d.ts", - "./src/hkt.ts", - "./src/main.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js b/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js index 3661e23425ef7..d5bd2b0c8d7c3 100644 --- a/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js +++ b/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js @@ -1,4 +1,52 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/globals.d.ts] +interface SymbolConstructor { + (description?: string | number): symbol; +} +declare var Symbol: SymbolConstructor; + +//// [/src/src/hkt.ts] +export interface HKT { } + +//// [/src/src/main.ts] +import { HKT } from "./hkt"; + +const sym = Symbol(); + +declare module "./hkt" { + interface HKT { + [sym]: { a: T } + } +} +const x = 10; +type A = HKT[typeof sym]; + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "rootDir": "src", + "incremental": true + } +} + + + +Output:: /lib/tsc --b /src/tsconfig.json --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +56,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/src/hkt.js] "use strict"; exports.__esModule = true; @@ -72,3 +120,92 @@ var x = 10; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/src/main.ts] +import { HKT } from "./hkt"; + +const sym = Symbol(); + +declare module "./hkt" { + interface HKT { + [sym]: { a: T } + } +} + +type A = HKT[typeof sym]; + + + +Output:: +/lib/tsc --b /src/tsconfig.json --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/src/hkt.js' is older than newest input 'src/src/main.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/src/main.js] +"use strict"; +exports.__esModule = true; +var sym = Symbol(); + + +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/globals.d.ts": { + "version": "-1994196675-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "signature": "-1994196675-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "affectsGlobalScope": true + }, + "./src/hkt.ts": { + "version": "675797797-export interface HKT { }", + "signature": "2373810515-export interface HKT {\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/main.ts": { + "version": "-27494779858-import { HKT } from \"./hkt\";\r\n\r\nconst sym = Symbol();\r\n\r\ndeclare module \"./hkt\" {\r\n interface HKT {\r\n [sym]: { a: T }\r\n }\r\n}\r\n\r\ntype A = HKT[typeof sym];", + "signature": "-7779857705-declare const sym: unique symbol;\r\ndeclare module \"./hkt\" {\r\n interface HKT {\r\n [sym]: {\r\n a: T;\r\n };\r\n }\r\n}\r\nexport {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "rootDir": "./src", + "incremental": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/main.ts": [ + "./src/hkt.ts" + ] + }, + "exportedModulesMap": { + "./src/main.ts": [ + "./src/hkt.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/globals.d.ts", + "./src/hkt.ts", + "./src/main.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-resolve-correctly.js index b9c4252df0055..bab2eab97b46a 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-resolve-correctly.js @@ -1,4 +1,120 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/solution/common/nominal.ts] +export declare type Nominal = T & { + [Symbol.species]: Name; +}; + + +//// [/src/solution/common/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "include": ["nominal.ts"] +} + +//// [/src/solution/sub-project/index.ts] +import { Nominal } from '../common/nominal'; + +export type MyNominal = Nominal; + + +//// [/src/solution/sub-project/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../common" } + ], + "include": ["./index.ts"] +} + +//// [/src/solution/sub-project-2/index.ts] +import { MyNominal } from '../sub-project/index'; + +const variable = { + key: 'value' as MyNominal, +}; + +export function getVar(): keyof typeof variable { + return 'key'; +} + + +//// [/src/solution/sub-project-2/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../sub-project" } + ], + "include": ["./index.ts"] +} + +//// [/src/solution/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" } + ], + "include": [] +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "lib", + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./solution" } + ], + "include": [] + } + + + +Output:: /lib/tsc -b /src --verbose [12:00:00 AM] Projects in this build: * src/solution/common/tsconfig.json @@ -20,8 +136,8 @@ [12:00:00 AM] Building project '/src/solution/sub-project-2/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/solution/common/nominal.d.ts] export declare type Nominal = T & { [Symbol.species]: Name; diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js deleted file mode 100644 index 4ad74c07000bb..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig.json -src/src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - - src/src/main.ts:2:11 - 2 const a = { -    ~ - The parser expected to find a '}' to match the '{' token here. - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..091e9d94ba8bb --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js @@ -0,0 +1,201 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: Fix error +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js new file mode 100644 index 0000000000000..28638f81468e1 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js @@ -0,0 +1,154 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: Fix error +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..0999c10855235 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js @@ -0,0 +1,209 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + + + +Change:: Fix error +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js new file mode 100644 index 0000000000000..0bac27e919f51 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js @@ -0,0 +1,162 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + + + +Change:: Fix error +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js b/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js index 619b5b5465621..0c604bb21b384 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js @@ -1,8 +1,140 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/third --clean -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/2/second-output.d.ts] + + +//// [/src/2/second-output.d.ts.map] + + +//// [/src/2/second-output.js] + + +//// [/src/2/second-output.js.map] + + +//// [/src/2/second-output.tsbuildinfo] + + +//// [/src/first/bin/first-output.d.ts] + + +//// [/src/first/bin/first-output.d.ts.map] + + +//// [/src/first/bin/first-output.js] + + +//// [/src/first/bin/first-output.js.map] + + +//// [/src/first/bin/first-output.tsbuildinfo] + + +//// [/src/first/first_PART1.ts] + + +//// [/src/first/first_part2.ts] + + +//// [/src/first/first_part3.ts] +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] + + +//// [/src/second/second_part2.ts] + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/thirdjs/output/third-output.d.ts] + + +//// [/src/third/thirdjs/output/third-output.d.ts.map] + + +//// [/src/third/thirdjs/output/third-output.js] + + +//// [/src/third/thirdjs/output/third-output.js.map] + + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] + + +//// [/src/third/third_part1.ts] + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: +/lib/tsc --b /src/third --clean +exitCode:: ExitStatus.Success + + //// [/src/2/second-output.d.ts] unlink //// [/src/2/second-output.d.ts.map] unlink //// [/src/2/second-output.js] unlink @@ -18,3 +150,14 @@ exitCode:: ExitStatus.Success //// [/src/third/thirdjs/output/third-output.js] unlink //// [/src/third/thirdjs/output/third-output.js.map] unlink //// [/src/third/thirdjs/output/third-output.tsbuildinfo] unlink + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/third --clean +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js b/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js index a63b0b971f3ce..aa3a94fa1cbf7 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, "module": "none", + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, "module": "none", + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, "module": "none", + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first" }, + { "path": "../second" }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/first_PART1.d.ts] interface TheFirst { none: any; @@ -70,28 +201,6 @@ function f() { //// [/src/first/first_part3.js.map] {"version":3,"file":"first_part3.js","sourceRoot":"","sources":["first_part3.ts"],"names":[],"mappings":"AAAA,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC"} -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, "module": "none", - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - //// [/src/first/tsconfig.tsbuildinfo] { "program": { @@ -184,24 +293,6 @@ var C = (function () { //// [/src/second/second_part2.js.map] {"version":3,"file":"second_part2.js","sourceRoot":"","sources":["second_part2.ts"],"names":[],"mappings":"AAAA;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, "module": "none", - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/second/tsconfig.tsbuildinfo] { "program": { @@ -258,29 +349,6 @@ c.doSomething(); //// [/src/third/third_part1.js.map] {"version":3,"file":"third_part1.js","sourceRoot":"","sources":["third_part1.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, "module": "none", - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first" }, - { "path": "../second" }, - ] -} - - //// [/src/third/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js b/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js index 71fd3e3fe5f52..e1227348f0c87 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -256,26 +387,3 @@ c.doSomething(); //// [/src/third/thirdjs/output/third-output.js.map] {"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;ACED,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;ACJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js b/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js index 101b6835a66b8..8c2acb2f7d5d2 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js @@ -1,4 +1,333 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/2/second-output.d.ts] +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} +//# sourceMappingURL=second-output.d.ts.map + +//// [/src/2/second-output.d.ts.map] +{"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd"} + +//// [/src/2/second-output.js] +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +//# sourceMappingURL=second-output.js.map + +//// [/src/2/second-output.js.map] +{"version":3,"file":"second-output.js","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAIA,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} + +//// [/src/2/second-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "../second", + "sourceFiles": [ + "../second/second_part1.ts", + "../second/second_part2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 285, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 100, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/src/first/bin/first-output.d.ts] +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +//# sourceMappingURL=first-output.d.ts.map + +//// [/src/first/bin/first-output.d.ts.map] + + +//// [/src/first/bin/first-output.js] + + +//// [/src/first/bin/first-output.js.map] + + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] + + +//// [/src/second/second_part2.ts] + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/thirdjs/output/third-output.d.ts] +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} +declare var c: C; +//# sourceMappingURL=third-output.d.ts.map + +//// [/src/third/thirdjs/output/third-output.d.ts.map] +{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} + +//// [/src/third/thirdjs/output/third-output.js] +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +var c = new C(); +c.doSomething(); +//# sourceMappingURL=third-output.js.map + +//// [/src/third/thirdjs/output/third-output.js.map] +{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;ACED,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;ACJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "../..", + "sourceFiles": [ + "../../third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "../../../first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 395, + "kind": "prepend", + "data": "../../../2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 395, + "kind": "text" + } + ] + }, + { + "pos": 395, + "end": 431, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "../../../first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "../../../2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/src/third/third_part1.ts] + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,13 +347,43 @@ [12:00:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.js] file written with same contents //// [/src/first/bin/first-output.js.map] file written with same contents -//// [/src/first/bin/first-output.tsbuildinfo] file written with same contents +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "../first_PART1.ts", + "../first_part2.ts", + "../first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + //// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== File:: /src/first/bin/first-output.js diff --git a/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js b/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js deleted file mode 100644 index e9007f59a9bf1..0000000000000 --- a/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --b /src/third --clean -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/baseline-sectioned-sourcemaps.js index f325ef7008a6f..5548636885833 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/baseline-sectioned-sourcemaps.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +52,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -396,20 +413,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/emitHelpers-in-all-projects.js index 5eabef2db8069..eb1b8fb117809 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/emitHelpers-in-all-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +54,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -570,22 +589,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/multiple-prologues-in-all-projects.js index 9185f9ac0e2ac..95ac0b8bfd263 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/multiple-prologues-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +53,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -459,21 +477,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/shebang-in-all-projects.js index 5f2c9410a2ed0..639edc231612c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/shebang-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +#!someshebang first first_PART1 +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +53,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] #!someshebang first first_PART1 interface TheFirst { @@ -403,21 +421,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -#!someshebang first first_PART1 -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang first first_PART1 interface TheFirst { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/strict-in-all-projects.js index 83bb109249d97..b8b28d2725002 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/strict-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +52,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -426,20 +443,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal-when-one-two-three-are-prepended-in-order.js index e2c254da707b6..7fe09ee9e3445 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -39,8 +56,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -3280,20 +3297,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hola, world"; interface NoJsForHereEither { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal.js index 8a7c483b3df46..3e7036f487431 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +52,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -403,20 +420,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hola, world"; interface NoJsForHereEither { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/triple-slash-refs-in-all-projects.js index e98afcd7bf013..865dbb68c1dc4 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/triple-slash-refs-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +55,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] /// interface TheFirst { @@ -467,20 +484,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] /// /// diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/baseline-sectioned-sourcemaps.js index 9d1086253f086..79c0d10aa9f01 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/baseline-sectioned-sourcemaps.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -290,20 +307,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-all-projects.js index c458b4d6c26ba..258ae115c35c0 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-all-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +59,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -443,22 +462,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-only-one-dependency-project.js index fcf4acba7643a..518d7f044a19f 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-only-one-dependency-project.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { }console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -288,20 +305,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { }console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js index f7393a4d6e6d8..8656390abe226 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +37,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -609,22 +628,6 @@ declare function firstfirst_part3Spread(...b: number[]): void; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-different-projects.js index 57471226054cc..496c7c571a9cc 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-different-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +37,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -421,22 +440,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js index 4cfbde10e5a6f..2a031af0472cd 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +58,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -352,21 +370,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] "use strict"; "myPrologue"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-different-projects.js index 9b82c4526ae4b..c36fadfb3dd85 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-different-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -298,20 +315,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] "use strict"; "myPrologue"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-all-projects.js index e7a673b3d9d0c..37979f999a015 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +#!someshebang first first_PART1 +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +58,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/2/second-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -294,21 +312,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -#!someshebang first first_PART1 -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] #!someshebang first first_PART1 var s = "Hello, world"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-only-one-dependency-project.js index d804a95c447e1..171d9579b2100 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-only-one-dependency-project.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -268,20 +285,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] #!someshebang second second_part1 var s = "Hello, world"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-all-projects.js index e4bcbaaab178e..b128b719b6c06 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -320,20 +337,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] "use strict"; var s = "Hello, world"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-one-dependency.js index e48734c69cce5..70b92d29f253e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-one-dependency.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -268,20 +285,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] "use strict"; var s = "Hello, world"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index 9b0d7049b4f8c..92e1b523086d0 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2306,20 +2323,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment.js index ba145a9ef7a7f..0767c3a71b080 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -275,20 +292,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index d0b67eb0aff6a..57e56038845c2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2406,20 +2423,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled.js index 1b6673e4e7304..134c1ad2a1599 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -275,20 +292,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-when-one-two-three-are-prepended-in-order.js index 5e66dbb2d5973..3a3f6c7438345 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -44,8 +61,8 @@ readFiles:: { "/src/third/thirdjs/output/third-output.js.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1, "/src/third/thirdjs/output/third-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2328,20 +2345,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 4625eada85d79..c0127ea74f0e2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2406,20 +2423,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled.js index 8fe5f69f1b64d..a701eb86ea86f 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -275,20 +292,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal.js index b3539f7ef4de2..e6dcbd14cbc63 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -297,20 +314,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js index 2aa1254929858..78f0f24504224 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -41,8 +58,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -331,20 +348,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-one-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-one-project.js index aeb73f5fabbb5..12db12bb0a354 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-one-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-one-project.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -268,20 +285,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-final-project-is-not-composite-but-uses-project-references.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-final-project-is-not-composite-but-uses-project-references.js index 73a71564615d3..da9400a26a25a 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-final-project-is-not-composite-but-uses-project-references.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-final-project-is-not-composite-but-uses-project-references.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -16,8 +33,8 @@ [12:04:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -266,20 +283,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.d.ts] file written with same contents //// [/src/third/thirdjs/output/third-output.d.ts.map] file written with same contents //// [/src/third/thirdjs/output/third-output.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-source-files-are-empty-in-the-own-file.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-source-files-are-empty-in-the-own-file.js index 39068288c814a..80402d5a3435c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-source-files-are-empty-in-the-own-file.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-source-files-are-empty-in-the-own-file.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -268,20 +285,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-all-projects.js index 0d1d7c16c3cc2..1b794cbf61085 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET"} @@ -429,20 +446,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-only-one-dependency-project.js index b0ebcadfcead4..6ac490f423654 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-only-one-dependency-project.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +37,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAE/B;AEbD,iBAAS,CAAC,WAET"} @@ -542,22 +561,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAE/B;ACbD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js index 39bd3016afe78..b643b821abf1e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK"} @@ -629,20 +646,6 @@ declare function firstfirst_part3Spread(...b: number[]): void; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACHnD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;AAED,iBAAS,wBAAwB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACNrD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-different-projects.js index 2151bb6619e09..416f702fff33b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-different-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET"} @@ -407,20 +424,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,iBAAS,wBAAwB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACZrD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js index 88b5e1c9d679f..debe24623bbc1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue5" +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +59,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAEA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AEVD,iBAAS,CAAC,WAET"} @@ -486,22 +505,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue5" -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAEA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACVD,iBAAS,CAAC,WAET;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACHD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-different-projects.js index a464c3addc444..fb7dd90b89f35 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-different-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue5" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +36,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -432,21 +450,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue5" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACLD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-all-projects.js index 3550da7cfd328..0a819de05c56b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +58,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -454,21 +472,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-one-dependency.js index 56730581e4488..b7381cb1c7394 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-one-dependency.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +36,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -412,21 +430,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index a9fa587f9ca34..acec88a3aff46 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEM,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;IACN,IAAI,CAAC,IACM,MAAM,CADK;IACtB,IAAI,CAAC,CAAC,KAAK,MAAM,EAAK;CACxC;AACD,kBAAU,OAAO,CAAC;IACC,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACtD;AACc,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC5C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -1469,20 +1486,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment.js index d1109391c2609..10f63b9eb0935 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -359,20 +376,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-when-one-two-three-are-prepended-in-order.js index a8cc6f446fcdf..dca90f7005e81 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -44,8 +61,8 @@ readFiles:: { "/src/third/thirdjs/output/third-output.js.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1, "/src/third/thirdjs/output/third-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEK,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;IACN,IAAI,CAAC,IACM,MAAM,CADK;IACtB,IAAI,CAAC,CAAC,KAAK,MAAM,EAAK;CACvC;AACD,kBAAU,OAAO,CAAC;IACA,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACrD;AACa,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC3C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -1491,20 +1508,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 6bebc8ccdf23a..b60a84801ae04 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEK,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;IACN,IAAI,CAAC,IACM,MAAM,CADK;IACtB,IAAI,CAAC,CAAC,KAAK,MAAM,EAAK;CACvC;AACD,kBAAU,OAAO,CAAC;IACA,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACrD;AACa,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC3C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -1469,20 +1486,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled.js index 91983831dbe7a..ba01c95b0602a 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -359,20 +376,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal.js index a2e37c11323bd..2509f130b7c05 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -381,20 +398,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js index 289cfde3950fb..0847f3a0a31ee 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +169,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js index f69a5b700e869..edcd6e049c397 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js @@ -1,4 +1,133 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + + "removeComments": true, + "strict": false, + + + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +147,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -872,29 +1001,3 @@ var C = (function () { }()); -//// [/src/third/third_part1.ts] - - -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - - "removeComments": true, - "strict": false, - - - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js index 339e70b555226..4071641ef473e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js @@ -1,4 +1,141 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} +function forsecondsecond_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +175,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1196,38 +1333,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} -function forsecondsecond_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2544,10 +2649,3 @@ declare function forthirdthird_part1Rest(): void; ====================================================================== -//// [/src/third/third_part1.ts] -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js index b10fa4a4954af..f44f525faccac 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js @@ -1,4 +1,137 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} +function forsecondsecond_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +151,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1041,36 +1174,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} -function forsecondsecond_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js index a8b4f0e8e0ce4..c79711d5c6a15 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,150 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} +function firstfirst_part3Spread(...b: number[]) { } +firstfirst_part3Spread(...[10, 20, 30]); + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} +function forsecondsecond_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + +function secondsecond_part2Spread(...b: number[]) { } +secondsecond_part2Spread(...[10, 20, 30]); + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} +function thirdthird_part1Spread(...b: number[]) { } +thirdthird_part1Spread(...[10, 20, 30]); + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +164,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1616,97 +1762,6 @@ declare function firstfirst_part3Spread(...b: number[]): void; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/first/first_part3.ts] -function f() { - return "JS does hoists"; -} -function firstfirst_part3Spread(...b: number[]) { } -firstfirst_part3Spread(...[10, 20, 30]); - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} -function forsecondsecond_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/second/second_part2.ts] -class C { - doSomething() { - console.log("something got done"); - } -} - -function secondsecond_part2Spread(...b: number[]) { } -secondsecond_part2Spread(...[10, 20, 30]); - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -3528,36 +3583,3 @@ declare function thirdthird_part1Spread(...b: number[]): void; ====================================================================== -//// [/src/third/third_part1.ts] -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} -function thirdthird_part1Spread(...b: number[]) { } -thirdthird_part1Spread(...[10, 20, 30]); - -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js index 763700712d5fc..a25738af1de97 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js @@ -1,4 +1,142 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +function secondsecond_part1Spread(...b: number[]) { } +secondsecond_part1Spread(...[10, 20, 30]); + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +156,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1229,57 +1367,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -function secondsecond_part1Spread(...b: number[]) { } -secondsecond_part1Spread(...[10, 20, 30]); - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2689,10 +2776,3 @@ declare function forthirdthird_part1Rest(): void; ====================================================================== -//// [/src/third/third_part1.ts] -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js index 7bbf44148287d..15c99fb44246c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js @@ -1,4 +1,140 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +"myPrologue" +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +"myPrologue2"; +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +"myPrologue3"; +"myPrologue"; +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +174,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1022,85 +1158,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -"myPrologue" -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - -//// [/src/second/second_part2.ts] -"myPrologue2"; -class C { - doSomething() { - console.log("something got done"); - } -} - - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2126,33 +2183,3 @@ declare var c: C; ====================================================================== -//// [/src/third/third_part1.ts] -"myPrologue3"; -"myPrologue"; -var c = new C(); -c.doSomething(); - - -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js index f2cd75a0ae191..b724195549b48 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js @@ -1,4 +1,137 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +"myPrologue" +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +"myPrologue2"; +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +151,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -949,52 +1082,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -"myPrologue" -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - -//// [/src/second/second_part2.ts] -"myPrologue2"; -class C { - doSomething() { - console.log("something got done"); - } -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1970,26 +2057,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js index 262b41d24b38d..2c2c0ef14e563 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js @@ -1,4 +1,139 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +#!someshebang first first_PART1 +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +#!someshebang first first_part2 +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +#!someshebang second second_part1 +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +#!someshebang third third_part1 +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +173,8 @@ readFiles:: { "/src/2/second-output.js": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] #!someshebang second second_part1 declare namespace N { @@ -863,41 +998,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -#!someshebang first first_PART1 -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/first_part2.ts] -#!someshebang first first_part2 -console.log(f()); - - -//// [/src/second/second_part1.ts] -#!someshebang second second_part1 -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang first first_PART1 interface TheFirst { @@ -1798,9 +1898,3 @@ declare var c: C; ====================================================================== -//// [/src/third/third_part1.ts] -#!someshebang third third_part1 -var c = new C(); -c.doSomething(); - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js index 8687412e9bd52..5038a130e3c30 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js @@ -1,4 +1,136 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +#!someshebang second second_part1 +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +150,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] #!someshebang second second_part1 declare namespace N { @@ -836,21 +968,6 @@ declare function f(): string; ====================================================================== -//// [/src/second/second_part1.ts] -#!someshebang second second_part1 -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang second second_part1 interface TheFirst { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js index a15ca0afbb99b..efcacf4962e47 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +169,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -910,46 +1041,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1869,26 +1960,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js index 104742266163b..3de22165d36ee 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -860,24 +991,6 @@ declare function f(): string; ====================================================================== -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js index 10a077332c44f..22dc66e618dac 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js @@ -1,4 +1,163 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +namespace ts { + /* @internal */ + /** + * Subset of properties from SourceFile that are used in multiple utility functions + */ + export interface SourceFileLike { + readonly text: string; + lineMap?: ReadonlyArray; + /* @internal */ + getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number; + } + + /* @internal */ + export interface RedirectInfo { + /** Source file this redirects to. */ + readonly redirectTarget: SourceFile; + /** + * Source file for the duplicate package. This will not be used by the Program, + * but we need to keep this around so we can watch for changes in underlying. + */ + readonly unredirected: SourceFile; + } + + // Source files are declarations when they are external modules. + export interface SourceFile { + someProp: string; + } +}interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +177,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1177,47 +1336,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -namespace ts { - /* @internal */ - /** - * Subset of properties from SourceFile that are used in multiple utility functions - */ - export interface SourceFileLike { - readonly text: string; - lineMap?: ReadonlyArray; - /* @internal */ - getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number; - } - - /* @internal */ - export interface RedirectInfo { - /** Source file this redirects to. */ - readonly redirectTarget: SourceFile; - /** - * Source file for the duplicate package. This will not be used by the Program, - * but we need to keep this around so we can watch for changes in underlying. - */ - readonly unredirected: SourceFile; - } - - // Source files are declarations when they are external modules. - export interface SourceFile { - someProp: string; - } -}interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] declare namespace ts { interface SourceFile { @@ -2226,27 +2344,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index b29a853610f87..0cbe00147124c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,162 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /**@internal*/ constructor() { } + /**@internal*/ prop: string; + /**@internal*/ method() { } + /**@internal*/ get c() { return 10; } + /**@internal*/ set c(val: number) { } +} +namespace normalN { + /**@internal*/ export class C { } + /**@internal*/ export function foo() {} + /**@internal*/ export namespace someNamespace { export class C {} } + /**@internal*/ export namespace someOther.something { export class someClass {} } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ export type internalType = internalC; + /**@internal*/ export const internalConst = 10; + /**@internal*/ export enum internalEnum { a, b, c } +} +/**@internal*/ class internalC {} +/**@internal*/ function internalfoo() {} +/**@internal*/ namespace internalNamespace { export class someClass {} } +/**@internal*/ namespace internalOther.something { export class someClass {} } +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ type internalType = internalC; +/**@internal*/ const internalConst = 10; +/**@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../first", "prepend": true } + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +176,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -3259,78 +3417,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /**@internal*/ constructor() { } - /**@internal*/ prop: string; - /**@internal*/ method() { } - /**@internal*/ get c() { return 10; } - /**@internal*/ set c(val: number) { } -} -namespace normalN { - /**@internal*/ export class C { } - /**@internal*/ export function foo() {} - /**@internal*/ export namespace someNamespace { export class C {} } - /**@internal*/ export namespace someOther.something { export class someClass {} } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ export type internalType = internalC; - /**@internal*/ export const internalConst = 10; - /**@internal*/ export enum internalEnum { a, b, c } -} -/**@internal*/ class internalC {} -/**@internal*/ function internalfoo() {} -/**@internal*/ namespace internalNamespace { export class someClass {} } -/**@internal*/ namespace internalOther.something { export class someClass {} } -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ type internalType = internalC; -/**@internal*/ const internalConst = 10; -/**@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../first", "prepend": true } - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5573,27 +5659,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js index 120b30f17626d..a5bf02c619829 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js @@ -1,4 +1,161 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /**@internal*/ constructor() { } + /**@internal*/ prop: string; + /**@internal*/ method() { } + /**@internal*/ get c() { return 10; } + /**@internal*/ set c(val: number) { } +} +namespace normalN { + /**@internal*/ export class C { } + /**@internal*/ export function foo() {} + /**@internal*/ export namespace someNamespace { export class C {} } + /**@internal*/ export namespace someOther.something { export class someClass {} } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ export type internalType = internalC; + /**@internal*/ export const internalConst = 10; + /**@internal*/ export enum internalEnum { a, b, c } +} +/**@internal*/ class internalC {} +/**@internal*/ function internalfoo() {} +/**@internal*/ namespace internalNamespace { export class someClass {} } +/**@internal*/ namespace internalOther.something { export class someClass {} } +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ type internalType = internalC; +/**@internal*/ const internalConst = 10; +/**@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +175,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -2933,59 +3090,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /**@internal*/ constructor() { } - /**@internal*/ prop: string; - /**@internal*/ method() { } - /**@internal*/ get c() { return 10; } - /**@internal*/ set c(val: number) { } -} -namespace normalN { - /**@internal*/ export class C { } - /**@internal*/ export function foo() {} - /**@internal*/ export namespace someNamespace { export class C {} } - /**@internal*/ export namespace someOther.something { export class someClass {} } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ export type internalType = internalC; - /**@internal*/ export const internalConst = 10; - /**@internal*/ export enum internalEnum { a, b, c } -} -/**@internal*/ class internalC {} -/**@internal*/ function internalfoo() {} -/**@internal*/ namespace internalNamespace { export class someClass {} } -/**@internal*/ namespace internalOther.something { export class someClass {} } -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ type internalType = internalC; -/**@internal*/ const internalConst = 10; -/**@internal*/ enum internalEnum { a, b, c } - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5264,27 +5368,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 338777d51e5ed..826b0f65121d6 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,162 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /**@internal*/ constructor() { } + /**@internal*/ prop: string; + /**@internal*/ method() { } + /**@internal*/ get c() { return 10; } + /**@internal*/ set c(val: number) { } +} +namespace normalN { + /**@internal*/ export class C { } + /**@internal*/ export function foo() {} + /**@internal*/ export namespace someNamespace { export class C {} } + /**@internal*/ export namespace someOther.something { export class someClass {} } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ export type internalType = internalC; + /**@internal*/ export const internalConst = 10; + /**@internal*/ export enum internalEnum { a, b, c } +} +/**@internal*/ class internalC {} +/**@internal*/ function internalfoo() {} +/**@internal*/ namespace internalNamespace { export class someClass {} } +/**@internal*/ namespace internalOther.something { export class someClass {} } +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ type internalType = internalC; +/**@internal*/ const internalConst = 10; +/**@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../first", "prepend": true } + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +176,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] /**@internal*/ interface TheFirst { none: any; @@ -3501,100 +3659,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /**@internal*/ constructor() { } - /**@internal*/ prop: string; - /**@internal*/ method() { } - /**@internal*/ get c() { return 10; } - /**@internal*/ set c(val: number) { } -} -namespace normalN { - /**@internal*/ export class C { } - /**@internal*/ export function foo() {} - /**@internal*/ export namespace someNamespace { export class C {} } - /**@internal*/ export namespace someOther.something { export class someClass {} } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ export type internalType = internalC; - /**@internal*/ export const internalConst = 10; - /**@internal*/ export enum internalEnum { a, b, c } -} -/**@internal*/ class internalC {} -/**@internal*/ function internalfoo() {} -/**@internal*/ namespace internalNamespace { export class someClass {} } -/**@internal*/ namespace internalOther.something { export class someClass {} } -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ type internalType = internalC; -/**@internal*/ const internalConst = 10; -/**@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../first", "prepend": true } - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5937,27 +6001,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js index 0b266514ac806..93f781c02b9f8 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js @@ -1,4 +1,161 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /**@internal*/ constructor() { } + /**@internal*/ prop: string; + /**@internal*/ method() { } + /**@internal*/ get c() { return 10; } + /**@internal*/ set c(val: number) { } +} +namespace normalN { + /**@internal*/ export class C { } + /**@internal*/ export function foo() {} + /**@internal*/ export namespace someNamespace { export class C {} } + /**@internal*/ export namespace someOther.something { export class someClass {} } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ export type internalType = internalC; + /**@internal*/ export const internalConst = 10; + /**@internal*/ export enum internalEnum { a, b, c } +} +/**@internal*/ class internalC {} +/**@internal*/ function internalfoo() {} +/**@internal*/ namespace internalNamespace { export class someClass {} } +/**@internal*/ namespace internalOther.something { export class someClass {} } +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ type internalType = internalC; +/**@internal*/ const internalConst = 10; +/**@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +175,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -3169,99 +3326,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /**@internal*/ constructor() { } - /**@internal*/ prop: string; - /**@internal*/ method() { } - /**@internal*/ get c() { return 10; } - /**@internal*/ set c(val: number) { } -} -namespace normalN { - /**@internal*/ export class C { } - /**@internal*/ export function foo() {} - /**@internal*/ export namespace someNamespace { export class C {} } - /**@internal*/ export namespace someOther.something { export class someClass {} } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ export type internalType = internalC; - /**@internal*/ export const internalConst = 10; - /**@internal*/ export enum internalEnum { a, b, c } -} -/**@internal*/ class internalC {} -/**@internal*/ function internalfoo() {} -/**@internal*/ namespace internalNamespace { export class someClass {} } -/**@internal*/ namespace internalOther.something { export class someClass {} } -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ type internalType = internalC; -/**@internal*/ const internalConst = 10; -/**@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5640,27 +5704,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js index 29faf13444f9e..b81b83505ad72 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js @@ -1,4 +1,158 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +enum TokenFlags { + None = 0, + /* @internal */ + PrecedingLineBreak = 1 << 0, + /* @internal */ + PrecedingJSDocComment = 1 << 1, + /* @internal */ + Unterminated = 1 << 2, + /* @internal */ + ExtendedUnicodeEscape = 1 << 3, + Scientific = 1 << 4, + Octal = 1 << 5, + HexSpecifier = 1 << 6, + BinarySpecifier = 1 << 7, + OctalSpecifier = 1 << 8, + /* @internal */ + ContainsSeparator = 1 << 9, + /* @internal */ + BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier, + /* @internal */ + NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator +} +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +172,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1373,42 +1527,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -enum TokenFlags { - None = 0, - /* @internal */ - PrecedingLineBreak = 1 << 0, - /* @internal */ - PrecedingJSDocComment = 1 << 1, - /* @internal */ - Unterminated = 1 << 2, - /* @internal */ - ExtendedUnicodeEscape = 1 << 3, - Scientific = 1 << 4, - Octal = 1 << 5, - HexSpecifier = 1 << 6, - BinarySpecifier = 1 << 7, - OctalSpecifier = 1 << 8, - /* @internal */ - ContainsSeparator = 1 << 9, - /* @internal */ - BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier, - /* @internal */ - NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator -} -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] declare enum TokenFlags { None = 0, @@ -2716,27 +2834,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js index 182887cdc815a..4ac5d22491475 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,162 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ class internalC {} +/*@internal*/ function internalfoo() {} +/*@internal*/ namespace internalNamespace { export class someClass {} } +/*@internal*/ namespace internalOther.something { export class someClass {} } +/*@internal*/ import internalImport = internalNamespace.someClass; +/*@internal*/ type internalType = internalC; +/*@internal*/ const internalConst = 10; +/*@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../first", "prepend": true } + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +196,8 @@ readFiles:: { "/src/2/second-output.js": 1, "/src/2/second-output.js.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -3279,78 +3437,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ class internalC {} -/*@internal*/ function internalfoo() {} -/*@internal*/ namespace internalNamespace { export class someClass {} } -/*@internal*/ namespace internalOther.something { export class someClass {} } -/*@internal*/ import internalImport = internalNamespace.someClass; -/*@internal*/ type internalType = internalC; -/*@internal*/ const internalConst = 10; -/*@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../first", "prepend": true } - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5593,27 +5679,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js index 219f5fd1756ed..04c58f90e11e2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js @@ -1,4 +1,49 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/* @internal */ const A = 1; + +//// [/src/first/first_part2.ts] + + +//// [/src/first/first_part3.ts] + + +//// [/src/first/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"sourceMap":true,"outFile":"./bin/first-output.js"},"files":["/src/first/first_PART1.ts"]} + +//// [/src/second/second_part1.ts] + + +//// [/src/second/second_part2.ts] + + +//// [/src/second/tsconfig.json] + + +//// [/src/third/third_part1.ts] +const B = 2; + +//// [/src/third/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":false,"stripInternal":true,"sourceMap":true,"outFile":"./thirdjs/output/third-output.js"},"references":[{"path":"../first","prepend":true}],"files":["/src/third/third_part1.ts"]} + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -13,8 +58,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] declare const A = 1; //# sourceMappingURL=first-output.d.ts.map @@ -147,12 +192,6 @@ internal: (0-20) declare const A = 1; ====================================================================== -//// [/src/first/first_PART1.ts] -/* @internal */ const A = 1; - -//// [/src/first/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"sourceMap":true,"outFile":"./bin/first-output.js"},"files":["/src/first/first_PART1.ts"]} - //// [/src/third/thirdjs/output/third-output.d.ts] declare const B = 2; @@ -302,9 +341,3 @@ declare const B = 2; ====================================================================== -//// [/src/third/third_part1.ts] -const B = 2; - -//// [/src/third/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":false,"stripInternal":true,"sourceMap":true,"outFile":"./thirdjs/output/third-output.js"},"references":[{"path":"../first","prepend":true}],"files":["/src/third/third_part1.ts"]} - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index d93d93328562f..67c31ad38fd76 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,162 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ class internalC {} +/*@internal*/ function internalfoo() {} +/*@internal*/ namespace internalNamespace { export class someClass {} } +/*@internal*/ namespace internalOther.something { export class someClass {} } +/*@internal*/ import internalImport = internalNamespace.someClass; +/*@internal*/ type internalType = internalC; +/*@internal*/ const internalConst = 10; +/*@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../first", "prepend": true } + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +176,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -3359,100 +3517,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ class internalC {} -/*@internal*/ function internalfoo() {} -/*@internal*/ namespace internalNamespace { export class someClass {} } -/*@internal*/ namespace internalOther.something { export class someClass {} } -/*@internal*/ import internalImport = internalNamespace.someClass; -/*@internal*/ type internalType = internalC; -/*@internal*/ const internalConst = 10; -/*@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../first", "prepend": true } - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5795,27 +5859,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js index 29cca87802bf0..eef87379bc71c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js @@ -1,4 +1,161 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ class internalC {} +/*@internal*/ function internalfoo() {} +/*@internal*/ namespace internalNamespace { export class someClass {} } +/*@internal*/ namespace internalOther.something { export class someClass {} } +/*@internal*/ import internalImport = internalNamespace.someClass; +/*@internal*/ type internalType = internalC; +/*@internal*/ const internalConst = 10; +/*@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +175,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -3033,99 +3190,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ class internalC {} -/*@internal*/ function internalfoo() {} -/*@internal*/ namespace internalNamespace { export class someClass {} } -/*@internal*/ namespace internalOther.something { export class someClass {} } -/*@internal*/ import internalImport = internalNamespace.someClass; -/*@internal*/ type internalType = internalC; -/*@internal*/ const internalConst = 10; -/*@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5504,27 +5568,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js index 08beb4b6a4493..e9b253dd41bf5 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js @@ -1,4 +1,161 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ class internalC {} +/*@internal*/ function internalfoo() {} +/*@internal*/ namespace internalNamespace { export class someClass {} } +/*@internal*/ namespace internalOther.something { export class someClass {} } +/*@internal*/ import internalImport = internalNamespace.someClass; +/*@internal*/ type internalType = internalC; +/*@internal*/ const internalConst = 10; +/*@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +195,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -2953,59 +3110,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ class internalC {} -/*@internal*/ function internalfoo() {} -/*@internal*/ namespace internalNamespace { export class someClass {} } -/*@internal*/ namespace internalOther.something { export class someClass {} } -/*@internal*/ import internalImport = internalNamespace.someClass; -/*@internal*/ type internalType = internalC; -/*@internal*/ const internalConst = 10; -/*@internal*/ enum internalEnum { a, b, c } - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5284,27 +5388,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js index 1b87c4b808c78..cad3db56ff2a1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js @@ -1,4 +1,150 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +/// +const first_part2Const = new firstfirst_part2(); +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tripleRef.d.ts] +declare class firstfirst_part2 { } + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +/// +const second_part1Const = new secondsecond_part1(); +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tripleRef.d.ts] +declare class secondsecond_part1 { } + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +/// +const third_part1Const = new thirdthird_part1(); +var c = new C(); +c.doSomething(); + + +//// [/src/third/tripleRef.d.ts] +declare class thirdthird_part1 { } + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -41,8 +187,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] /// declare const second_part1Const: secondsecond_part1; @@ -986,34 +1132,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_part2.ts] -/// -const first_part2Const = new firstfirst_part2(); -console.log(f()); - - -//// [/src/first/tripleRef.d.ts] -declare class firstfirst_part2 { } - -//// [/src/second/second_part1.ts] -/// -const second_part1Const = new secondsecond_part1(); -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - -//// [/src/second/tripleRef.d.ts] -declare class secondsecond_part1 { } - //// [/src/third/thirdjs/output/third-output.d.ts] /// /// @@ -2102,13 +2220,3 @@ declare var c: C; ====================================================================== -//// [/src/third/third_part1.ts] -/// -const third_part1Const = new thirdthird_part1(); -var c = new C(); -c.doSomething(); - - -//// [/src/third/tripleRef.d.ts] -declare class thirdthird_part1 { } - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js index ee1fd0fdde62c..939185954d7ef 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js @@ -1,4 +1,140 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +/// +const second_part1Const = new secondsecond_part1(); +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tripleRef.d.ts] +declare class secondsecond_part1 { } + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +154,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] /// declare const second_part1Const: secondsecond_part1; @@ -895,25 +1031,6 @@ declare function f(): string; ====================================================================== -//// [/src/second/second_part1.ts] -/// -const second_part1Const = new secondsecond_part1(); -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - -//// [/src/second/tripleRef.d.ts] -declare class secondsecond_part1 { } - //// [/src/third/thirdjs/output/third-output.d.ts] /// interface TheFirst { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js index cdb14cd5eebb7..de5c71fc3e94b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "incremental": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1719,26 +1850,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "incremental": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js index 213a9f7d07ef7..5ae9007d3c60d 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1565,26 +1696,3 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js index 6cffcd70b6d2d..6fed22e3f836d 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js @@ -1,4 +1,136 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "tsBuildInfoFile": "./thirdjs/output/third.tsbuildinfo", + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +150,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1719,27 +1851,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "tsBuildInfoFile": "./thirdjs/output/third.tsbuildinfo", - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js index fa65982a75d39..facf822c736d6 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js @@ -1,4 +1,133 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +147,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1619,6 +1748,3 @@ declare class C { ====================================================================== -//// [/src/third/third_part1.ts] - - diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/builds-correctly.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/builds-correctly.js index 24d84a1cd194c..c78b4a1dc080b 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/builds-correctly.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/builds-correctly.js @@ -1,8 +1,65 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/src/main /src/src/other -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/main/a.ts] +import { b } from './b'; +const a = b; + +//// [/src/src/main/b.ts] +export const b = 0; + + +//// [/src/src/main/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "references": [ + { "path": "../other" } + ] +} + +//// [/src/src/other/other.ts] +export const Other = 0; + +//// [/src/src/other/tsconfig.json] +{ + "extends": "../../tsconfig.base.json" +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true + }, + "exclude": [ + "node_modules" + ] +} + + +Output:: +/lib/tsc --b /src/src/main /src/src/other +exitCode:: ExitStatus.Success + + //// [/src/dist/main/a.d.ts] export {}; diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js index a976119dce6f3..997d1c50a47b9 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js @@ -1,4 +1,61 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/main/a.ts] +import { b } from './b'; +const a = b; + +//// [/src/src/main/b.ts] +export const b = 0; + + +//// [/src/src/main/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "references": [ + { "path": "../other" } + ] +} + +//// [/src/src/other/other.ts] +export const Other = 0; + + +//// [/src/src/other/tsconfig.json] +{ + "extends": "../../tsconfig.base.json" +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + + "outDir": "./dist/", + "skipDefaultLibCheck": true + }, + "exclude": [ + "node_modules" + ] +} + + + +Output:: /lib/tsc --b /src/src/main --verbose [12:00:00 AM] Projects in this build: * src/src/other/tsconfig.json @@ -21,8 +78,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/dist/other.d.ts] export declare const Other = 0; @@ -66,17 +123,3 @@ exports.Other = 0; "version": "FakeTSVersion" } -//// [/src/tsconfig.base.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - - "outDir": "./dist/", - "skipDefaultLibCheck": true - }, - "exclude": [ - "node_modules" - ] -} - diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file.js index 2e7587aa91a3a..f122c25b5c52a 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file.js @@ -1,4 +1,43 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/main/a.ts] +import { b } from './b'; +const a = b; + +//// [/src/src/main/b.ts] +export const b = 0; + + +//// [/src/src/main/tsconfig.json] +{"compilerOptions":{"composite":true,"outDir":"../../dist/"},"references":[{"path":"../other"}]} + +//// [/src/src/other/other.ts] +export const Other = 0; + + +//// [/src/src/other/tsconfig.json] +{"compilerOptions":{"composite":true,"outDir":"../../dist/"}} + +//// [/src/tsconfig.base.json] + + + + +Output:: /lib/tsc --b /src/src/main --verbose [12:00:00 AM] Projects in this build: * src/src/other/tsconfig.json @@ -21,8 +60,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/dist/other.d.ts] export declare const Other = 0; @@ -64,9 +103,3 @@ exports.Other = 0; "version": "FakeTSVersion" } -//// [/src/src/main/tsconfig.json] -{"compilerOptions":{"composite":true,"outDir":"../../dist/"},"references":[{"path":"../other"}]} - -//// [/src/src/other/tsconfig.json] -{"compilerOptions":{"composite":true,"outDir":"../../dist/"}} - diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-no-error-when-tsbuildinfo-differ.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-no-error-when-tsbuildinfo-differ.js index 022c2f30fd3a4..a61de07968d9a 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-no-error-when-tsbuildinfo-differ.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-no-error-when-tsbuildinfo-differ.js @@ -1,4 +1,43 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/main/a.ts] +import { b } from './b'; +const a = b; + +//// [/src/src/main/b.ts] +export const b = 0; + + +//// [/src/src/main/tsconfig.main.json] +{"compilerOptions":{"composite":true,"outDir":"../../dist/"},"references":[{"path":"../other/tsconfig.other.json"}]} + +//// [/src/src/other/other.ts] +export const Other = 0; + + +//// [/src/src/other/tsconfig.other.json] +{"compilerOptions":{"composite":true,"outDir":"../../dist/"}} + +//// [/src/tsconfig.base.json] + + + + +Output:: /lib/tsc --b /src/src/main/tsconfig.main.json --verbose [12:00:00 AM] Projects in this build: * src/src/other/tsconfig.other.json @@ -13,8 +52,8 @@ [12:00:00 AM] Building project '/src/src/main/tsconfig.main.json'... exitCode:: ExitStatus.Success - - + + //// [/src/dist/a.d.ts] export {}; @@ -118,11 +157,3 @@ exports.Other = 0; "version": "FakeTSVersion" } -//// [/src/src/main/tsconfig.json] unlink -//// [/src/src/main/tsconfig.main.json] -{"compilerOptions":{"composite":true,"outDir":"../../dist/"},"references":[{"path":"../other/tsconfig.other.json"}]} - -//// [/src/src/other/tsconfig.json] unlink -//// [/src/src/other/tsconfig.other.json] -{"compilerOptions":{"composite":true,"outDir":"../../dist/"}} - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/files-containing-json-file.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/files-containing-json-file.js index 139570834a21f..5be549694cfda 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/files-containing-json-file.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/files-containing-json-file.js @@ -1,8 +1,62 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig_withFiles.json -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} +//// [/src/tsconfig_withInclude.json] + + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: +/lib/tsc --b /src/tsconfig_withFiles.json +exitCode:: ExitStatus.Success + + //// [/src/dist/src/hello.json] { "hello": "world" diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js index a31f08c508f74..6efbfbbf25467 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js @@ -1,4 +1,75 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/main/index.ts] +import { foo } from '../strings/foo.json'; + +console.log(foo); + +//// [/src/main/tsconfig.json] +{ + "extends": "../tsconfig.json", + "include": [ + "./**/*.ts" + ], + "references": [ + { + "path": "../strings/tsconfig.json" + } + ] +} + +//// [/src/strings/foo.json] +{ + "foo": "bar baz" +} + +//// [/src/strings/tsconfig.json] +{ + "extends": "../tsconfig.json", + "include": [ "foo.json" ], + "references": [] +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "rootDir": "./", + "composite": true, + "resolveJsonModule": true, + "strict": true, + "esModuleInterop": true + }, + "references": [ + { + "path": "./strings/tsconfig.json" + }, + { + "path": "./main/tsconfig.json" + } + ], + "files": [] +} + + + + +Output:: /lib/tsc --b src/tsconfig.json --verbose [12:01:00 AM] Projects in this build: * src/strings/tsconfig.json @@ -14,8 +85,8 @@ [12:01:00 AM] Building project '/src/main/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/main/index.d.ts] export {}; @@ -106,3 +177,23 @@ console.log(foo_json_1.foo); "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b src/tsconfig.json --verbose +[12:04:00 AM] Projects in this build: + * src/strings/tsconfig.json + * src/main/tsconfig.json + * src/tsconfig.json + +[12:04:00 AM] Project 'src/strings/tsconfig.json' is up to date because newest input 'src/strings/foo.json' is older than oldest output 'src/strings/tsconfig.tsbuildinfo' + +[12:04:00 AM] Project 'src/main/tsconfig.json' is up to date because newest input 'src/main/index.ts' is older than oldest output 'src/main/index.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-and-files.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-and-files.js index 49e254138b890..c3260fe00e4bc 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-and-files.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-and-files.js @@ -1,8 +1,65 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig_withIncludeAndFiles.json -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] + + +//// [/src/tsconfig_withInclude.json] +//// [/src/tsconfig_withIncludeAndFiles.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/hello.json" + ], + "include": [ + "src/**/*" + ] +} + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: +/lib/tsc --b /src/tsconfig_withIncludeAndFiles.json +exitCode:: ExitStatus.Success + + //// [/src/dist/src/hello.json] { "hello": "world" diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js index b5f046a1b433f..65a6887df6724 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js @@ -1,8 +1,60 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig_withIncludeOfJson.json -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/index.json] +{"hello":"world"} +//// [/src/src/index.ts] +import hello from "./index.json" + +export default hello.hello +//// [/src/tsconfig_withFiles.json] + + +//// [/src/tsconfig_withInclude.json] + + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} + + + +Output:: +/lib/tsc --b /src/tsconfig_withIncludeOfJson.json +exitCode:: ExitStatus.Success + + //// [/src/dist/src/index.d.ts] declare const _default: string; export default _default; @@ -68,12 +120,3 @@ exports["default"] = index_json_1["default"].hello; "version": "FakeTSVersion" } -//// [/src/src/hello.json] unlink -//// [/src/src/index.json] -{"hello":"world"} - -//// [/src/src/index.ts] -import hello from "./index.json" - -export default hello.hello - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include.js index 9268ee2246294..25917941f674d 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include.js @@ -1,8 +1,62 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig_withIncludeOfJson.json -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] + + +//// [/src/tsconfig_withInclude.json] +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} + + + +Output:: +/lib/tsc --b /src/tsconfig_withIncludeOfJson.json +exitCode:: ExitStatus.Success + + //// [/src/dist/src/hello.json] { "hello": "world" diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js index 67924de06f72c..e1d0659797c0f 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js @@ -1,4 +1,58 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] + + +//// [/src/tsconfig_withInclude.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*" + ] +} + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: /lib/tsc --b /src/tsconfig_withInclude.json src/src/index.ts:1:19 - error TS6307: File '/src/src/hello.json' is not listed within the file list of project '/src/tsconfig_withInclude.json'. Projects must list all files or use an 'include' pattern. @@ -9,5 +63,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js index 5c1186b2faef4..0d39b0a6f2901 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js @@ -1,4 +1,58 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] +{ + "compilerOptions": { + "composite": true, "sourceMap": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} + +//// [/src/tsconfig_withInclude.json] + + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose [12:01:00 AM] Projects in this build: * src/tsconfig_withFiles.json @@ -8,8 +62,8 @@ [12:01:00 AM] Building project '/src/tsconfig_withFiles.json'... exitCode:: ExitStatus.Success - - + + //// [/src/dist/src/hello.json] { "hello": "world" @@ -81,20 +135,19 @@ exports["default"] = hello_json_1["default"].hello; "version": "FakeTSVersion" } -//// [/src/tsconfig_withFiles.json] -{ - "compilerOptions": { - "composite": true, "sourceMap": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true - }, - "files": [ - "src/index.ts", "src/hello.json" - ] -} + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b src/tsconfig_withFiles.json --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig_withFiles.json + +[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/index.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js index 61e439430dc23..6c0344367f713 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js @@ -1,4 +1,58 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} + +//// [/src/tsconfig_withInclude.json] + + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose [12:01:00 AM] Projects in this build: * src/tsconfig_withFiles.json @@ -8,8 +62,8 @@ [12:01:00 AM] Building project '/src/tsconfig_withFiles.json'... exitCode:: ExitStatus.Success - - + + //// [/src/src/index.d.ts] declare const _default: string; export default _default; @@ -25,23 +79,6 @@ var hello_json_1 = __importDefault(require("./hello.json")); exports["default"] = hello_json_1["default"].hello; -//// [/src/tsconfig_withFiles.json] -{ - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - - "skipDefaultLibCheck": true - }, - "files": [ - "src/index.ts", "src/hello.json" - ] -} - //// [/src/tsconfig_withFiles.tsbuildinfo] { "program": { @@ -87,3 +124,19 @@ exports["default"] = hello_json_1["default"].hello; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b src/tsconfig_withFiles.json --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig_withFiles.json + +[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/src/index.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js deleted file mode 100644 index 9bfe73167f461..0000000000000 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --b src/tsconfig.json --verbose -[12:04:00 AM] Projects in this build: - * src/strings/tsconfig.json - * src/main/tsconfig.json - * src/tsconfig.json - -[12:04:00 AM] Project 'src/strings/tsconfig.json' is up to date because newest input 'src/strings/foo.json' is older than oldest output 'src/strings/tsconfig.tsbuildinfo' - -[12:04:00 AM] Project 'src/main/tsconfig.json' is up to date because newest input 'src/main/index.ts' is older than oldest output 'src/main/index.js' - -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js deleted file mode 100644 index 059fd1042cc34..0000000000000 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --b src/tsconfig_withFiles.json --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig_withFiles.json - -[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/index.js' - -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js deleted file mode 100644 index d412d147ce925..0000000000000 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --b src/tsconfig_withFiles.json --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig_withFiles.json - -[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/src/index.js' - -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/Detects-type-only-changes-in-upstream-projects.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/Detects-type-only-changes-in-upstream-projects.js index 300f31f413b57..1e2a206e17709 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/Detects-type-only-changes-in-upstream-projects.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/Detects-type-only-changes-in-upstream-projects.js @@ -1,4 +1,13 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/core/index.ts] +export const someString: string = "WELCOME PLANET"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:08:00 AM] Projects in this build: * src/core/tsconfig.json @@ -20,8 +29,8 @@ [12:08:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/index.d.ts] file written with same contents //// [/src/core/index.d.ts.map] {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAyB,CAAC;AACnD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} @@ -37,12 +46,6 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/core/index.ts] -export const someString: string = "WELCOME PLANET"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js deleted file mode 100644 index 9ee7bc33fcd6e..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js +++ /dev/null @@ -1,223 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/tests --listEmittedFiles -TSFILE: /src/core/index.js -TSFILE: /src/core/index.d.ts.map -TSFILE: /src/core/index.d.ts -TSFILE: /src/core/tsconfig.tsbuildinfo -TSFILE: /src/logic/index.js.map -TSFILE: /src/logic/index.js -TSFILE: /src/logic/index.d.ts -TSFILE: /src/logic/tsconfig.tsbuildinfo -TSFILE: /src/tests/index.js -TSFILE: /src/tests/index.d.ts -TSFILE: /src/tests/tsconfig.tsbuildinfo -exitCode:: ExitStatus.Success - - -//// [/src/core/index.d.ts] -export declare const someString: string; -export declare function leftPad(s: string, n: number): string; -export declare function multiply(a: number, b: number): number; -export declare class someClass { -} -//# sourceMappingURL=index.d.ts.map - -//// [/src/core/index.d.ts.map] -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} - -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); -exports.someClass = someClass; - - -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "listEmittedFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "listEmittedFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "listEmittedFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js deleted file mode 100644 index 22bef1c92e992..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js +++ /dev/null @@ -1,225 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/tests --listFiles -/lib/lib.d.ts -/src/core/anotherModule.ts -/src/core/index.ts -/src/core/some_decl.d.ts -/lib/lib.d.ts -/src/core/index.d.ts -/src/core/anotherModule.d.ts -/src/logic/index.ts -/lib/lib.d.ts -/src/core/index.d.ts -/src/core/anotherModule.d.ts -/src/logic/index.d.ts -/src/tests/index.ts -exitCode:: ExitStatus.Success - - -//// [/src/core/index.d.ts] -export declare const someString: string; -export declare function leftPad(s: string, n: number): string; -export declare function multiply(a: number, b: number): number; -export declare class someClass { -} -//# sourceMappingURL=index.d.ts.map - -//// [/src/core/index.d.ts.map] -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} - -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); -exports.someClass = someClass; - - -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "listFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "listFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "listFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-from-start-if-force-option-is-set.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-from-start-if-force-option-is-set.js index 0bfd4788da259..841221ea1494e 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-from-start-if-force-option-is-set.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-from-start-if-force-option-is-set.js @@ -1,4 +1,7 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tests --verbose --force [12:16:00 AM] Projects in this build: * src/core/tsconfig.json @@ -18,8 +21,8 @@ [12:16:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] file written with same contents //// [/src/core/anotherModule.d.ts.map] file written with same contents //// [/src/core/anotherModule.js] file written with same contents diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js deleted file mode 100644 index 095f8f11c33bb..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js +++ /dev/null @@ -1,89 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' - -[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' - -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.base.json' - -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.base.json] -{"compilerOptions":{}} - -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-tsconfig-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-tsconfig-changes.js index 2cb39bf369c47..97ae68cfe6df4 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-tsconfig-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-tsconfig-changes.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, "target": "es3", + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + + + +Output:: /lib/tsc --b /src/tests --verbose [12:20:00 AM] Projects in this build: * src/core/tsconfig.json @@ -14,25 +32,10 @@ [12:20:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/tests/index.d.ts] file written with same contents //// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.json] -{ - "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, "target": "es3", - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - } -} - //// [/src/tests/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js deleted file mode 100644 index dfcae27b84e93..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js +++ /dev/null @@ -1,380 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' - -[12:04:00 AM] Building project '/src/core/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... - -[12:04:00 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js' is older than newest input 'src/core' - -[12:04:00 AM] Building project '/src/logic/tsconfig.json'... - -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' - -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success -readFiles:: { - "/src/tests/tsconfig.json": 1, - "/src/core/tsconfig.json": 1, - "/src/logic/tsconfig.json": 1, - "/src/core/tsconfig.tsbuildinfo": 1, - "/src/core/anotherModule.ts": 1, - "/src/core/index.ts": 1, - "/src/core/some_decl.d.ts": 1, - "/src/core/index.d.ts": 2, - "/src/logic/tsconfig.tsbuildinfo": 1, - "/src/logic/index.ts": 1, - "/src/core/anotherModule.d.ts": 1, - "/src/logic/index.d.ts": 1, - "/src/tests/tsconfig.tsbuildinfo": 1, - "/src/tests/index.ts": 1, - "/src/tests/index.d.ts": 1 -} - -//// [/src/core/index.d.ts] -export declare const someString: string; -export declare function leftPad(s: string, n: number): string; -export declare function multiply(a: number, b: number): number; -export declare class someClass { -} -//# sourceMappingURL=index.d.ts.map - -//// [/src/core/index.d.ts.map] -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} - -//// [/src/core/index.d.ts.map.baseline.txt] -=================================================================== -JsFile: index.d.ts -mapUrl: index.d.ts.map -sourceRoot: -sources: index.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:/src/core/index.d.ts -sourceFile:index.ts -------------------------------------------------------------------- ->>>export declare const someString: string; -1 > -2 >^^^^^^^^^^^^^^^ -3 > ^^^^^^ -4 > ^^^^^^^^^^ -5 > ^^ -6 > ^^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >export -3 > const -4 > someString -5 > : -6 > string = "HELLO WORLD" -7 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 16) Source(1, 8) + SourceIndex(0) -3 >Emitted(1, 22) Source(1, 14) + SourceIndex(0) -4 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) -5 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) -6 >Emitted(1, 40) Source(1, 48) + SourceIndex(0) -7 >Emitted(1, 41) Source(1, 49) + SourceIndex(0) ---- ->>>export declare function leftPad(s: string, n: number): string; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^ -4 > ^ -5 > ^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^ -10> ^^ -11> ^^^^^^ -12> ^^^^^^^^^^ -13> ^^-> -1-> - > -2 >export function -3 > leftPad -4 > ( -5 > s -6 > : -7 > string -8 > , -9 > n -10> : -11> number -12> ) { return s + n; } -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 25) Source(2, 17) + SourceIndex(0) -3 >Emitted(2, 32) Source(2, 24) + SourceIndex(0) -4 >Emitted(2, 33) Source(2, 25) + SourceIndex(0) -5 >Emitted(2, 34) Source(2, 26) + SourceIndex(0) -6 >Emitted(2, 36) Source(2, 28) + SourceIndex(0) -7 >Emitted(2, 42) Source(2, 34) + SourceIndex(0) -8 >Emitted(2, 44) Source(2, 36) + SourceIndex(0) -9 >Emitted(2, 45) Source(2, 37) + SourceIndex(0) -10>Emitted(2, 47) Source(2, 39) + SourceIndex(0) -11>Emitted(2, 53) Source(2, 45) + SourceIndex(0) -12>Emitted(2, 63) Source(2, 64) + SourceIndex(0) ---- ->>>export declare function multiply(a: number, b: number): number; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^ -10> ^^ -11> ^^^^^^ -12> ^^^^^^^^^^ -1-> - > -2 >export function -3 > multiply -4 > ( -5 > a -6 > : -7 > number -8 > , -9 > b -10> : -11> number -12> ) { return a * b; } -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 25) Source(3, 17) + SourceIndex(0) -3 >Emitted(3, 33) Source(3, 25) + SourceIndex(0) -4 >Emitted(3, 34) Source(3, 26) + SourceIndex(0) -5 >Emitted(3, 35) Source(3, 27) + SourceIndex(0) -6 >Emitted(3, 37) Source(3, 29) + SourceIndex(0) -7 >Emitted(3, 43) Source(3, 35) + SourceIndex(0) -8 >Emitted(3, 45) Source(3, 37) + SourceIndex(0) -9 >Emitted(3, 46) Source(3, 38) + SourceIndex(0) -10>Emitted(3, 48) Source(3, 40) + SourceIndex(0) -11>Emitted(3, 54) Source(3, 46) + SourceIndex(0) -12>Emitted(3, 64) Source(3, 65) + SourceIndex(0) ---- ->>>export declare class someClass { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^ -1 > - > - > -2 >export class -3 > someClass -1 >Emitted(4, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(4, 22) Source(5, 14) + SourceIndex(0) -3 >Emitted(4, 31) Source(5, 23) + SourceIndex(0) ---- ->>>} -1 >^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > { } -1 >Emitted(5, 2) Source(5, 27) + SourceIndex(0) ---- ->>>//# sourceMappingURL=index.d.ts.map - -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); -exports.someClass = someClass; - - -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/index.js.map.baseline.txt] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js deleted file mode 100644 index e9ec98fc4b081..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js +++ /dev/null @@ -1,75 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.d.ts' does not exist - -[12:04:00 AM] Building project '/src/core/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.d.ts] -export declare const World = "hello"; - - -//// [/src/core/anotherModule.js] file written with same contents -//// [/src/core/index.d.ts] -export declare const someString: string; -export declare function leftPad(s: string, n: number): string; -export declare function multiply(a: number, b: number): number; - - -//// [/src/core/index.js] file written with same contents -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, "declaration": true, - "skipDefaultLibCheck": true - } -} - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-8396256275-export declare const World = \"hello\";\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "incremental": true, - "declaration": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js deleted file mode 100644 index a5387d98d5eb2..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js +++ /dev/null @@ -1,133 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' - -[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' - -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json' - -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -exports.__esModule = true; -exports.m = void 0; -var c = __importStar(require("../core/index")); -var logic = __importStar(require("../logic/index")); -c.leftPad("", 10); -logic.getSecondsInDay(); -var mod = __importStar(require("../core/anotherModule")); -exports.m = mod; - - -//// [/src/tests/tsconfig.json] -{ - "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "esModuleInterop": true - } -} - -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "esModuleInterop": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js deleted file mode 100644 index d469852c88a19..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js +++ /dev/null @@ -1,181 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/tests --verbose -[12:12:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:12:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' - -[12:12:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/decls/index.d.ts' does not exist - -[12:12:00 AM] Building project '/src/logic/tsconfig.json'... - -[12:12:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/logic' - -[12:12:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success -readFiles:: { - "/src/tests/tsconfig.json": 1, - "/src/core/tsconfig.json": 1, - "/src/logic/tsconfig.json": 1, - "/src/core/tsconfig.tsbuildinfo": 1, - "/src/logic/tsconfig.tsbuildinfo": 1, - "/src/logic/index.ts": 1, - "/src/core/index.d.ts": 1, - "/src/core/anotherModule.d.ts": 1, - "/src/tests/tsconfig.tsbuildinfo": 1, - "/src/tests/index.ts": 1, - "/src/logic/decls/index.d.ts": 1, - "/src/tests/index.d.ts": 1 -} - -//// [/src/logic/decls/index.d.ts] -export declare function getSecondsInDay(): number; -import * as mod from '../core/anotherModule'; -export declare const m: typeof mod; - - -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/index.js.map.baseline.txt] file written with same contents -//// [/src/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - "declarationDir": "decls", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - -//// [/src/logic/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationDir": "./decls", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/decls/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/decls/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/decls/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/decls/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/decls/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js deleted file mode 100644 index d52890fbfb689..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js +++ /dev/null @@ -1,84 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' - -[12:04:00 AM] Building project '/src/core/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - exports.__esModule = true; - exports.World = void 0; - exports.World = "hello"; -}); - - -//// [/src/core/index.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - exports.__esModule = true; - exports.multiply = exports.leftPad = exports.someString = void 0; - exports.someString = "HELLO WORLD"; - function leftPad(s, n) { return s + n; } - exports.leftPad = leftPad; - function multiply(a, b) { return a * b; } - exports.multiply = multiply; -}); - - -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, - "module": "amd" - } -} - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-8396256275-export declare const World = \"hello\";\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "incremental": true, - "module": 2, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js deleted file mode 100644 index 2ec6f3962a0aa..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js +++ /dev/null @@ -1,98 +0,0 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' - -[12:04:00 AM] Building project '/src/core/tsconfig.json'... - -TSFILE: /src/core/anotherModule.js -TSFILE: /src/core/index.js -TSFILE: /src/core/tsconfig.tsbuildinfo -/lib/lib.d.ts -/lib/lib.esnext.d.ts -/src/core/anotherModule.ts -/src/core/index.ts -/src/core/some_decl.d.ts -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.World = void 0; -exports.World = "hello"; - - -//// [/src/core/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; - - -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, -"listFiles": true, -"listEmittedFiles": true, - "target": "es5", - } -} - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "8926001564-/// \n/// ", - "signature": "8926001564-/// \n/// ", - "affectsGlobalScope": false - }, - "../../lib/lib.esnext.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-8396256275-export declare const World = \"hello\";\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "incremental": true, - "listFiles": true, - "listEmittedFiles": true, - "target": 1, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../../lib/lib.esnext.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/Only-builds-the-leaf-node-project.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/Only-builds-the-leaf-node-project.js index ae9b4a03c3bf9..2e5afd1dfdd16 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/Only-builds-the-leaf-node-project.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/Only-builds-the-leaf-node-project.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/tests/index.ts] +const m = 10; + + + +Output:: /lib/tsc --b /src/tests --verbose [12:04:00 AM] Projects in this build: * src/core/tsconfig.json @@ -14,8 +20,8 @@ [12:04:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/tests/index.d.ts] declare const m = 10; @@ -24,9 +30,6 @@ declare const m = 10; var m = 10; -//// [/src/tests/index.ts] -const m = 10; - //// [/src/tests/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/indicates-that-it-would-skip-builds-during-a-dry-build.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/indicates-that-it-would-skip-builds-during-a-dry-build.js index ff5990493339f..74292ffd7a679 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/indicates-that-it-would-skip-builds-during-a-dry-build.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/indicates-that-it-would-skip-builds-during-a-dry-build.js @@ -1,4 +1,7 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tests --dry [12:12:00 AM] Project '/src/core/tsconfig.json' is up to date @@ -7,5 +10,5 @@ [12:12:00 AM] Project '/src/tests/tsconfig.json' is up to date exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js deleted file mode 100644 index 1c2f36d6e8d6c..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js +++ /dev/null @@ -1,79 +0,0 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --b /src/tests --listEmittedFiles -TSFILE: /src/core/index.js -TSFILE: /src/core/index.d.ts.map -TSFILE: /src/core/index.d.ts -TSFILE: /src/core/tsconfig.tsbuildinfo -exitCode:: ExitStatus.Success - - -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); - - -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-16698397488-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nclass someClass { }", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "listEmittedFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js deleted file mode 100644 index 44b55e94c8c28..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js +++ /dev/null @@ -1,79 +0,0 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --b /src/tests --listFiles -/lib/lib.d.ts -/src/core/anotherModule.ts -/src/core/index.ts -/src/core/some_decl.d.ts -exitCode:: ExitStatus.Success - - -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); - - -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-16698397488-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nclass someClass { }", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "listFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js deleted file mode 100644 index 3cd1d156e4ee4..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js +++ /dev/null @@ -1,105 +0,0 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --b /src/tests --verbose -[12:08:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:08:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' - -[12:08:00 AM] Building project '/src/core/tsconfig.json'... - -[12:08:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... - -[12:08:00 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies - -[12:08:00 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... - -[12:08:00 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies - -[12:08:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success -readFiles:: { - "/src/tests/tsconfig.json": 1, - "/src/core/tsconfig.json": 1, - "/src/logic/tsconfig.json": 1, - "/src/core/tsconfig.tsbuildinfo": 1, - "/src/core/anotherModule.ts": 1, - "/src/core/index.ts": 1, - "/src/core/some_decl.d.ts": 1, - "/src/core/index.d.ts": 1, - "/src/logic/tsconfig.tsbuildinfo": 1, - "/src/tests/tsconfig.tsbuildinfo": 1 -} - -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.d.ts.map.baseline.txt] file written with same contents -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); - - -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-16698397488-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nclass someClass { }", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js b/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js index 41183f37ea46a..a0017e70e29ac 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js @@ -1,8 +1,106 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tests --force -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/tests --force +exitCode:: ExitStatus.Success + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -240,3 +338,28 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tests --force +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.d.ts] file written with same contents +//// [/src/core/anotherModule.d.ts.map] file written with same contents +//// [/src/core/anotherModule.js] file written with same contents +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.js] file written with same contents +//// [/src/core/tsconfig.tsbuildinfo] file written with same contents +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] file written with same contents diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-declarationDir-is-specified.js b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-declarationDir-is-specified.js index e2ada1a35ed78..70f20909ef304 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-declarationDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-declarationDir-is-specified.js @@ -1,8 +1,94 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tests -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"sourceMap":true,"declarationDir":"out/decls"},"references":[{"path":"../core"}]} +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/tests +exitCode:: ExitStatus.Success + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -103,9 +189,6 @@ import * as mod from '../core/anotherModule'; export declare const m: typeof mod; -//// [/src/logic/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"sourceMap":true,"declarationDir":"out/decls"},"references":[{"path":"../core"}]} - //// [/src/logic/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-outDir-is-specified.js b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-outDir-is-specified.js index 3883d2ddaadb4..e238ffb0a4aa6 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-outDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-outDir-is-specified.js @@ -1,8 +1,94 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tests -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"sourceMap":true,"outDir":"outDir"},"references":[{"path":"../core"}]} +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/tests +exitCode:: ExitStatus.Success + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -156,9 +242,6 @@ exports.m = mod; "version": "FakeTSVersion" } -//// [/src/logic/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"sourceMap":true,"outDir":"outDir"},"references":[{"path":"../core"}]} - //// [/src/tests/index.d.ts] import * as mod from '../core/anotherModule'; export declare const m: typeof mod; diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js index 8a70a3ceb5d80..bfb3843cfcc7a 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js @@ -1,4 +1,64 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/core --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -8,8 +68,8 @@ [12:00:00 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -44,13 +104,3 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true - } -} - diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/can-detect-when-and-what-to-rebuild.js b/tests/baselines/reference/tsbuild/sample1/initial-build/can-detect-when-and-what-to-rebuild.js index f277322de2f7f..aa5fd83bd9c2b 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/can-detect-when-and-what-to-rebuild.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/can-detect-when-and-what-to-rebuild.js @@ -1,4 +1,268 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/core/anotherModule.d.ts] + + +//// [/src/core/anotherModule.d.ts.map] + + +//// [/src/core/anotherModule.js] + + +//// [/src/core/anotherModule.ts] + + +//// [/src/core/index.d.ts] + + +//// [/src/core/index.d.ts.map] + + +//// [/src/core/index.js] + + +//// [/src/core/index.ts] + + +//// [/src/core/some_decl.d.ts] + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/logic/index.d.ts] + + +//// [/src/logic/index.js] + + +//// [/src/logic/index.js.map] + + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] + + +//// [/src/tests/index.js] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -12,5 +276,5 @@ [12:01:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js index 00946a2c55ce3..20dc07826060f 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js @@ -1,4 +1,94 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.muitply(); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -26,8 +116,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -106,12 +196,3 @@ exports.multiply = multiply; "version": "FakeTSVersion" } -//// [/src/logic/index.ts] -import * as c from '../core/index'; -export function getSecondsInDay() { - return c.muitply(); -} -import * as mod from '../core/anotherModule'; -export const m = mod; - - diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-write-any-files-in-a-dry-build.js b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-write-any-files-in-a-dry-build.js index c66ceddb85bc2..b3d5781bcf8bf 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-write-any-files-in-a-dry-build.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-write-any-files-in-a-dry-build.js @@ -1,4 +1,71 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/core/anotherModule.ts] + + +//// [/src/core/index.ts] + + +//// [/src/core/some_decl.d.ts] + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --dry [12:00:00 AM] A non-dry build would build project '/src/core/tsconfig.json' @@ -7,5 +74,5 @@ [12:00:00 AM] A non-dry build would build project '/src/tests/tsconfig.json' exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js index 249ab29b363eb..6b3e4cf2275c3 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js @@ -1,4 +1,102 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --listEmittedFiles TSFILE: /src/core/anotherModule.js TSFILE: /src/core/anotherModule.d.ts.map @@ -15,8 +113,8 @@ TSFILE: /src/tests/index.js TSFILE: /src/tests/index.d.ts TSFILE: /src/tests/tsconfig.tsbuildinfo exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -257,3 +355,324 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: +/lib/tsc --b /src/tests --listEmittedFiles +TSFILE: /src/core/index.js +TSFILE: /src/core/index.d.ts.map +TSFILE: /src/core/index.d.ts +TSFILE: /src/core/tsconfig.tsbuildinfo +TSFILE: /src/logic/index.js.map +TSFILE: /src/logic/index.js +TSFILE: /src/logic/index.d.ts +TSFILE: /src/logic/tsconfig.tsbuildinfo +TSFILE: /src/tests/index.js +TSFILE: /src/tests/index.d.ts +TSFILE: /src/tests/tsconfig.tsbuildinfo +exitCode:: ExitStatus.Success + + +//// [/src/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map + +//// [/src/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} + +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "listEmittedFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "listEmittedFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "listEmittedFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +class someClass2 { } + + + +Output:: +/lib/tsc --b /src/tests --listEmittedFiles +TSFILE: /src/core/index.js +TSFILE: /src/core/index.d.ts.map +TSFILE: /src/core/index.d.ts +TSFILE: /src/core/tsconfig.tsbuildinfo +exitCode:: ExitStatus.Success + + +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; +var someClass2 = /** @class */ (function () { + function someClass2() { + } + return someClass2; +}()); + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "listEmittedFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js b/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js index 96f192f37765c..f0dd8ab79c1c5 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js @@ -1,4 +1,102 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --listFiles /lib/lib.d.ts /src/core/anotherModule.ts @@ -14,8 +112,8 @@ /src/logic/index.d.ts /src/tests/index.ts exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -256,3 +354,326 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: +/lib/tsc --b /src/tests --listFiles +/lib/lib.d.ts +/src/core/anotherModule.ts +/src/core/index.ts +/src/core/some_decl.d.ts +/lib/lib.d.ts +/src/core/index.d.ts +/src/core/anotherModule.d.ts +/src/logic/index.ts +/lib/lib.d.ts +/src/core/index.d.ts +/src/core/anotherModule.d.ts +/src/logic/index.d.ts +/src/tests/index.ts +exitCode:: ExitStatus.Success + + +//// [/src/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map + +//// [/src/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} + +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "listFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "listFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "listFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +class someClass2 { } + + + +Output:: +/lib/tsc --b /src/tests --listFiles +/lib/lib.d.ts +/src/core/anotherModule.ts +/src/core/index.ts +/src/core/some_decl.d.ts +exitCode:: ExitStatus.Success + + +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; +var someClass2 = /** @class */ (function () { + function someClass2() { + } + return someClass2; +}()); + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "listFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js index 0eca4604f6dde..82d71147e005a 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js @@ -1,4 +1,105 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.base.json] +{"compilerOptions":{"target":"es3"}} + +//// [/src/tests/tsconfig.json] +{ + "extends": "./tsconfig.base.json", "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -18,8 +119,8 @@ [12:01:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -191,24 +292,102 @@ var mod = require("../core/anotherModule"); exports.m = mod; +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "target": 0, + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-changes +Input:: //// [/src/tests/tsconfig.base.json] -{"compilerOptions":{"target":"es3"}} +{"compilerOptions":{}} -//// [/src/tests/tsconfig.json] -{ - "extends": "./tsconfig.base.json", "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - } -} + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' + +[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' +[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.base.json' + +[12:04:00 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents //// [/src/tests/tsconfig.tsbuildinfo] { "program": { @@ -240,7 +419,6 @@ exports.m = mod; } }, "options": { - "target": 0, "composite": true, "declaration": true, "forceConsistentCasingInFileNames": true, diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js b/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js index de8181610b633..4c29fd368109e 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js @@ -1,8 +1,117 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tests --clean -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/core/anotherModule.d.ts] + + +//// [/src/core/anotherModule.d.ts.map] + + +//// [/src/core/anotherModule.js] + + +//// [/src/core/anotherModule.ts] + + +//// [/src/core/index.d.ts] + + +//// [/src/core/index.d.ts.map] + + +//// [/src/core/index.js] + + +//// [/src/core/index.ts] + + +//// [/src/core/some_decl.d.ts] + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/core/tsconfig.tsbuildinfo] + + +//// [/src/logic/index.d.ts] + + +//// [/src/logic/index.js] +//// [/src/logic/index.js.map] + + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/logic/tsconfig.tsbuildinfo] + + +//// [/src/tests/index.d.ts] + + +//// [/src/tests/index.js] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/tests/tsconfig.tsbuildinfo] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/tests --clean +exitCode:: ExitStatus.Success + + //// [/src/core/anotherModule.d.ts] unlink //// [/src/core/anotherModule.d.ts.map] unlink //// [/src/core/anotherModule.js] unlink @@ -17,3 +126,14 @@ exitCode:: ExitStatus.Success //// [/src/tests/index.d.ts] unlink //// [/src/tests/index.js] unlink //// [/src/tests/tsconfig.tsbuildinfo] unlink + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tests --clean +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js b/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js index 6212d153248d4..895cc477a0f80 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js @@ -1,4 +1,102 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -33,8 +131,8 @@ readFiles:: { "/src/tests/tsconfig.tsbuildinfo": 1, "/src/tests/index.ts": 1, "/src/logic/index.d.ts": 1 -} - +} + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -547,3 +645,723 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' + +[12:04:00 AM] Building project '/src/core/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... + +[12:04:00 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js' is older than newest input 'src/core' + +[12:04:00 AM] Building project '/src/logic/tsconfig.json'... + +[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' + +[12:04:00 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success +readFiles:: { + "/src/tests/tsconfig.json": 1, + "/src/core/tsconfig.json": 1, + "/src/logic/tsconfig.json": 1, + "/src/core/tsconfig.tsbuildinfo": 1, + "/src/core/anotherModule.ts": 1, + "/src/core/index.ts": 1, + "/src/core/some_decl.d.ts": 1, + "/src/core/index.d.ts": 2, + "/src/logic/tsconfig.tsbuildinfo": 1, + "/src/logic/index.ts": 1, + "/src/core/anotherModule.d.ts": 1, + "/src/logic/index.d.ts": 1, + "/src/tests/tsconfig.tsbuildinfo": 1, + "/src/tests/index.ts": 1, + "/src/tests/index.d.ts": 1 +} + +//// [/src/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map + +//// [/src/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} + +//// [/src/core/index.d.ts.map.baseline.txt] +=================================================================== +JsFile: index.d.ts +mapUrl: index.d.ts.map +sourceRoot: +sources: index.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:/src/core/index.d.ts +sourceFile:index.ts +------------------------------------------------------------------- +>>>export declare const someString: string; +1 > +2 >^^^^^^^^^^^^^^^ +3 > ^^^^^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >export +3 > const +4 > someString +5 > : +6 > string = "HELLO WORLD" +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 16) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 22) Source(1, 14) + SourceIndex(0) +4 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) +5 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) +6 >Emitted(1, 40) Source(1, 48) + SourceIndex(0) +7 >Emitted(1, 41) Source(1, 49) + SourceIndex(0) +--- +>>>export declare function leftPad(s: string, n: number): string; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^^^^^^^^^^ +13> ^^-> +1-> + > +2 >export function +3 > leftPad +4 > ( +5 > s +6 > : +7 > string +8 > , +9 > n +10> : +11> number +12> ) { return s + n; } +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 25) Source(2, 17) + SourceIndex(0) +3 >Emitted(2, 32) Source(2, 24) + SourceIndex(0) +4 >Emitted(2, 33) Source(2, 25) + SourceIndex(0) +5 >Emitted(2, 34) Source(2, 26) + SourceIndex(0) +6 >Emitted(2, 36) Source(2, 28) + SourceIndex(0) +7 >Emitted(2, 42) Source(2, 34) + SourceIndex(0) +8 >Emitted(2, 44) Source(2, 36) + SourceIndex(0) +9 >Emitted(2, 45) Source(2, 37) + SourceIndex(0) +10>Emitted(2, 47) Source(2, 39) + SourceIndex(0) +11>Emitted(2, 53) Source(2, 45) + SourceIndex(0) +12>Emitted(2, 63) Source(2, 64) + SourceIndex(0) +--- +>>>export declare function multiply(a: number, b: number): number; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^^^^^^^^^^ +1-> + > +2 >export function +3 > multiply +4 > ( +5 > a +6 > : +7 > number +8 > , +9 > b +10> : +11> number +12> ) { return a * b; } +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 25) Source(3, 17) + SourceIndex(0) +3 >Emitted(3, 33) Source(3, 25) + SourceIndex(0) +4 >Emitted(3, 34) Source(3, 26) + SourceIndex(0) +5 >Emitted(3, 35) Source(3, 27) + SourceIndex(0) +6 >Emitted(3, 37) Source(3, 29) + SourceIndex(0) +7 >Emitted(3, 43) Source(3, 35) + SourceIndex(0) +8 >Emitted(3, 45) Source(3, 37) + SourceIndex(0) +9 >Emitted(3, 46) Source(3, 38) + SourceIndex(0) +10>Emitted(3, 48) Source(3, 40) + SourceIndex(0) +11>Emitted(3, 54) Source(3, 46) + SourceIndex(0) +12>Emitted(3, 64) Source(3, 65) + SourceIndex(0) +--- +>>>export declare class someClass { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^ +1 > + > + > +2 >export class +3 > someClass +1 >Emitted(4, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(4, 22) Source(5, 14) + SourceIndex(0) +3 >Emitted(4, 31) Source(5, 23) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > { } +1 >Emitted(5, 2) Source(5, 27) + SourceIndex(0) +--- +>>>//# sourceMappingURL=index.d.ts.map + +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/index.js.map.baseline.txt] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +class someClass2 { } + + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:07:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:07:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' + +[12:07:00 AM] Building project '/src/core/tsconfig.json'... + +[12:07:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... + +[12:07:00 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[12:07:00 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... + +[12:07:00 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[12:07:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success +readFiles:: { + "/src/tests/tsconfig.json": 1, + "/src/core/tsconfig.json": 1, + "/src/logic/tsconfig.json": 1, + "/src/core/tsconfig.tsbuildinfo": 1, + "/src/core/anotherModule.ts": 1, + "/src/core/index.ts": 1, + "/src/core/some_decl.d.ts": 1, + "/src/core/index.d.ts": 1, + "/src/logic/tsconfig.tsbuildinfo": 1, + "/src/tests/tsconfig.tsbuildinfo": 1 +} + +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.d.ts.map.baseline.txt] file written with same contents +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; +var someClass2 = /** @class */ (function () { + function someClass2() { + } + return someClass2; +}()); + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: when logic config changes declaration dir +Input:: +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationDir": "decls", + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:10:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:10:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/anotherModule.js' + +[12:10:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/decls/index.d.ts' does not exist + +[12:10:00 AM] Building project '/src/logic/tsconfig.json'... + +[12:10:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/logic' + +[12:10:00 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success +readFiles:: { + "/src/tests/tsconfig.json": 1, + "/src/core/tsconfig.json": 1, + "/src/logic/tsconfig.json": 1, + "/src/core/tsconfig.tsbuildinfo": 1, + "/src/logic/tsconfig.tsbuildinfo": 1, + "/src/logic/index.ts": 1, + "/src/core/index.d.ts": 1, + "/src/core/anotherModule.d.ts": 1, + "/src/tests/tsconfig.tsbuildinfo": 1, + "/src/tests/index.ts": 1, + "/src/logic/decls/index.d.ts": 1, + "/src/tests/index.d.ts": 1 +} + +//// [/src/logic/decls/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/index.js.map.baseline.txt] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationDir": "./decls", + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/decls/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/decls/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/decls/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/decls/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/decls/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:13:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:13:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/anotherModule.js' + +[12:13:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' + +[12:13:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' + +exitCode:: ExitStatus.Success +readFiles:: { + "/src/tests/tsconfig.json": 1, + "/src/core/tsconfig.json": 1, + "/src/logic/tsconfig.json": 1, + "/src/core/tsconfig.tsbuildinfo": 1, + "/src/logic/tsconfig.tsbuildinfo": 1, + "/src/tests/tsconfig.tsbuildinfo": 1 +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js index aac58a3f56560..cd113fbc18468 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js @@ -1,4 +1,62 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/core --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -8,8 +66,8 @@ [12:01:00 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -28,14 +86,86 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-changes +Input:: //// [/src/core/tsconfig.json] { "compilerOptions": { - "incremental": true, + "incremental": true, "declaration": true, "skipDefaultLibCheck": true } } + + +Output:: +/lib/tsc --b /src/core --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.d.ts' does not exist + +[12:04:00 AM] Building project '/src/core/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.d.ts] +export declare const World = "hello"; + + +//// [/src/core/anotherModule.js] file written with same contents +//// [/src/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; + + +//// [/src/core/index.js] file written with same contents //// [/src/core/tsconfig.tsbuildinfo] { "program": { @@ -63,6 +193,7 @@ exports.multiply = multiply; }, "options": { "incremental": true, + "declaration": true, "skipDefaultLibCheck": true, "configFilePath": "./tsconfig.json" }, diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js index 9af3e1cf132fe..b4396a7e58945 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js @@ -1,4 +1,103 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "esModuleInterop": false + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -18,8 +117,8 @@ [12:01:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -191,6 +290,77 @@ var mod = require("../core/anotherModule"); exports.m = mod; +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "esModuleInterop": false, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-changes +Input:: //// [/src/tests/tsconfig.json] { "references": [ @@ -203,10 +373,62 @@ exports.m = mod; "declaration": true, "forceConsistentCasingInFileNames": true, "skipDefaultLibCheck": true, - "esModuleInterop": false + "esModuleInterop": true } } + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' + +[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' + +[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json' + +[12:04:00 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +exports.__esModule = true; +exports.m = void 0; +var c = __importStar(require("../core/index")); +var logic = __importStar(require("../logic/index")); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = __importStar(require("../core/anotherModule")); +exports.m = mod; + + //// [/src/tests/tsconfig.tsbuildinfo] { "program": { @@ -242,7 +464,7 @@ exports.m = mod; "declaration": true, "forceConsistentCasingInFileNames": true, "skipDefaultLibCheck": true, - "esModuleInterop": false, + "esModuleInterop": true, "configFilePath": "./tsconfig.json" }, "referencedMap": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-logic-specifies-tsBuildInfoFile.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-logic-specifies-tsBuildInfoFile.js index 4884d46e47ee0..d8ca4ee482d19 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-logic-specifies-tsBuildInfoFile.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-logic-specifies-tsBuildInfoFile.js @@ -1,4 +1,103 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "ownFile.tsbuildinfo", + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -33,8 +132,8 @@ readFiles:: { "/src/tests/tsconfig.tsbuildinfo": 1, "/src/tests/index.ts": 1, "/src/logic/index.d.ts": 1 -} - +} + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -465,22 +564,6 @@ sourceFile:index.ts "version": "FakeTSVersion" } -//// [/src/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "tsBuildInfoFile": "ownFile.tsbuildinfo", - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - //// [/src/tests/index.d.ts] import * as mod from '../core/anotherModule'; export declare const m: typeof mod; diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js index 94ae61d2a9057..d381b6f5d29a8 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js @@ -1,4 +1,62 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "module": "commonjs" + } +} + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/core --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -8,8 +66,8 @@ [12:01:00 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -28,14 +86,96 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "module": 1, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-changes +Input:: //// [/src/core/tsconfig.json] { "compilerOptions": { "incremental": true, - "module": "commonjs" + "module": "amd" } } + + +Output:: +/lib/tsc --b /src/core --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' + +[12:04:00 AM] Building project '/src/core/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + exports.__esModule = true; + exports.World = void 0; + exports.World = "hello"; +}); + + +//// [/src/core/index.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + exports.__esModule = true; + exports.multiply = exports.leftPad = exports.someString = void 0; + exports.someString = "HELLO WORLD"; + function leftPad(s, n) { return s + n; } + exports.leftPad = leftPad; + function multiply(a, b) { return a * b; } + exports.multiply = multiply; +}); + + //// [/src/core/tsconfig.tsbuildinfo] { "program": { @@ -63,7 +203,7 @@ exports.multiply = multiply; }, "options": { "incremental": true, - "module": 1, + "module": 2, "configFilePath": "./tsconfig.json" }, "referencedMap": {}, diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js index 75961f46ab3cd..8c02694d28772 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js @@ -1,23 +1,4 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/core --verbose -[12:01:00 AM] Projects in this build: - * src/core/tsconfig.json - -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist - -[12:01:00 AM] Building project '/src/core/tsconfig.json'... - -TSFILE: /src/core/anotherModule.js -TSFILE: /src/core/index.js -TSFILE: /src/core/tsconfig.tsbuildinfo -/lib/lib.esnext.d.ts -/lib/lib.esnext.full.d.ts -/src/core/anotherModule.ts -/src/core/index.ts -/src/core/some_decl.d.ts -exitCode:: ExitStatus.Success - - +Input:: //// [/lib/lib.d.ts] /// /// @@ -41,14 +22,18 @@ declare const console: { log(msg: any): void; }; /// /// -//// [/src/core/anotherModule.js] +//// [/src/core/anotherModule.ts] export const World = "hello"; -//// [/src/core/index.js] -export const someString = "HELLO WORLD"; -export function leftPad(s, n) { return s + n; } -export function multiply(a, b) { return a * b; } +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] @@ -61,6 +46,56 @@ export function multiply(a, b) { return a * b; } } } +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/core --verbose +[12:01:00 AM] Projects in this build: + * src/core/tsconfig.json + +[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist + +[12:01:00 AM] Building project '/src/core/tsconfig.json'... + +TSFILE: /src/core/anotherModule.js +TSFILE: /src/core/index.js +TSFILE: /src/core/tsconfig.tsbuildinfo +/lib/lib.esnext.d.ts +/lib/lib.esnext.full.d.ts +/src/core/anotherModule.ts +/src/core/index.ts +/src/core/some_decl.d.ts +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.js] +export const World = "hello"; + + +//// [/src/core/index.js] +export const someString = "HELLO WORLD"; +export function leftPad(s, n) { return s + n; } +export function multiply(a, b) { return a * b; } + + //// [/src/core/tsconfig.tsbuildinfo] { "program": { @@ -111,3 +146,107 @@ export function multiply(a, b) { return a * b; } "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, +"listFiles": true, +"listEmittedFiles": true, + "target": "es5", + } +} + + + +Output:: +/lib/tsc --b /src/core --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' + +[12:04:00 AM] Building project '/src/core/tsconfig.json'... + +TSFILE: /src/core/anotherModule.js +TSFILE: /src/core/index.js +TSFILE: /src/core/tsconfig.tsbuildinfo +/lib/lib.d.ts +/lib/lib.esnext.d.ts +/src/core/anotherModule.ts +/src/core/index.ts +/src/core/some_decl.d.ts +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + + +//// [/src/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "8926001564-/// \n/// ", + "signature": "8926001564-/// \n/// ", + "affectsGlobalScope": false + }, + "../../lib/lib.esnext.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "listFiles": true, + "listEmittedFiles": true, + "target": 1, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../../lib/lib.esnext.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js deleted file mode 100644 index 447a8dbcc1f5d..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --b /src/tests --force -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.d.ts] file written with same contents -//// [/src/core/anotherModule.d.ts.map] file written with same contents -//// [/src/core/anotherModule.js] file written with same contents -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.js] file written with same contents -//// [/src/core/tsconfig.tsbuildinfo] file written with same contents -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] file written with same contents diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js deleted file mode 100644 index b0b052304a231..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --b /src/tests --clean -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js deleted file mode 100644 index ac7c9eb5d8614..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js +++ /dev/null @@ -1,23 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --b /src/tests --verbose -[12:16:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:16:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' - -[12:16:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' - -[12:16:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' - -exitCode:: ExitStatus.Success -readFiles:: { - "/src/tests/tsconfig.json": 1, - "/src/core/tsconfig.json": 1, - "/src/logic/tsconfig.json": 1, - "/src/core/tsconfig.tsbuildinfo": 1, - "/src/logic/tsconfig.tsbuildinfo": 1, - "/src/tests/tsconfig.tsbuildinfo": 1 -} - diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js index 0e68255cabfe1..074880d05ba20 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js @@ -1,4 +1,61 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/a.ts] +export class A {} + + +//// [/src/b.ts] +import {A} from 'a'; +export const b = new A(); + +//// [/src/c.ts] +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; + +//// [/src/refs/a.d.ts] +export class X {} +export class A {} + + +//// [/src/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + +//// [/src/tsconfig.b.json] +{"compilerOptions":{"composite":true,"moduleResolution":"classic"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} + +//// [/src/tsconfig.c.json] +{ + "files": [ "c.ts" ], + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@ref/*": [ "./refs/*" ] + } + }, + "references": [ { "path": "tsconfig.b.json" } ] +} + + + + +Output:: /lib/tsc --b /src/tsconfig.c.json --listFiles /lib/lib.d.ts /src/a.ts @@ -11,8 +68,8 @@ /src/refs/a.d.ts /src/c.ts exitCode:: ExitStatus.Success - - + + //// [/src/a.d.ts] export declare class A { } @@ -43,10 +100,6 @@ var a_1 = require("a"); exports.b = new a_1.A(); -//// [/src/b.ts] -import {A} from 'a'; -export const b = new A(); - //// [/src/c.js] "use strict"; exports.__esModule = true; @@ -86,9 +139,6 @@ a_1.X; "version": "FakeTSVersion" } -//// [/src/tsconfig.b.json] -{"compilerOptions":{"composite":true,"moduleResolution":"classic"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} - //// [/src/tsconfig.b.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly.js b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly.js index f80b631171b88..42a9feff5eec9 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly.js @@ -1,4 +1,73 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/a.ts] +export class A {} + + +//// [/src/b.ts] +import {A} from '@ref/a'; +export const b = new A(); + + +//// [/src/c.ts] +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; + +//// [/src/refs/a.d.ts] +export class X {} +export class A {} + + +//// [/src/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + +//// [/src/tsconfig.b.json] +{ + "compilerOptions": { + "composite": true, + "baseUrl": "./", + "paths": { + "@ref/*": [ "./*" ] + } + }, + "files": [ "b.ts" ], + "references": [ { "path": "tsconfig.a.json" } ] +} + + +//// [/src/tsconfig.c.json] +{ + "files": [ "c.ts" ], + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@ref/*": [ "./refs/*" ] + } + }, + "references": [ { "path": "tsconfig.b.json" } ] +} + + + + +Output:: /lib/tsc --b /src/tsconfig.c.json --listFiles /lib/lib.d.ts /src/a.ts @@ -11,8 +80,8 @@ /src/refs/a.d.ts /src/c.ts exitCode:: ExitStatus.Success - - + + //// [/src/a.d.ts] export declare class A { } diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js index 5430929d96f66..10a5f43474c07 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js @@ -1,4 +1,56 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/a.ts] +export class A {} + + +//// [/src/b.ts] +import {A} from 'a'; +export const b = new A(); + +//// [/src/c.ts] + + +//// [/src/refs/a.d.ts] + + +//// [/src/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + +//// [/src/tsconfig.b.json] +{"compilerOptions":{"composite":true,"moduleResolution":"node"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} + +//// [/src/tsconfig.c.json] +{ + "files": [ "c.ts" ], + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@ref/*": [ "./refs/*" ] + } + }, + "references": [ { "path": "tsconfig.b.json" } ] +} + + + + +Output:: /lib/tsc --b /src/tsconfig.c.json --listFiles /lib/lib.d.ts /src/a.ts @@ -13,8 +65,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/a.d.ts] export declare class A { } @@ -32,10 +84,6 @@ var A = /** @class */ (function () { exports.A = A; -//// [/src/b.ts] -import {A} from 'a'; -export const b = new A(); - //// [/src/tsconfig.a.tsbuildinfo] { "program": { @@ -66,6 +114,3 @@ export const b = new A(); "version": "FakeTSVersion" } -//// [/src/tsconfig.b.json] -{"compilerOptions":{"composite":true,"moduleResolution":"node"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} - diff --git a/tests/baselines/reference/tsbuild/watchMode/configFileErrors/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/watchMode/configFileErrors/reports-syntax-errors-in-config-file.js index 3503ac50610c1..b97c1cad60c6c 100644 --- a/tests/baselines/reference/tsbuild/watchMode/configFileErrors/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/watchMode/configFileErrors/reports-syntax-errors-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --b -w +Input:: //// [/user/username/projects/myproject/a.ts] export function foo() { } @@ -30,6 +30,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } +/a/lib/tsc.js --b -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -68,8 +69,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: reports syntax errors after change to config file +Input:: //// [/user/username/projects/myproject/tsconfig.json] { "compilerOptions": { @@ -121,8 +124,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: reports syntax errors after change to ts file +Input:: //// [/user/username/projects/myproject/a.ts] export function fooBar() { } @@ -165,8 +170,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: reports error when there is no change to tsconfig file +Input:: //// [/user/username/projects/myproject/tsconfig.json] file written with same contents Output:: @@ -207,11 +214,49 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: builds after fixing config file errors +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"composite":true,"declaration":true},"files":["a.ts","b.ts"]} + +Output:: +>> Screen clear +[12:00:43 AM] File change detected. Starting incremental compilation... + + +[12:00:54 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/a.js] "use strict"; exports.__esModule = true; @@ -273,38 +318,3 @@ export declare function bar(): void; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... - - -[12:00:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/a.ts -/user/username/projects/myproject/b.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/a.ts -/user/username/projects/myproject/b.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js index f598c1b8cc8a1..a22633150842a 100644 --- a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js +++ b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose +Input:: //// [/user/username/projects/demo/core/tsconfig.json] { "extends": "../tsconfig-base.json", @@ -143,6 +143,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js -b -w -verbose Output:: >> Screen clear [12:00:46 AM] Starting compilation in watch mode... @@ -267,8 +268,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Prepend a line +Input:: //// [/user/username/projects/demo/core/utilities.ts] import * as A from '../animals'; @@ -385,3 +388,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/demo/zoo","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js index fff5bf9d47fab..fb9c967dde619 100644 --- a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js +++ b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose +Input:: //// [/user/username/projects/demo/core/tsconfig.json] { "extends": "../tsconfig-base.json", @@ -147,6 +147,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js -b -w -verbose Output:: >> Screen clear [12:00:46 AM] Starting compilation in watch mode... @@ -201,8 +202,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix error +Input:: //// [/user/username/projects/demo/core/tsconfig.json] { "extends": "../tsconfig-base.json", @@ -212,6 +215,108 @@ Change:: Fix error } } + +Output:: +>> Screen clear +[12:00:52 AM] File change detected. Starting incremental compilation... + + +[12:00:53 AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/utilities.js' does not exist + + +[12:00:54 AM] Building project '/user/username/projects/demo/core/tsconfig.json'... + + +[12:01:06 AM] Project 'animals/tsconfig.json' is out of date because output file 'lib/animals/animal.js' does not exist + + +[12:01:07 AM] Building project '/user/username/projects/demo/animals/tsconfig.json'... + + +[12:01:25 AM] Project 'zoo/tsconfig.json' is out of date because output file 'lib/zoo/zoo.js' does not exist + + +[12:01:26 AM] Building project '/user/username/projects/demo/zoo/tsconfig.json'... + + +[12:01:36 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/demo/core/utilities.ts"] +Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/core","rootDir":"/user/username/projects/demo/core","watch":true,"configFilePath":"/user/username/projects/demo/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/demo/core/utilities.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/demo/core/utilities.ts + +Program root files: ["/user/username/projects/demo/animals/animal.ts","/user/username/projects/demo/animals/dog.ts","/user/username/projects/demo/animals/index.ts"] +Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/animals","rootDir":"/user/username/projects/demo/animals","watch":true,"configFilePath":"/user/username/projects/demo/animals/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/demo/animals/animal.ts +/user/username/projects/demo/animals/index.ts +/user/username/projects/demo/lib/core/utilities.d.ts +/user/username/projects/demo/animals/dog.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/demo/animals/animal.ts +/user/username/projects/demo/animals/index.ts +/user/username/projects/demo/lib/core/utilities.d.ts +/user/username/projects/demo/animals/dog.ts + +Program root files: ["/user/username/projects/demo/zoo/zoo.ts"] +Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/zoo","rootDir":"/user/username/projects/demo/zoo","watch":true,"configFilePath":"/user/username/projects/demo/zoo/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/demo/lib/animals/animal.d.ts +/user/username/projects/demo/lib/animals/dog.d.ts +/user/username/projects/demo/lib/animals/index.d.ts +/user/username/projects/demo/zoo/zoo.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/demo/lib/animals/animal.d.ts +/user/username/projects/demo/lib/animals/dog.d.ts +/user/username/projects/demo/lib/animals/index.d.ts +/user/username/projects/demo/zoo/zoo.ts + +WatchedFiles:: +/user/username/projects/demo/animals/tsconfig.json: + {"fileName":"/user/username/projects/demo/animals/tsconfig.json","pollingInterval":250} +/user/username/projects/demo/animals/animal.ts: + {"fileName":"/user/username/projects/demo/animals/animal.ts","pollingInterval":250} +/user/username/projects/demo/animals/dog.ts: + {"fileName":"/user/username/projects/demo/animals/dog.ts","pollingInterval":250} +/user/username/projects/demo/animals/index.ts: + {"fileName":"/user/username/projects/demo/animals/index.ts","pollingInterval":250} +/user/username/projects/demo/zoo/tsconfig.json: + {"fileName":"/user/username/projects/demo/zoo/tsconfig.json","pollingInterval":250} +/user/username/projects/demo/zoo/zoo.ts: + {"fileName":"/user/username/projects/demo/zoo/zoo.ts","pollingInterval":250} +/user/username/projects/demo/core/tsconfig.json: + {"fileName":"/user/username/projects/demo/core/tsconfig.json","pollingInterval":250} +/user/username/projects/demo/core/utilities.ts: + {"fileName":"/user/username/projects/demo/core/utilities.ts","pollingInterval":250} +/user/username/projects/demo/tsconfig.json: + {"fileName":"/user/username/projects/demo/tsconfig.json","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/demo/animals: + {"directoryName":"/user/username/projects/demo/animals","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/demo/zoo: + {"directoryName":"/user/username/projects/demo/zoo","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/demo/core: + {"directoryName":"/user/username/projects/demo/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/demo/lib/core/utilities.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -500,104 +605,3 @@ export declare function createZoo(): Array; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:52 AM] File change detected. Starting incremental compilation... - - -[12:00:53 AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/utilities.js' does not exist - - -[12:00:54 AM] Building project '/user/username/projects/demo/core/tsconfig.json'... - - -[12:01:06 AM] Project 'animals/tsconfig.json' is out of date because output file 'lib/animals/animal.js' does not exist - - -[12:01:07 AM] Building project '/user/username/projects/demo/animals/tsconfig.json'... - - -[12:01:25 AM] Project 'zoo/tsconfig.json' is out of date because output file 'lib/zoo/zoo.js' does not exist - - -[12:01:26 AM] Building project '/user/username/projects/demo/zoo/tsconfig.json'... - - -[12:01:36 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/demo/core/utilities.ts"] -Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/core","rootDir":"/user/username/projects/demo/core","watch":true,"configFilePath":"/user/username/projects/demo/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/demo/core/utilities.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/demo/core/utilities.ts - -Program root files: ["/user/username/projects/demo/animals/animal.ts","/user/username/projects/demo/animals/dog.ts","/user/username/projects/demo/animals/index.ts"] -Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/animals","rootDir":"/user/username/projects/demo/animals","watch":true,"configFilePath":"/user/username/projects/demo/animals/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/demo/animals/animal.ts -/user/username/projects/demo/animals/index.ts -/user/username/projects/demo/lib/core/utilities.d.ts -/user/username/projects/demo/animals/dog.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/demo/animals/animal.ts -/user/username/projects/demo/animals/index.ts -/user/username/projects/demo/lib/core/utilities.d.ts -/user/username/projects/demo/animals/dog.ts - -Program root files: ["/user/username/projects/demo/zoo/zoo.ts"] -Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/zoo","rootDir":"/user/username/projects/demo/zoo","watch":true,"configFilePath":"/user/username/projects/demo/zoo/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/demo/lib/animals/animal.d.ts -/user/username/projects/demo/lib/animals/dog.d.ts -/user/username/projects/demo/lib/animals/index.d.ts -/user/username/projects/demo/zoo/zoo.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/demo/lib/animals/animal.d.ts -/user/username/projects/demo/lib/animals/dog.d.ts -/user/username/projects/demo/lib/animals/index.d.ts -/user/username/projects/demo/zoo/zoo.ts - -WatchedFiles:: -/user/username/projects/demo/animals/tsconfig.json: - {"fileName":"/user/username/projects/demo/animals/tsconfig.json","pollingInterval":250} -/user/username/projects/demo/animals/animal.ts: - {"fileName":"/user/username/projects/demo/animals/animal.ts","pollingInterval":250} -/user/username/projects/demo/animals/dog.ts: - {"fileName":"/user/username/projects/demo/animals/dog.ts","pollingInterval":250} -/user/username/projects/demo/animals/index.ts: - {"fileName":"/user/username/projects/demo/animals/index.ts","pollingInterval":250} -/user/username/projects/demo/zoo/tsconfig.json: - {"fileName":"/user/username/projects/demo/zoo/tsconfig.json","pollingInterval":250} -/user/username/projects/demo/zoo/zoo.ts: - {"fileName":"/user/username/projects/demo/zoo/zoo.ts","pollingInterval":250} -/user/username/projects/demo/core/tsconfig.json: - {"fileName":"/user/username/projects/demo/core/tsconfig.json","pollingInterval":250} -/user/username/projects/demo/core/utilities.ts: - {"fileName":"/user/username/projects/demo/core/utilities.ts","pollingInterval":250} -/user/username/projects/demo/tsconfig.json: - {"fileName":"/user/username/projects/demo/tsconfig.json","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/demo/animals: - {"directoryName":"/user/username/projects/demo/animals","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/demo/zoo: - {"directoryName":"/user/username/projects/demo/zoo","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/demo/core: - {"directoryName":"/user/username/projects/demo/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js new file mode 100644 index 0000000000000..49d3e41dac119 --- /dev/null +++ b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js @@ -0,0 +1,567 @@ +Input:: +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -w -verbose --incremental +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +[12:00:32 AM] Projects in this build: + * tsconfig.json + + +[12:00:33 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:34 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:35 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:39 AM] File change detected. Starting incremental compilation... + + +[12:00:40 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:41 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:42 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +Output:: +>> Screen clear +[12:00:46 AM] File change detected. Starting incremental compilation... + + +[12:00:47 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:48 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:07 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:11 AM] File change detected. Starting incremental compilation... + + +[12:01:12 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:13 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + + +[12:01:19 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:20 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:21 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... + + +[12:01:26 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:27 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:35 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:36 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:40 AM] File change detected. Starting incremental compilation... + + +[12:01:41 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:42 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:44 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:45 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js index 3eb6fcf4cef41..3f9230a5b4505 100644 --- a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js +++ b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose +Input:: //// [/user/username/projects/noEmitOnError/tsconfig.json] { "compilerOptions": { @@ -39,6 +39,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js -b -w -verbose Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -97,14 +98,124 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:39 AM] File change detected. Starting incremental compilation... + + +[12:00:40 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:41 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:42 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:46 AM] File change detected. Starting incremental compilation... + + +[12:00:47 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:48 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:05 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -125,18 +236,88 @@ console.log("hi"); +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:39 AM] File change detected. Starting incremental compilation... +[12:01:09 AM] File change detected. Starting incremental compilation... -[12:00:40 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist +[12:01:10 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' -[12:00:41 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:11 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:12 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:16 AM] File change detected. Starting incremental compilation... + + +[12:01:17 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:18 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ -[12:00:58 AM] Found 0 errors. Watching for file changes. +[12:01:19 AM] Found 1 error. Watching for file changes. @@ -149,11 +330,63 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:23 AM] File change detected. Starting incremental compilation... + + +[12:01:24 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:25 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:30 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:31 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: /a/lib/lib.d.ts /user/username/projects/noEmitOnError/shared/types/db.ts /user/username/projects/noEmitOnError/src/main.ts /user/username/projects/noEmitOnError/src/other.ts +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} @@ -171,3 +404,67 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:35 AM] File change detected. Starting incremental compilation... + + +[12:01:36 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:37 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:39 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:40 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/creates-solution-in-watch-mode.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/creates-solution-in-watch-mode.js index 5fd42a03d2b1e..cd80c65f8063e 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/creates-solution-in-watch-mode.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/creates-solution-in-watch-mode.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -335,80 +414,3 @@ export declare const m: typeof mod; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... - - -[12:01:14 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/incremental-updates-in-verbose-mode.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/incremental-updates-in-verbose-mode.js index e6d02561f46e7..a3e8d46335c00 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/incremental-updates-in-verbose-mode.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/incremental-updates-in-verbose-mode.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests -verbose +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,109 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests -verbose +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:00:46 AM] Projects in this build: + * sample1/core/tsconfig.json + * sample1/logic/tsconfig.json + * sample1/tests/tsconfig.json + + +[12:00:47 AM] Project 'sample1/core/tsconfig.json' is out of date because output file 'sample1/core/anotherModule.js' does not exist + + +[12:00:48 AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + + +[12:01:03 AM] Project 'sample1/logic/tsconfig.json' is out of date because output file 'sample1/logic/index.js' does not exist + + +[12:01:04 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + + +[12:01:13 AM] Project 'sample1/tests/tsconfig.json' is out of date because output file 'sample1/tests/index.js' does not exist + + +[12:01:14 AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,51 +439,41 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... - +Change:: Make non dts change -[12:00:46 AM] Projects in this build: - * sample1/core/tsconfig.json - * sample1/logic/tsconfig.json - * sample1/tests/tsconfig.json +Input:: +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +function someFn() { } -[12:00:47 AM] Project 'sample1/core/tsconfig.json' is out of date because output file 'sample1/core/anotherModule.js' does not exist - -[12:00:48 AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... -[12:01:03 AM] Project 'sample1/logic/tsconfig.json' is out of date because output file 'sample1/logic/index.js' does not exist +[12:01:26 AM] Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core' -[12:01:04 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... +[12:01:27 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... -[12:01:13 AM] Project 'sample1/tests/tsconfig.json' is out of date because output file 'sample1/tests/index.js' does not exist +[12:01:40 AM] Project 'sample1/tests/tsconfig.json' is up to date with .d.ts files from its dependencies -[12:01:14 AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... +[12:01:42 AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... -[12:01:21 AM] Found 0 errors. Watching for file changes. +[12:01:43 AM] Found 0 errors. Watching for file changes. -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: @@ -390,27 +483,8 @@ Program files:: /user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts /user/username/projects/sample1/logic/index.ts -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -437,18 +511,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make non dts change - -//// [/user/username/projects/sample1/logic/index.ts] -import * as c from '../core/index'; -export function getSecondsInDay() { - return c.multiply(10, 15); -} -import * as mod from '../core/anotherModule'; -export const m = mod; - -function someFn() { } - //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AAErB,SAAS,MAAM,KAAK,CAAC"} @@ -526,24 +588,38 @@ function someFn() { } //// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Change:: Make dts change + +Input:: +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + +export function someFn() { } + + Output:: >> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... +[12:01:47 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core' +[12:01:48 AM] Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core' -[12:01:27 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... +[12:01:49 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... -[12:01:40 AM] Project 'sample1/tests/tsconfig.json' is up to date with .d.ts files from its dependencies +[12:02:02 AM] Project 'sample1/tests/tsconfig.json' is out of date because oldest output 'sample1/tests/index.js' is older than newest input 'sample1/logic/tsconfig.json' -[12:01:42 AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... +[12:02:03 AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... -[12:01:43 AM] Found 0 errors. Watching for file changes. +[12:02:13 AM] Found 0 errors. Watching for file changes. @@ -558,6 +634,19 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/logic/index.ts +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -584,18 +673,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make dts change - -//// [/user/username/projects/sample1/logic/index.ts] -import * as c from '../core/index'; -export function getSecondsInDay() { - return c.multiply(10, 15); -} -import * as mod from '../core/anotherModule'; -export const m = mod; - -export function someFn() { } - //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AAErB,SAAgB,MAAM,KAAK,CAAC;AAA5B,wBAA4B"} @@ -745,74 +822,3 @@ export declare function someFn(): void; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:01:47 AM] File change detected. Starting incremental compilation... - - -[12:01:48 AM] Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core' - - -[12:01:49 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... - - -[12:02:02 AM] Project 'sample1/tests/tsconfig.json' is out of date because oldest output 'sample1/tests/index.js' is older than newest input 'sample1/logic/tsconfig.json' - - -[12:02:03 AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... - - -[12:02:13 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js index d66ab70fb50b8..c2315cd4bfe5d 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w app +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -24,6 +24,45 @@ export class myClass { } //// [/user/username/projects/solution/app/tsconfig.json] {"compilerOptions":{"composite":true}} + +/a/lib/tsc.js -b -w app +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:36 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] +Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +WatchedFiles:: +/user/username/projects/solution/app/tsconfig.json: + {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} +/user/username/projects/solution/app/filewitherror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} +/user/username/projects/solution/app/filewithouterror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/solution/app: + {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/solution/app/fileWithError.js] "use strict"; exports.__esModule = true; @@ -98,45 +137,9 @@ export declare class myClass { } -Output:: ->> Screen clear -[12:00:25 AM] Starting compilation in watch mode... - - -[12:00:36 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] -Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -WatchedFiles:: -/user/username/projects/solution/app/tsconfig.json: - {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} -/user/username/projects/solution/app/filewitherror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} -/user/username/projects/solution/app/filewithouterror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/solution/app: - {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Introduce error +Input:: //// [/user/username/projects/solution/app/fileWithError.ts] export var myClassWithError = class { tags() { } @@ -185,8 +188,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Change fileWithoutError +Input:: //// [/user/username/projects/solution/app/fileWithoutError.ts] export class myClass2 { } @@ -231,3 +236,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js index 223193c538321..23ac559509ecf 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w app +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -24,6 +24,45 @@ export class myClass { } //// [/user/username/projects/solution/app/tsconfig.json] {"compilerOptions":{"composite":true}} + +/a/lib/tsc.js -b -w app +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:36 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] +Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +WatchedFiles:: +/user/username/projects/solution/app/tsconfig.json: + {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} +/user/username/projects/solution/app/filewitherror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} +/user/username/projects/solution/app/filewithouterror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/solution/app: + {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/solution/app/fileWithError.js] "use strict"; exports.__esModule = true; @@ -98,45 +137,9 @@ export declare class myClass { } -Output:: ->> Screen clear -[12:00:25 AM] Starting compilation in watch mode... - - -[12:00:36 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] -Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -WatchedFiles:: -/user/username/projects/solution/app/tsconfig.json: - {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} -/user/username/projects/solution/app/filewitherror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} -/user/username/projects/solution/app/filewithouterror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/solution/app: - {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Introduce error +Input:: //// [/user/username/projects/solution/app/fileWithError.ts] export var myClassWithError = class { tags() { } @@ -185,19 +188,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix error in fileWithError +Input:: //// [/user/username/projects/solution/app/fileWithError.ts] export var myClassWithError = class { tags() { } }; -//// [/user/username/projects/solution/app/fileWithError.js] file written with same contents -//// [/user/username/projects/solution/app/fileWithError.d.ts] file written with same contents -//// [/user/username/projects/solution/app/fileWithoutError.js] file changed its modified time -//// [/user/username/projects/solution/app/fileWithoutError.d.ts] file changed its modified time -//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] file written with same contents Output:: >> Screen clear @@ -233,3 +233,9 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/solution/app/fileWithError.js] file written with same contents +//// [/user/username/projects/solution/app/fileWithError.d.ts] file written with same contents +//// [/user/username/projects/solution/app/fileWithoutError.js] file changed its modified time +//// [/user/username/projects/solution/app/fileWithoutError.d.ts] file changed its modified time +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] file written with same contents diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js index c160065ad043b..a8ad89b91a7de 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w app +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -25,6 +25,7 @@ export class myClass { } {"compilerOptions":{"composite":true}} +/a/lib/tsc.js -b -w app Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -68,8 +69,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Change fileWithoutError +Input:: //// [/user/username/projects/solution/app/fileWithoutError.ts] export class myClass2 { } @@ -114,3 +117,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js index 84345785f33a5..4b4808833f4a3 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w app +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -25,6 +25,7 @@ export class myClass { } {"compilerOptions":{"composite":true}} +/a/lib/tsc.js -b -w app Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -68,14 +69,52 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix error in fileWithError +Input:: //// [/user/username/projects/solution/app/fileWithError.ts] export var myClassWithError = class { tags() { } }; + +Output:: +>> Screen clear +[12:00:30 AM] File change detected. Starting incremental compilation... + + +[12:00:41 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] +Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/solution/app/fileWithError.ts + +WatchedFiles:: +/user/username/projects/solution/app/tsconfig.json: + {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} +/user/username/projects/solution/app/filewitherror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} +/user/username/projects/solution/app/filewithouterror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/solution/app: + {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/solution/app/fileWithError.js] "use strict"; exports.__esModule = true; @@ -149,38 +188,3 @@ export declare class myClass { "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:30 AM] File change detected. Starting incremental compilation... - - -[12:00:41 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] -Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/solution/app/fileWithError.ts - -WatchedFiles:: -/user/username/projects/solution/app/tsconfig.json: - {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} -/user/username/projects/solution/app/filewitherror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} -/user/username/projects/solution/app/filewithouterror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/solution/app: - {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js index c4cf7aea6bdc4..bc2e4ee3c41c9 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,85 +415,9 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... - - -[12:01:14 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: change logic +Input:: //// [/user/username/projects/sample1/logic/index.ts] import * as c from '../core/index'; export function getSecondsInDay() { @@ -478,8 +481,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: change core +Input:: //// [/user/username/projects/sample1/core/index.ts] export const someString: string = "HELLO WORLD"; export function leftPad(s: string, n: number) { return s + n; } @@ -544,3 +549,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js index f836aad9bfcf8..093a9c384ccd0 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests --preserveWatchOutput +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,84 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests --preserveWatchOutput +Output:: +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -339,84 +417,9 @@ export declare const m: typeof mod; } -Output:: -[12:00:45 AM] Starting compilation in watch mode... - - -[12:01:14 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: change logic +Input:: //// [/user/username/projects/sample1/logic/index.ts] import * as c from '../core/index'; export function getSecondsInDay() { @@ -479,8 +482,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: change core +Input:: //// [/user/username/projects/sample1/core/index.ts] export const someString: string = "HELLO WORLD"; export function leftPad(s: string, n: number) { return s + n; } @@ -544,3 +549,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/watches-config-files-that-are-not-present.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/watches-config-files-that-are-not-present.js index e14efa913b00a..eec0beb497d5e 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/watches-config-files-that-are-not-present.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/watches-config-files-that-are-not-present.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -67,6 +67,54 @@ import * as mod from '../core/anotherModule'; export const m = mod; + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +error TS5083: Cannot read file '/user/username/projects/sample1/logic/tsconfig.json'. + + +[12:00:52 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -141,29 +189,44 @@ export declare function multiply(a: number, b: number): number; } -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - +Change:: Write logic tsconfig and build logic -error TS5083: Cannot read file '/user/username/projects/sample1/logic/tsconfig.json'. - +Input:: +//// [/user/username/projects/sample1/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} -[12:00:52 AM] Found 1 error. Watching for file changes. + + +Output:: +>> Screen clear +[12:00:55 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -178,32 +241,19 @@ WatchedFiles:: {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} /user/username/projects/sample1/tests/index.ts: {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} FsWatches:: FsWatchesRecursive:: /user/username/projects/sample1/core: {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined -Change:: Write logic tsconfig and build logic - -//// [/user/username/projects/sample1/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} @@ -282,25 +332,30 @@ export declare const m: typeof mod; } +Change:: Build Tests + +Input:: + Output:: ->> Screen clear -[12:00:55 AM] File change detected. Starting incremental compilation... +[12:01:10 AM] Found 0 errors. Watching for file changes. -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -328,8 +383,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build tests - //// [/user/username/projects/sample1/tests/index.js] "use strict"; exports.__esModule = true; @@ -414,50 +467,3 @@ export declare const m: typeof mod; "version": "FakeTSVersion" } - -Output:: -[12:01:10 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js index c565eae22341d..62fc2cb496bc0 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w App +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -36,6 +36,59 @@ createSomeObject().message; //// [/user/username/projects/sample1/App/tsconfig.json] {"references":[{"path":"../Library"}]} + +/a/lib/tsc.js -b -w App +Output:: +>> Screen clear +[12:00:29 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/Library/library.ts"] +Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/sample1/Library/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/Library/library.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/Library/library.ts + +Program root files: ["/user/username/projects/sample1/App/app.ts"] +Program options: {"watch":true,"configFilePath":"/user/username/projects/sample1/App/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/Library/library.d.ts +/user/username/projects/sample1/App/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/Library/library.d.ts +/user/username/projects/sample1/App/app.ts + +WatchedFiles:: +/user/username/projects/sample1/library/tsconfig.json: + {"fileName":"/user/username/projects/sample1/Library/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/library/library.ts: + {"fileName":"/user/username/projects/sample1/Library/library.ts","pollingInterval":250} +/user/username/projects/sample1/app/tsconfig.json: + {"fileName":"/user/username/projects/sample1/App/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/app/app.ts: + {"fileName":"/user/username/projects/sample1/App/app.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/library: + {"directoryName":"/user/username/projects/sample1/library","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/app: + {"directoryName":"/user/username/projects/sample1/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/Library/library.js] "use strict"; exports.__esModule = true; @@ -94,12 +147,41 @@ library_1.createSomeObject().message; +Change:: Introduce error + +Input:: +//// [/user/username/projects/sample1/Library/library.ts] + +interface SomeObject +{ + message2: string; +} + +export function createSomeObject(): SomeObject +{ + return { + message2: "new Object" + }; +} + + Output:: >> Screen clear -[12:00:29 AM] Starting compilation in watch mode... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:38 AM] Found 0 errors. Watching for file changes. +App/app.ts:2:20 - error TS2551: Property 'message' does not exist on type 'SomeObject'. Did you mean 'message2'? + +2 createSomeObject().message; +   ~~~~~~~ + + Library/library.d.ts:2:5 + 2 message2: string; +    ~~~~~~~~ + 'message2' is declared here. + + +[12:00:52 AM] Found 1 error. Watching for file changes. @@ -110,7 +192,6 @@ Program files:: /user/username/projects/sample1/Library/library.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/sample1/Library/library.ts Program root files: ["/user/username/projects/sample1/App/app.ts"] @@ -121,7 +202,6 @@ Program files:: /user/username/projects/sample1/App/app.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/sample1/Library/library.d.ts /user/username/projects/sample1/App/app.ts @@ -145,22 +225,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Introduce error - -//// [/user/username/projects/sample1/Library/library.ts] - -interface SomeObject -{ - message2: string; -} - -export function createSomeObject(): SomeObject -{ - return { - message2: "new Object" - }; -} - //// [/user/username/projects/sample1/Library/library.js] "use strict"; exports.__esModule = true; @@ -212,23 +276,30 @@ export {}; } -Output:: ->> Screen clear -[12:00:42 AM] File change detected. Starting incremental compilation... - +Change:: Fix error -App/app.ts:2:20 - error TS2551: Property 'message' does not exist on type 'SomeObject'. Did you mean 'message2'? +Input:: +//// [/user/username/projects/sample1/Library/library.ts] -2 createSomeObject().message; -   ~~~~~~~ +interface SomeObject +{ + message: string; +} - Library/library.d.ts:2:5 - 2 message2: string; -    ~~~~~~~~ - 'message2' is declared here. +export function createSomeObject(): SomeObject +{ + return { + message: "new Object" + }; +} + + +Output:: +>> Screen clear +[12:00:56 AM] File change detected. Starting incremental compilation... -[12:00:52 AM] Found 1 error. Watching for file changes. +[12:01:09 AM] Found 0 errors. Watching for file changes. @@ -272,22 +343,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix error - -//// [/user/username/projects/sample1/Library/library.ts] - -interface SomeObject -{ - message: string; -} - -export function createSomeObject(): SomeObject -{ - return { - message: "new Object" - }; -} - //// [/user/username/projects/sample1/Library/library.js] "use strict"; exports.__esModule = true; @@ -339,52 +394,3 @@ export {}; } //// [/user/username/projects/sample1/App/app.js] file written with same contents - -Output:: ->> Screen clear -[12:00:56 AM] File change detected. Starting incremental compilation... - - -[12:01:09 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/Library/library.ts"] -Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/sample1/Library/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/Library/library.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/Library/library.ts - -Program root files: ["/user/username/projects/sample1/App/app.ts"] -Program options: {"watch":true,"configFilePath":"/user/username/projects/sample1/App/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/Library/library.d.ts -/user/username/projects/sample1/App/app.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/Library/library.d.ts -/user/username/projects/sample1/App/app.ts - -WatchedFiles:: -/user/username/projects/sample1/library/tsconfig.json: - {"fileName":"/user/username/projects/sample1/Library/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/library/library.ts: - {"fileName":"/user/username/projects/sample1/Library/library.ts","pollingInterval":250} -/user/username/projects/sample1/app/tsconfig.json: - {"fileName":"/user/username/projects/sample1/App/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/app/app.ts: - {"fileName":"/user/username/projects/sample1/App/app.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/library: - {"directoryName":"/user/username/projects/sample1/library","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/app: - {"directoryName":"/user/username/projects/sample1/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js index 250df5a8c5858..07f697f9b41d7 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/logic +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -24,6 +24,54 @@ function foo() { return 10; } //// [/user/username/projects/sample1/logic/index.ts] function bar() { return foo() + 1 }; + +/a/lib/tsc.js -b -w sample1/logic +Output:: +>> Screen clear +[12:00:29 AM] Starting compilation in watch mode... + + +[12:00:46 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.ts + +No cached semantic diagnostics in the builder:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/index.js] function foo() { return 10; } @@ -173,12 +221,17 @@ declare function bar(): number; ====================================================================== +Change:: Make non local change and build core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +function foo() { return 10; } +function myFunc() { return 10; } + + Output:: >> Screen clear -[12:00:29 AM] Starting compilation in watch mode... - - -[12:00:46 AM] Found 0 errors. Watching for file changes. +[12:00:50 AM] File change detected. Starting incremental compilation... @@ -190,15 +243,6 @@ Program files:: No cached semantic diagnostics in the builder:: -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts - -No cached semantic diagnostics in the builder:: - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -219,12 +263,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make non local change and build core - -//// [/user/username/projects/sample1/core/index.ts] -function foo() { return 10; } -function myFunc() { return 10; } - //// [/user/username/projects/sample1/core/index.js] function foo() { return 10; } function myFunc() { return 10; } @@ -283,17 +321,21 @@ declare function myFunc(): number; ====================================================================== +Change:: Build logic + +Input:: + Output:: ->> Screen clear -[12:00:50 AM] File change detected. Starting incremental compilation... +[12:01:15 AM] Found 0 errors. Watching for file changes. -Program root files: ["/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts No cached semantic diagnostics in the builder:: @@ -317,8 +359,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic - //// [/user/username/projects/sample1/logic/index.js] function foo() { return 10; } function myFunc() { return 10; } @@ -419,17 +459,25 @@ declare function bar(): number; ====================================================================== +Change:: Make local change and build core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +function foo() { return 10; } +function myFunc() { return 100; } + + Output:: -[12:01:15 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:19 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/core/index.ts No cached semantic diagnostics in the builder:: @@ -453,12 +501,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make local change and build core - -//// [/user/username/projects/sample1/core/index.ts] -function foo() { return 10; } -function myFunc() { return 100; } - //// [/user/username/projects/sample1/core/index.js] function foo() { return 10; } function myFunc() { return 100; } @@ -513,19 +555,14 @@ declare function myFunc(): number; ====================================================================== -Output:: ->> Screen clear -[12:01:19 AM] File change detected. Starting incremental compilation... - +Change:: Build logic +Input:: -Program root files: ["/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.ts +Output:: +[12:01:42 AM] Found 0 errors. Watching for file changes. + -No cached semantic diagnostics in the builder:: WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -547,8 +584,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic - //// [/user/username/projects/sample1/logic/index.js] function foo() { return 10; } function myFunc() { return 100; } @@ -643,28 +678,3 @@ declare function bar(): number; ====================================================================== - -Output:: -[12:01:42 AM] Found 0 errors. Watching for file changes. - - - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js index c8ffc76842469..5fd88649e9ecc 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -75,6 +75,85 @@ import * as mod from '../core/anotherModule'; export const m = mod; + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -302,56 +381,29 @@ export declare const m: typeof mod; } +Change:: Change to new File and build core + +Input:: +//// [/user/username/projects/sample1/core/newfile.ts] +export const newFileConst = 30; + + Output:: >> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:01:04 AM] Found 0 errors. Watching for file changes. +[12:01:07 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/newfile.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -368,6 +420,8 @@ WatchedFiles:: {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} /user/username/projects/sample1/tests/index.ts: {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/core/newfile.ts: + {"fileName":"/user/username/projects/sample1/core/newfile.ts","pollingInterval":250} FsWatches:: @@ -379,8 +433,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change to new File and build core - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] file changed its modified time @@ -428,9 +480,6 @@ Change:: Change to new File and build core "version": "FakeTSVersion" } -//// [/user/username/projects/sample1/core/newfile.ts] -export const newFileConst = 30; - //// [/user/username/projects/sample1/core/newfile.js] "use strict"; exports.__esModule = true; @@ -443,22 +492,21 @@ export declare const newFileConst = 30; -Output:: ->> Screen clear -[12:01:07 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/newfile.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -488,22 +536,28 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time //// [/user/username/projects/sample1/logic/index.js] file changed its modified time //// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +Change:: Build Tests + +Input:: + Output:: +[12:01:18 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: @@ -535,27 +589,34 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file changed its modified time //// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Change:: Change to new File and build core + +Input:: +//// [/user/username/projects/sample1/core/newfile.ts] +export const newFileConst = 30; +export class someClass2 { } + + Output:: -[12:01:18 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:22 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/newfile.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -585,8 +646,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change to new File and build core - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] file changed its modified time @@ -634,10 +693,6 @@ Change:: Change to new File and build core "version": "FakeTSVersion" } -//// [/user/username/projects/sample1/core/newfile.ts] -export const newFileConst = 30; -export class someClass2 { } - //// [/user/username/projects/sample1/core/newfile.js] "use strict"; exports.__esModule = true; @@ -658,57 +713,9 @@ export declare class someClass2 { -Output:: ->> Screen clear -[12:01:22 AM] File change detected. Starting incremental compilation... - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/newfile.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/newfile.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} -/user/username/projects/sample1/core/newfile.ts: - {"fileName":"/user/username/projects/sample1/core/newfile.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Build logic or update time stamps -//// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time -//// [/user/username/projects/sample1/logic/index.js] file changed its modified time -//// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: @@ -750,11 +757,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time +//// [/user/username/projects/sample1/logic/index.js] file changed its modified time +//// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time + Change:: Build Tests -//// [/user/username/projects/sample1/tests/index.js] file changed its modified time -//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: [12:01:35 AM] Found 0 errors. Watching for file changes. @@ -799,3 +809,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file changed its modified time +//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js index eb9dd27fdac81..de2f6106cf2d3 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -75,6 +75,85 @@ import * as mod from '../core/anotherModule'; export const m = mod; + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -302,12 +381,20 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... +Change:: Make change to core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } -[12:01:04 AM] Found 0 errors. Watching for file changes. + +Output:: +>> Screen clear +[12:01:08 AM] File change detected. Starting incremental compilation... @@ -319,40 +406,8 @@ Program files:: /user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -379,15 +434,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make change to core - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] @@ -453,21 +499,23 @@ export declare class someClass { } -Output:: ->> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -495,8 +543,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -556,19 +602,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:01:40 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -596,8 +650,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -668,23 +720,31 @@ Change:: Build Tests } +Change:: Revert core file + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + Output:: -[12:01:40 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:44 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -712,14 +772,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Revert core file - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] @@ -777,21 +829,23 @@ export declare function multiply(a: number, b: number): number; } -Output:: ->> Screen clear -[12:01:44 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -819,8 +873,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -880,19 +932,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:02:16 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -920,8 +980,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -992,23 +1050,33 @@ Change:: Build Tests } +Change:: Make two changes + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +export class someClass2 { } + + Output:: -[12:02:16 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:02:23 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1036,16 +1104,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make two changes - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } -export class someClass2 { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] @@ -1119,21 +1177,23 @@ export declare class someClass2 { } -Output:: ->> Screen clear -[12:02:23 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1161,8 +1221,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -1222,19 +1280,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:02:55 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1262,8 +1328,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -1333,47 +1397,3 @@ Change:: Build Tests "version": "FakeTSVersion" } - -Output:: -[12:02:55 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js index 0744db21d00e1..cb40c0a0dc55f 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -75,6 +75,85 @@ import * as mod from '../core/anotherModule'; export const m = mod; + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -302,12 +381,20 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... +Change:: Make local change to core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +function foo() { } -[12:01:04 AM] Found 0 errors. Watching for file changes. + +Output:: +>> Screen clear +[12:01:08 AM] File change detected. Starting incremental compilation... @@ -319,40 +406,8 @@ Program files:: /user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -379,15 +434,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make local change to core - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -function foo() { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] @@ -441,21 +487,11 @@ function foo() { } } -Output:: ->> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... - - +Change:: Build logic or update time stamps -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +Input:: -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +Output:: WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -483,46 +519,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time //// [/user/username/projects/sample1/logic/index.js] file changed its modified time //// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -Output:: - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Build Tests -//// [/user/username/projects/sample1/tests/index.js] file changed its modified time -//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: [12:01:21 AM] Found 0 errors. Watching for file changes. @@ -554,3 +558,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file changed its modified time +//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js index 94885a516bd15..bb1232e55ef4e 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,56 +415,29 @@ export declare const m: typeof mod; } +Change:: Change to new File and build core + +Input:: +//// [/user/username/projects/sample1/core/newfile.ts] +export const newFileConst = 30; + + Output:: >> Screen clear -[12:00:45 AM] Starting compilation in watch mode... - - -[12:01:14 AM] Found 0 errors. Watching for file changes. +[12:01:17 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/newfile.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -402,6 +454,8 @@ WatchedFiles:: {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} /user/username/projects/sample1/tests/index.ts: {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/core/newfile.ts: + {"fileName":"/user/username/projects/sample1/core/newfile.ts","pollingInterval":250} FsWatches:: @@ -413,8 +467,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change to new File and build core - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -466,9 +518,6 @@ Change:: Change to new File and build core "version": "FakeTSVersion" } -//// [/user/username/projects/sample1/core/newfile.ts] -export const newFileConst = 30; - //// [/user/username/projects/sample1/core/newfile.js] "use strict"; exports.__esModule = true; @@ -484,22 +533,21 @@ export declare const newFileConst = 30; //# sourceMappingURL=newfile.d.ts.map -Output:: ->> Screen clear -[12:01:17 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/newfile.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -529,22 +577,28 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time //// [/user/username/projects/sample1/logic/index.js] file changed its modified time //// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +Change:: Build Tests + +Input:: + Output:: +[12:01:30 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: @@ -576,27 +630,34 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file changed its modified time //// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Change:: Change to new File and build core + +Input:: +//// [/user/username/projects/sample1/core/newfile.ts] +export const newFileConst = 30; +export class someClass2 { } + + Output:: -[12:01:30 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:34 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/newfile.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -626,8 +687,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change to new File and build core - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -679,10 +738,6 @@ Change:: Change to new File and build core "version": "FakeTSVersion" } -//// [/user/username/projects/sample1/core/newfile.ts] -export const newFileConst = 30; -export class someClass2 { } - //// [/user/username/projects/sample1/core/newfile.js] "use strict"; exports.__esModule = true; @@ -706,57 +761,9 @@ export declare class someClass2 { //# sourceMappingURL=newfile.d.ts.map -Output:: ->> Screen clear -[12:01:34 AM] File change detected. Starting incremental compilation... - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/newfile.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/newfile.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} -/user/username/projects/sample1/core/newfile.ts: - {"fileName":"/user/username/projects/sample1/core/newfile.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Build logic or update time stamps -//// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time -//// [/user/username/projects/sample1/logic/index.js] file changed its modified time -//// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: @@ -798,11 +805,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time +//// [/user/username/projects/sample1/logic/index.js] file changed its modified time +//// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time + Change:: Build Tests -//// [/user/username/projects/sample1/tests/index.js] file changed its modified time -//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: [12:01:50 AM] Found 0 errors. Watching for file changes. @@ -847,3 +857,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file changed its modified time +//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js index dfa539292388a..2aebe30724b6c 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,12 +415,20 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... +Change:: Make change to core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } -[12:01:14 AM] Found 0 errors. Watching for file changes. + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... @@ -353,40 +440,8 @@ Program files:: /user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -413,15 +468,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make change to core - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -493,21 +539,23 @@ export declare class someClass { } -Output:: ->> Screen clear -[12:01:18 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -535,8 +583,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -596,19 +642,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:01:53 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -636,8 +690,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -708,23 +760,31 @@ Change:: Build Tests } +Change:: Revert core file + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + Output:: -[12:01:53 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:57 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -752,14 +812,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Revert core file - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -823,21 +875,23 @@ export declare function multiply(a: number, b: number): number; } -Output:: ->> Screen clear -[12:01:57 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -865,8 +919,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -926,19 +978,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:02:32 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -966,8 +1026,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -1038,23 +1096,33 @@ Change:: Build Tests } +Change:: Make two changes + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +export class someClass2 { } + + Output:: -[12:02:32 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:02:39 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1082,16 +1150,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make two changes - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } -export class someClass2 { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -1171,21 +1229,23 @@ export declare class someClass2 { } -Output:: ->> Screen clear -[12:02:39 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1213,8 +1273,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -1274,19 +1332,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:03:14 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1314,8 +1380,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -1385,47 +1449,3 @@ Change:: Build Tests "version": "FakeTSVersion" } - -Output:: -[12:03:14 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js index 4b2e9af0cb73a..a6153548cd719 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,12 +415,20 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... +Change:: Make local change to core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +function foo() { } -[12:01:14 AM] Found 0 errors. Watching for file changes. + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... @@ -353,40 +440,8 @@ Program files:: /user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -413,15 +468,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make local change to core - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -function foo() { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -479,21 +525,11 @@ function foo() { } } -Output:: ->> Screen clear -[12:01:18 AM] File change detected. Starting incremental compilation... - - +Change:: Build logic or update time stamps -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +Input:: -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +Output:: WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -521,46 +557,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time //// [/user/username/projects/sample1/logic/index.js] file changed its modified time //// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -Output:: - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Build Tests -//// [/user/username/projects/sample1/tests/index.js] file changed its modified time -//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: [12:01:34 AM] Found 0 errors. Watching for file changes. @@ -592,3 +596,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file changed its modified time +//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/works-when-noUnusedParameters-changes-to-false.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/works-when-noUnusedParameters-changes-to-false.js index d84a2f6f8498b..e17f9571ecbad 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/works-when-noUnusedParameters-changes-to-false.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/works-when-noUnusedParameters-changes-to-false.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w +Input:: //// [/user/username/projects/myproject/index.ts] const fn = (a: string, b: string) => b; @@ -19,6 +19,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } +/a/lib/tsc.js -b -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -58,15 +59,13 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Change tsconfig to set noUnusedParameters to false +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"noUnusedParameters":false}} -//// [/user/username/projects/myproject/index.js] -var fn = function (a, b) { return b; }; - - Output:: >> Screen clear @@ -100,3 +99,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/index.js] +var fn = function (a, b) { return b; }; + + diff --git a/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js b/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js index 6001eeaf1f720..279cc4d73d511 100644 --- a/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js +++ b/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose src +Input:: //// [/user/username/projects/reexport/src/tsconfig.json] { "files": [], @@ -63,93 +63,8 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/user/username/projects/reexport/out/pure/session.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/reexport/out/pure/session.d.ts] -export interface Session { - foo: number; -} - - -//// [/user/username/projects/reexport/out/pure/index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./session"), exports); - - -//// [/user/username/projects/reexport/out/pure/index.d.ts] -export * from "./session"; - - -//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../../../../../a/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../../src/pure/session.ts": { - "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", - "signature": "-1218067212-export interface Session {\n foo: number;\n}\n", - "affectsGlobalScope": false - }, - "../../src/pure/index.ts": { - "version": "-5356193041-export * from \"./session\";\n", - "signature": "-5356193041-export * from \"./session\";\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "outDir": "..", - "rootDir": "../../src", - "watch": true, - "configFilePath": "../../src/pure/tsconfig.json" - }, - "referencedMap": { - "../../src/pure/index.ts": [ - "../../src/pure/session.ts" - ] - }, - "exportedModulesMap": { - "../../src/pure/index.ts": [ - "../../src/pure/session.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../../../a/lib/lib.d.ts", - "../../src/pure/index.ts", - "../../src/pure/session.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/user/username/projects/reexport/out/main/index.js] -"use strict"; -exports.__esModule = true; -exports.session = void 0; -exports.session = { - foo: 1 -}; - - +/a/lib/tsc.js -b -w -verbose src Output:: >> Screen clear [12:00:35 AM] Starting compilation in watch mode... @@ -227,25 +142,37 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Introduce error - -//// [/user/username/projects/reexport/src/pure/session.ts] -export interface Session { - foo: number; - bar: number; -} +//// [/user/username/projects/reexport/out/pure/session.js] +"use strict"; +exports.__esModule = true; -//// [/user/username/projects/reexport/out/pure/session.js] file written with same contents //// [/user/username/projects/reexport/out/pure/session.d.ts] export interface Session { foo: number; - bar: number; } -//// [/user/username/projects/reexport/out/pure/index.js] file written with same contents -//// [/user/username/projects/reexport/out/pure/index.d.ts] file written with same contents +//// [/user/username/projects/reexport/out/pure/index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("./session"), exports); + + +//// [/user/username/projects/reexport/out/pure/index.d.ts] +export * from "./session"; + + //// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] { "program": { @@ -256,8 +183,8 @@ export interface Session { "affectsGlobalScope": true }, "../../src/pure/session.ts": { - "version": "4223553457-export interface Session {\n foo: number;\n bar: number;\n}\n", - "signature": "309257137-export interface Session {\n foo: number;\n bar: number;\n}\n", + "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", + "signature": "-1218067212-export interface Session {\n foo: number;\n}\n", "affectsGlobalScope": false }, "../../src/pure/index.ts": { @@ -292,6 +219,26 @@ export interface Session { "version": "FakeTSVersion" } +//// [/user/username/projects/reexport/out/main/index.js] +"use strict"; +exports.__esModule = true; +exports.session = void 0; +exports.session = { + foo: 1 +}; + + + +Change:: Introduce error + +Input:: +//// [/user/username/projects/reexport/src/pure/session.ts] +export interface Session { + foo: number; + bar: number; +} + + Output:: >> Screen clear @@ -373,19 +320,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix error - -//// [/user/username/projects/reexport/src/pure/session.ts] -export interface Session { - foo: number; - // bar: number; -} - - //// [/user/username/projects/reexport/out/pure/session.js] file written with same contents //// [/user/username/projects/reexport/out/pure/session.d.ts] export interface Session { foo: number; + bar: number; } @@ -401,8 +340,8 @@ export interface Session { "affectsGlobalScope": true }, "../../src/pure/session.ts": { - "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", - "signature": "-1218067212-export interface Session {\n foo: number;\n}\n", + "version": "4223553457-export interface Session {\n foo: number;\n bar: number;\n}\n", + "signature": "309257137-export interface Session {\n foo: number;\n bar: number;\n}\n", "affectsGlobalScope": false }, "../../src/pure/index.ts": { @@ -437,7 +376,17 @@ export interface Session { "version": "FakeTSVersion" } -//// [/user/username/projects/reexport/out/main/index.js] file changed its modified time + +Change:: Fix error + +Input:: +//// [/user/username/projects/reexport/src/pure/session.ts] +export interface Session { + foo: number; + // bar: number; +} + + Output:: >> Screen clear @@ -510,3 +459,60 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/reexport/src/main","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/reexport/out/pure/session.js] file written with same contents +//// [/user/username/projects/reexport/out/pure/session.d.ts] +export interface Session { + foo: number; +} + + +//// [/user/username/projects/reexport/out/pure/index.js] file written with same contents +//// [/user/username/projects/reexport/out/pure/index.d.ts] file written with same contents +//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../src/pure/session.ts": { + "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", + "signature": "-1218067212-export interface Session {\n foo: number;\n}\n", + "affectsGlobalScope": false + }, + "../../src/pure/index.ts": { + "version": "-5356193041-export * from \"./session\";\n", + "signature": "-5356193041-export * from \"./session\";\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../src", + "watch": true, + "configFilePath": "../../src/pure/tsconfig.json" + }, + "referencedMap": { + "../../src/pure/index.ts": [ + "../../src/pure/session.ts" + ] + }, + "exportedModulesMap": { + "../../src/pure/index.ts": [ + "../../src/pure/session.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../src/pure/index.ts", + "../../src/pure/session.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/reexport/out/main/index.js] file changed its modified time diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js index 2e58a44def153..a0c00c62dc5ff 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js @@ -1,8 +1,42 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --composite false --p src/project --tsBuildInfoFile null -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] +} + + +Output:: +/lib/tsc --composite false --p src/project --tsBuildInfoFile null +exitCode:: ExitStatus.Success + + //// [/src/project/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js index 085086aefac88..5b9300a30db29 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js @@ -1,4 +1,38 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] +} + + + +Output:: /lib/tsc --composite false --p src/project src/project/tsconfig.json:6:9 - error TS5069: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or option 'composite'. @@ -9,8 +43,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/project/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js index 9386b09ca07e7..cab79a8011fa5 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js @@ -1,8 +1,41 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --composite false --p src/project -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + }, + "include": [ + "src/**/*.ts" + ] +} + + +Output:: +/lib/tsc --composite false --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js index 585e7240af0e7..917419c89e0d5 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js @@ -1,8 +1,41 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --composite null --p src/project -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + }, + "include": [ + "src/**/*.ts" + ] +} + + +Output:: +/lib/tsc --composite null --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js index 29eefb2d8e1d2..8372a0e49f098 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p pkg3 --listFiles +Input:: //// [/user/username/projects/myProject/pkg1/dist/index.d.ts] export * from './types'; @@ -54,35 +54,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/pkg3/dist/keys.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ADMIN = void 0; -var pkg2_1 = require("@raymondfeng/pkg2"); -exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); - - -//// [/user/username/projects/myproject/pkg3/dist/index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./keys"), exports); - - -//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] -export * from './keys'; - - +/a/lib/tsc.js -p pkg3 --listFiles Output:: pkg3/src/keys.ts:2:14 - error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. @@ -127,3 +100,32 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + +//// [/user/username/projects/myproject/pkg3/dist/keys.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ADMIN = void 0; +var pkg2_1 = require("@raymondfeng/pkg2"); +exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); + + +//// [/user/username/projects/myproject/pkg3/dist/index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./keys"), exports); + + +//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] +export * from './keys'; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js index 40045b6d167ce..fa89367600821 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p pkg3 --listFiles +Input:: //// [/user/username/projects/myproject/pkg1/dist/index.d.ts] export * from './types'; @@ -54,35 +54,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/pkg3/dist/keys.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ADMIN = void 0; -var pkg2_1 = require("@raymondfeng/pkg2"); -exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); - - -//// [/user/username/projects/myproject/pkg3/dist/index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./keys"), exports); - - -//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] -export * from './keys'; - - +/a/lib/tsc.js -p pkg3 --listFiles Output:: pkg3/src/keys.ts:2:14 - error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. @@ -127,3 +100,32 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + +//// [/user/username/projects/myproject/pkg3/dist/keys.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ADMIN = void 0; +var pkg2_1 = require("@raymondfeng/pkg2"); +exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); + + +//// [/user/username/projects/myproject/pkg3/dist/index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./keys"), exports); + + +//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] +export * from './keys'; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js index 200576b32ee3a..bc7e8af7206fa 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p plugin-one --listFiles +Input:: //// [/user/username/projects/myProject/plugin-two/index.d.ts] declare const _default: { features: { @@ -84,34 +84,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/plugin-one/action.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.actions = void 0; -var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib -var action = typescript_fsa_1.actionCreatorFactory("somekey"); -var featureOne = action("feature-one"); -exports.actions = { featureOne: featureOne }; - - -//// [/user/username/projects/myproject/plugin-one/action.d.ts] -export declare const actions: { - featureOne: import("typescript-fsa").ActionCreator<{ - route: string; - }>; -}; - - -//// [/user/username/projects/myproject/plugin-one/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [/user/username/projects/myproject/plugin-one/index.d.ts] -export {}; - - +/a/lib/tsc.js -p plugin-one --listFiles Output:: ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/action.ts'. ======== @@ -232,3 +206,31 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.Success + +//// [/user/username/projects/myproject/plugin-one/action.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +var action = typescript_fsa_1.actionCreatorFactory("somekey"); +var featureOne = action("feature-one"); +exports.actions = { featureOne: featureOne }; + + +//// [/user/username/projects/myproject/plugin-one/action.d.ts] +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + + +//// [/user/username/projects/myproject/plugin-one/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] +export {}; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js index 81fe39fd8b1ed..410f1819da657 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p plugin-one --listFiles +Input:: //// [/user/username/projects/myProject/plugin-two/package.json] {"name":"plugin-two","version":"0.1.3","main":"dist/commonjs/index.js"} @@ -86,25 +86,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/plugin-one/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.actions = void 0; -var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib -var action = typescript_fsa_1.actionCreatorFactory("somekey"); -var featureOne = action("feature-one"); -exports.actions = { featureOne: featureOne }; - - -//// [/user/username/projects/myproject/plugin-one/index.d.ts] -export declare const actions: { - featureOne: import("typescript-fsa").ActionCreator<{ - route: string; - }>; -}; - - +/a/lib/tsc.js -p plugin-one --listFiles Output:: ======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== @@ -246,3 +229,22 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.Success + +//// [/user/username/projects/myproject/plugin-one/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +var action = typescript_fsa_1.actionCreatorFactory("somekey"); +var featureOne = action("feature-one"); +exports.actions = { featureOne: featureOne }; + + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js index 7f302be902467..57a6e2a29d554 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p plugin-one --listFiles +Input:: //// [/user/username/projects/myproject/plugin-two/package.json] {"name":"plugin-two","version":"0.1.3","main":"dist/commonjs/index.js"} @@ -86,25 +86,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/plugin-one/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.actions = void 0; -var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib -var action = typescript_fsa_1.actionCreatorFactory("somekey"); -var featureOne = action("feature-one"); -exports.actions = { featureOne: featureOne }; - - -//// [/user/username/projects/myproject/plugin-one/index.d.ts] -export declare const actions: { - featureOne: import("typescript-fsa").ActionCreator<{ - route: string; - }>; -}; - - +/a/lib/tsc.js -p plugin-one --listFiles Output:: ======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== @@ -246,3 +229,22 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.Success + +//// [/user/username/projects/myproject/plugin-one/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +var action = typescript_fsa_1.actionCreatorFactory("somekey"); +var featureOne = action("feature-one"); +exports.actions = { featureOne: featureOne }; + + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js index 5507612f3f539..df60d073c68cb 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p plugin-one --listFiles +Input:: //// [/user/username/projects/myproject/plugin-two/index.d.ts] declare const _default: { features: { @@ -84,34 +84,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/plugin-one/action.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.actions = void 0; -var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib -var action = typescript_fsa_1.actionCreatorFactory("somekey"); -var featureOne = action("feature-one"); -exports.actions = { featureOne: featureOne }; - - -//// [/user/username/projects/myproject/plugin-one/action.d.ts] -export declare const actions: { - featureOne: import("typescript-fsa").ActionCreator<{ - route: string; - }>; -}; - - -//// [/user/username/projects/myproject/plugin-one/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [/user/username/projects/myproject/plugin-one/index.d.ts] -export {}; - - +/a/lib/tsc.js -p plugin-one --listFiles Output:: ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/action.ts'. ======== @@ -232,3 +206,31 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.Success + +//// [/user/username/projects/myproject/plugin-one/action.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +var action = typescript_fsa_1.actionCreatorFactory("somekey"); +var featureOne = action("feature-one"); +exports.actions = { featureOne: featureOne }; + + +//// [/user/username/projects/myproject/plugin-one/action.d.ts] +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + + +//// [/user/username/projects/myproject/plugin-one/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] +export {}; + + diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js deleted file mode 100644 index e54b0e9d8d216..0000000000000 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js +++ /dev/null @@ -1,78 +0,0 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --incremental -p src -exitCode:: ExitStatus.Success - - -//// [/src/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/src/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/src/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/src/dev-build/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../shared/types/db.ts": { - "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", - "affectsGlobalScope": false - }, - "../src/main.ts": { - "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - }, - "../src/other.ts": { - "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "outDir": "./", - "noEmitOnError": true, - "incremental": true, - "project": "..", - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../src/main.ts": [ - "../shared/types/db.ts" - ] - }, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../shared/types/db.ts", - "../src/main.ts", - "../src/other.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -}; - diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js deleted file mode 100644 index b73173d64766c..0000000000000 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js +++ /dev/null @@ -1,44 +0,0 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --incremental --p src/project -exitCode:: ExitStatus.Success - - -//// [/src/project/src/main.d.ts] -export const x = 10;export const xy = 100; - -//// [/src/project/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/another.d.ts": { - "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;", - "affectsGlobalScope": false - }, - "./src/main.d.ts": { - "version": "-10808461502-export const x = 10;export const xy = 100;", - "signature": "-10808461502-export const x = 10;export const xy = 100;", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "project": "./", - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./src/another.d.ts", - "./src/main.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js index cfa497cc1f171..cff14598d83c1 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js @@ -1,8 +1,40 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +//// [/src/project/src/main.ts] +export const x = 10; + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + }, + "include": [ + "src/**/*.ts" + ] +} + + +Output:: +/lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo +exitCode:: ExitStatus.Success + + //// [/src/project/.tsbuildinfo] { "program": { @@ -43,3 +75,14 @@ exports.x = void 0; exports.x = 10; + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js index a52e9281efb41..acefac7c6bde8 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js @@ -1,8 +1,37 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --p src/project --rootDir src/project/src -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "outDir": "dist", + }, +} + + +Output:: +/lib/tsc --p src/project --rootDir src/project/src +exitCode:: ExitStatus.Success + + //// [/src/project/dist/main.js] "use strict"; exports.__esModule = true; @@ -42,3 +71,14 @@ exports.x = 10; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --p src/project --rootDir src/project/src +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js index 9e4c4058d265f..b832ef32ee437 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js @@ -1,8 +1,38 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --p src/project -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "outDir": "./built", + "rootDir": "./" + }, +} + + +Output:: +/lib/tsc --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/built/src/main.js] "use strict"; exports.__esModule = true; @@ -42,3 +72,14 @@ exports.x = 10; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --p src/project +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js new file mode 100644 index 0000000000000..f9209ae7cce24 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js @@ -0,0 +1,211 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: +/lib/tsc --incremental -p src +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental -p src +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "project": "..", + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js new file mode 100644 index 0000000000000..bf88e9a634f61 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js @@ -0,0 +1,227 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: +/lib/tsc --incremental -p src +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental -p src +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "project": "..", + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js deleted file mode 100644 index 7d139de09b044..0000000000000 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --incremental -p src -src/src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - - src/src/main.ts:2:11 - 2 const a = { -    ~ - The parser expected to find a '}' to match the '{' token here. - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js index fce0d7c659459..b9d82d9664d1b 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js @@ -1,8 +1,35 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --incremental --p src/project -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/another.d.ts] +export const y = 10; + +//// [/src/project/src/main.d.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{} + + +Output:: +/lib/tsc --incremental --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/tsconfig.tsbuildinfo] { "program": { @@ -39,3 +66,64 @@ exitCode:: ExitStatus.Success "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental --p src/project +exitCode:: ExitStatus.Success + + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/project/src/main.d.ts] +export const x = 10;export const xy = 100; + + + +Output:: +/lib/tsc --incremental --p src/project +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/another.d.ts": { + "version": "-13729955264-export const y = 10;", + "signature": "-13729955264-export const y = 10;", + "affectsGlobalScope": false + }, + "./src/main.d.ts": { + "version": "-10808461502-export const x = 10;export const xy = 100;", + "signature": "-10808461502-export const x = 10;export const xy = 100;", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/another.d.ts", + "./src/main.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js deleted file mode 100644 index b8bd5ebd76ab6..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js deleted file mode 100644 index 8c858da7594be..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --p src/project --rootDir src/project/src -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js deleted file mode 100644 index 6dd851d6f1fcb..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --p src/project -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js deleted file mode 100644 index c85dc67540d29..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [/lib/no-change-runOutput.txt] -/lib/tsc --incremental --p src/project -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsc/listFilesOnly/initial-build/combined-with-watch.js b/tests/baselines/reference/tsc/listFilesOnly/initial-build/combined-with-watch.js index 7ef3574626b0a..682f708232638 100644 --- a/tests/baselines/reference/tsc/listFilesOnly/initial-build/combined-with-watch.js +++ b/tests/baselines/reference/tsc/listFilesOnly/initial-build/combined-with-watch.js @@ -1,6 +1,15 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/test.ts] + + + + +Output:: /lib/tsc /src/test.ts --watch --listFilesOnly error TS6370: Options 'watch' and 'listFilesOnly' cannot be combined. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsc/listFilesOnly/initial-build/loose-file.js b/tests/baselines/reference/tsc/listFilesOnly/initial-build/loose-file.js index 6a97401e56070..5bdaee4b00882 100644 --- a/tests/baselines/reference/tsc/listFilesOnly/initial-build/loose-file.js +++ b/tests/baselines/reference/tsc/listFilesOnly/initial-build/loose-file.js @@ -1,7 +1,28 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/test.ts] +export const x = 1; + + + +Output:: /lib/tsc /src/test.ts --listFilesOnly /lib/lib.d.ts /src/test.ts exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index e8a58a1673e3a..5c89f9c9dbe42 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -1,4 +1,10 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + + + +Output:: /lib/tsc Version FakeTSVersion Syntax: tsc [options] [file...] @@ -46,5 +52,5 @@ Options: --esModuleInterop Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. @ Insert command line options and files from a file. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/createWatchOfConfigFile.js b/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/createWatchOfConfigFile.js index 257725597b612..7a210ce679eee 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/createWatchOfConfigFile.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/createWatchOfConfigFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /tsconfig.json +Input:: //// [/f.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w -p /tsconfig.json Output:: >> Screen clear 12:00:13 AM - Starting compilation in watch mode... @@ -57,15 +55,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: @@ -100,3 +99,8 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/when-createWatchProgram-is-invoked-with-configFileParseResult-on-WatchCompilerHostOfConfigFile.js b/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/when-createWatchProgram-is-invoked-with-configFileParseResult-on-WatchCompilerHostOfConfigFile.js index ce3b8b51fd559..638585acff3b7 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/when-createWatchProgram-is-invoked-with-configFileParseResult-on-WatchCompilerHostOfConfigFile.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/when-createWatchProgram-is-invoked-with-configFileParseResult-on-WatchCompilerHostOfConfigFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /tsconfig.json +Input:: //// [/f.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w -p /tsconfig.json Output:: [12:00:13 AM] Starting compilation in watch mode... @@ -56,15 +54,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: [12:00:19 AM] File change detected. Starting incremental compilation... @@ -98,3 +97,8 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/with---diagnostics.js b/tests/baselines/reference/tscWatch/consoleClearing/with---diagnostics.js index 9bd26bdd33102..a5046dc3b6268 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/with---diagnostics.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/with---diagnostics.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /f.ts --diagnostics +Input:: //// [/f.ts] @@ -15,10 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w /f.ts --diagnostics Output:: [12:00:11 AM] Starting compilation in watch mode... @@ -59,15 +57,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: FileWatcher:: Triggered with /f.ts 1:: WatchInfo: /f.ts 250 undefined Source file @@ -111,3 +110,8 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/with---extendedDiagnostics.js b/tests/baselines/reference/tscWatch/consoleClearing/with---extendedDiagnostics.js index 494fd1c50bfb9..e32c88bce6f10 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/with---extendedDiagnostics.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/with---extendedDiagnostics.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /f.ts --extendedDiagnostics +Input:: //// [/f.ts] @@ -15,10 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w /f.ts --extendedDiagnostics Output:: [12:00:11 AM] Starting compilation in watch mode... @@ -63,15 +61,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: FileWatcher:: Triggered with /f.ts 1:: WatchInfo: /f.ts 250 undefined Source file @@ -115,3 +114,8 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/with---preserveWatchOutput.js b/tests/baselines/reference/tscWatch/consoleClearing/with---preserveWatchOutput.js index 7c5d64a46eaad..891223f155f0f 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/with---preserveWatchOutput.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/with---preserveWatchOutput.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /f.ts --preserveWatchOutput +Input:: //// [/f.ts] @@ -15,10 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w /f.ts --preserveWatchOutput Output:: [12:00:11 AM] Starting compilation in watch mode... @@ -49,15 +47,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: [12:00:17 AM] File change detected. Starting incremental compilation... @@ -87,3 +86,8 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/without---diagnostics-or---extendedDiagnostics.js b/tests/baselines/reference/tscWatch/consoleClearing/without---diagnostics-or---extendedDiagnostics.js index 8a05fb065fe33..94b8416f381cb 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/without---diagnostics-or---extendedDiagnostics.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/without---diagnostics-or---extendedDiagnostics.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /f.ts +Input:: //// [/f.ts] @@ -15,10 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w /f.ts Output:: >> Screen clear [12:00:11 AM] Starting compilation in watch mode... @@ -50,15 +48,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: >> Screen clear @@ -89,3 +88,8 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/elides-const-enums-correctly-in-incremental-compilation.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/elides-const-enums-correctly-in-incremental-compilation.js index 78777939a7ddd..f1b6c97c8f797 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/elides-const-enums-correctly-in-incremental-compilation.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/elides-const-enums-correctly-in-incremental-compilation.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/someone/projects/myproject/file3.ts +Input:: //// [/user/someone/projects/myproject/file1.ts] export const enum E1 { V = 1 } @@ -21,23 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/someone/projects/myproject/file1.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/someone/projects/myproject/file2.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/someone/projects/myproject/file3.js] -"use strict"; -exports.__esModule = true; -var v = 1 /* V */; - - +/a/lib/tsc.js -w /user/someone/projects/myproject/file3.ts Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -77,19 +62,30 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Append content to file3 +//// [/user/someone/projects/myproject/file1.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/someone/projects/myproject/file2.js] +"use strict"; +exports.__esModule = true; -//// [/user/someone/projects/myproject/file3.ts] -import { E2 } from "./file2"; const v: E2 = E2.V;function foo2() { return 2; } //// [/user/someone/projects/myproject/file3.js] "use strict"; exports.__esModule = true; var v = 1 /* V */; -function foo2() { return 2; } +Change:: Append content to file3 + +Input:: +//// [/user/someone/projects/myproject/file3.ts] +import { E2 } from "./file2"; const v: E2 = E2.V;function foo2() { return 2; } + + Output:: >> Screen clear [12:00:33 AM] File change detected. Starting incremental compilation... @@ -125,3 +121,11 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/user/someone/projects/myproject/file3.js] +"use strict"; +exports.__esModule = true; +var v = 1 /* V */; +function foo2() { return 2; } + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/file-is-deleted-and-created-as-part-of-change.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/file-is-deleted-and-created-as-part-of-change.js index 0d3b4bcaf3383..3d6d3d79aa10b 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/file-is-deleted-and-created-as-part-of-change.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/file-is-deleted-and-created-as-part-of-change.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/home/username/project/app/file.ts] var a = 10; @@ -18,11 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/home/username/project/app/file.js] -var a = 10; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -60,13 +57,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: file is deleted and then created to modify content - //// [/home/username/project/app/file.js] var a = 10; -var b = 10; + +Change:: file is deleted and then created to modify content + +Input:: //// [/home/username/project/app/file.ts] var a = 10; var b = 10; @@ -108,3 +106,9 @@ FsWatchesRecursive:: {"directoryName":"/home/username/project/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/home/username/project/app/file.js] +var a = 10; +var b = 10; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-carriageReturn-lineFeed.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-carriageReturn-lineFeed.js index 335e12e9e470d..20c6a009f25f4 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-carriageReturn-lineFeed.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-carriageReturn-lineFeed.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /a/app.ts +Input:: //// [/a/app.ts] var x = 1; var y = 2; @@ -16,12 +16,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/app.js] -var x = 1; -var y = 2; - - +/a/lib/tsc.js --w /a/app.ts Output:: >> Screen clear [12:00:11 AM] Starting compilation in watch mode... @@ -53,20 +49,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Append a line - -//// [/a/app.ts] +//// [/a/app.js] var x = 1; var y = 2; -var z = 3; -//// [/a/app.js] + + +Change:: Append a line + +Input:: +//// [/a/app.ts] var x = 1; var y = 2; var z = 3; - Output:: >> Screen clear [12:00:17 AM] File change detected. Starting incremental compilation... @@ -97,3 +94,10 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/app.js] +var x = 1; +var y = 2; +var z = 3; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-lineFeed.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-lineFeed.js index 00aa33efabf42..3affb2f761b18 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-lineFeed.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-lineFeed.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /a/app.ts +Input:: //// [/a/app.ts] var x = 1; var y = 2; @@ -16,12 +16,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/app.js] -var x = 1; -var y = 2; - - +/a/lib/tsc.js --w /a/app.ts Output:: >> Screen clear [12:00:11 AM] Starting compilation in watch mode... @@ -53,19 +49,20 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/app.js] +var x = 1; +var y = 2; + + + Change:: Append a line +Input:: //// [/a/app.ts] var x = 1; var y = 2; var z = 3; -//// [/a/app.js] -var x = 1; -var y = 2; -var z = 3; - - Output:: >> Screen clear @@ -97,3 +94,10 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/app.js] +var x = 1; +var y = 2; +var z = 3; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/should-emit-specified-file.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/should-emit-specified-file.js index 5ad8a6aa4acdb..de797479444d9 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/should-emit-specified-file.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/should-emit-specified-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] export function Foo() { return 10; } @@ -24,30 +24,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/f1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { return 10; } -exports.Foo = Foo; - - -//// [/a/b/f2.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -var f1_1 = require("./f1"); -exports.y = f1_1.Foo(); - - -//// [/a/b/f3.js] -"use strict"; -exports.__esModule = true; -var f2_1 = require("./f2"); -var x = f2_1.y; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -93,22 +71,36 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Append content to f1 - -//// [/a/b/f1.ts] -export function Foo() { return 10; }export function foo2() { return 2; } - //// [/a/b/f1.js] "use strict"; exports.__esModule = true; -exports.foo2 = exports.Foo = void 0; +exports.Foo = void 0; function Foo() { return 10; } exports.Foo = Foo; -function foo2() { return 2; } -exports.foo2 = foo2; -//// [/a/b/f2.js] file written with same contents +//// [/a/b/f2.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +var f1_1 = require("./f1"); +exports.y = f1_1.Foo(); + + +//// [/a/b/f3.js] +"use strict"; +exports.__esModule = true; +var f2_1 = require("./f2"); +var x = f2_1.y; + + + +Change:: Append content to f1 + +Input:: +//// [/a/b/f1.ts] +export function Foo() { return 10; }export function foo2() { return 2; } + Output:: >> Screen clear @@ -152,3 +144,15 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] +"use strict"; +exports.__esModule = true; +exports.foo2 = exports.Foo = void 0; +function Foo() { return 10; } +exports.Foo = Foo; +function foo2() { return 2; } +exports.foo2 = foo2; + + +//// [/a/b/f2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js index f425ed918a255..17b2952fe28eb 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -122,20 +91,45 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + Output:: >> Screen clear @@ -192,3 +186,13 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--out'-or-'--outFile'-is-specified.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--out'-or-'--outFile'-is-specified.js index 654a5287ff796..0e9d053d18cb2 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--out'-or-'--outFile'-is-specified.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--out'-or-'--outFile'-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,55 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/out.js] -System.register("moduleFile1", [], function (exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - function Foo() { } - exports_1("Foo", Foo); - return { - setters: [], - execute: function () { - ; - } - }; -}); -System.register("file1Consumer1", [], function (exports_2, context_2) { - "use strict"; - var y; - var __moduleName = context_2 && context_2.id; - return { - setters: [], - execute: function () { - exports_2("y", y = 10); - } - }; -}); -System.register("file1Consumer2", [], function (exports_3, context_3) { - "use strict"; - var z; - var __moduleName = context_3 && context_3.id; - return { - setters: [], - execute: function () { - z = 10; - } - }; -}); -System.register("moduleFile2", [], function (exports_4, context_4) { - "use strict"; - var Foo4; - var __moduleName = context_4 && context_4.id; - return { - setters: [], - execute: function () { - exports_4("Foo4", Foo4 = 10); - } - }; -}); - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -126,15 +79,9 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/out.js] System.register("moduleFile1", [], function (exports_1, context_1) { "use strict"; - var T; var __moduleName = context_1 && context_1.id; function Foo() { } exports_1("Foo", Foo); @@ -181,6 +128,13 @@ System.register("moduleFile2", [], function (exports_4, context_4) { +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + Output:: >> Screen clear [12:00:30 AM] File change detected. Starting incremental compilation... @@ -227,3 +181,53 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/out.js] +System.register("moduleFile1", [], function (exports_1, context_1) { + "use strict"; + var T; + var __moduleName = context_1 && context_1.id; + function Foo() { } + exports_1("Foo", Foo); + return { + setters: [], + execute: function () { + ; + } + }; +}); +System.register("file1Consumer1", [], function (exports_2, context_2) { + "use strict"; + var y; + var __moduleName = context_2 && context_2.id; + return { + setters: [], + execute: function () { + exports_2("y", y = 10); + } + }; +}); +System.register("file1Consumer2", [], function (exports_3, context_3) { + "use strict"; + var z; + var __moduleName = context_3 && context_3.id; + return { + setters: [], + execute: function () { + z = 10; + } + }; +}); +System.register("moduleFile2", [], function (exports_4, context_4) { + "use strict"; + var Foo4; + var __moduleName = context_4 && context_4.id; + return { + setters: [], + execute: function () { + exports_4("Foo4", Foo4 = 10); + } + }; +}); + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js index b9334c889d04e..5b286f6357394 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,21 +85,45 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change moduleFile1 shape and delete file1Consumer2 - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: change moduleFile1 shape and delete file1Consumer2 + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + //// [/a/b/file1Consumer2.ts] deleted Output:: @@ -178,3 +171,14 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js index 89bee1b3be94d..6ae491b9df7d9 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,32 +85,48 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change moduleFile1 shape and create file1Consumer3 - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents -//// [/a/b/file1Consumer3.ts] -import {Foo} from "./moduleFile1"; let y = Foo(); +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; -//// [/a/b/file1Consumer3.js] + +//// [/a/b/file1Consumer2.js] "use strict"; exports.__esModule = true; -var moduleFile1_1 = require("./moduleFile1"); -var y = moduleFile1_1.Foo(); +var z = 10; + + +//// [/a/b/globalFile3.js] +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: change moduleFile1 shape and create file1Consumer3 + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer3.ts] +import {Foo} from "./moduleFile1"; let y = Foo(); + Output:: >> Screen clear @@ -196,3 +181,22 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents +//// [/a/b/file1Consumer3.js] +"use strict"; +exports.__esModule = true; +var moduleFile1_1 = require("./moduleFile1"); +var y = moduleFile1_1.Foo(); + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js index 3560a191d7768..4e200416778df 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,19 +85,46 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change file1Consumer1 content to `export let y = Foo();` +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = void 0; +function Foo() { } +exports.Foo = Foo; +; -//// [/a/b/file1Consumer1.ts] -export let y = Foo(); //// [/a/b/file1Consumer1.js] "use strict"; exports.__esModule = true; exports.y = void 0; -exports.y = Foo(); +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; +Change:: Change file1Consumer1 content to `export let y = Foo();` + +Input:: +//// [/a/b/file1Consumer1.ts] +export let y = Foo(); + + Output:: >> Screen clear [12:00:38 AM] File change detected. Starting incremental compilation... @@ -183,21 +179,20 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = Foo(); + + + Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` +Input:: //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = exports.T = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer2.js] file written with same contents Output:: >> Screen clear @@ -254,18 +249,23 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer2.js] file written with same contents + Change:: Add the import statements back to file1Consumer1 +Input:: //// [/a/b/file1Consumer1.ts] import {Foo} from "./moduleFile1";let y = Foo(); -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -var moduleFile1_1 = require("./moduleFile1"); -var y = moduleFile1_1.Foo(); - - Output:: >> Screen clear @@ -315,20 +315,20 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +var moduleFile1_1 = require("./moduleFile1"); +var y = moduleFile1_1.Foo(); + + + Change:: Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };` +Input:: //// [/a/b/moduleFile1.ts] export let y = Foo(); -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = Foo(); - - -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents Output:: >> Screen clear @@ -398,24 +398,24 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Multiple file edits in one go - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - -//// [/a/b/file1Consumer1.ts] file written with same contents //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; -function Foo() { } -exports.Foo = Foo; -; +exports.y = void 0; +exports.y = Foo(); //// [/a/b/file1Consumer1.js] file written with same contents //// [/a/b/file1Consumer2.js] file written with same contents +Change:: Multiple file edits in one go + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer1.ts] file written with same contents + Output:: >> Screen clear [12:01:22 AM] File change detected. Starting incremental compilation... @@ -465,3 +465,15 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js index fed646679e551..53f8d7c6ac2fb 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,22 +85,45 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + Output:: >> Screen clear @@ -183,20 +175,24 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { console.log('hi'); }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; exports.Foo = exports.T = void 0; -function Foo() { console.log('hi'); } +function Foo() { } exports.Foo = Foo; ; +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents + +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { console.log('hi'); }; + Output:: >> Screen clear @@ -251,3 +247,13 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { console.log('hi'); } +exports.Foo = Foo; +; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js index bebd7d6595d0d..580e8ee8ffaa4 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,23 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -86,21 +71,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + + +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + Output:: >> Screen clear @@ -140,11 +133,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change file1 internal, and verify only file1 is affected - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { };var T1: number; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; @@ -152,9 +140,16 @@ exports.Foo = exports.T = void 0; function Foo() { } exports.Foo = Foo; ; -var T1; +//// [/a/b/file1Consumer1.js] file written with same contents + +Change:: change file1 internal, and verify only file1 is affected + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { };var T1: number; + Output:: >> Screen clear @@ -192,3 +187,14 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; +var T1; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-non-existing-code-file.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-non-existing-code-file.js index 368843aa14d68..3367268c18f38 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-non-existing-code-file.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-non-existing-code-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -19,15 +19,8 @@ export var x = Foo(); //// [/a/b/tsconfig.json] {} -//// [/a/b/referenceFile1.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -/// -exports.x = Foo(); - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -79,22 +72,23 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: edit refereceFile1 - -//// [/a/b/referenceFile1.ts] -/// -export var x = Foo();export var yy = Foo(); - //// [/a/b/referenceFile1.js] "use strict"; exports.__esModule = true; -exports.yy = exports.x = void 0; +exports.x = void 0; /// exports.x = Foo(); -exports.yy = Foo(); +Change:: edit refereceFile1 + +Input:: +//// [/a/b/referenceFile1.ts] +/// +export var x = Foo();export var yy = Foo(); + + Output:: >> Screen clear [12:00:21 AM] File change detected. Starting incremental compilation... @@ -151,19 +145,22 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/referenceFile1.js] +"use strict"; +exports.__esModule = true; +exports.yy = exports.x = void 0; +/// +exports.x = Foo(); +exports.yy = Foo(); + + + Change:: create moduleFile2 -//// [/a/b/referenceFile1.js] file written with same contents +Input:: //// [/a/b/moduleFile2.ts] export var Foo4 = 10; -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - Output:: >> Screen clear @@ -216,3 +213,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/referenceFile1.js] file written with same contents +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-removed-code-file.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-removed-code-file.js index 382a051e09fe5..bb58296521954 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-removed-code-file.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-removed-code-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -22,24 +22,8 @@ export function Foo() { }; //// [/a/b/tsconfig.json] {} -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/referenceFile1.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -/// -exports.x = Foo(); - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -87,9 +71,27 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/referenceFile1.js] +"use strict"; +exports.__esModule = true; +exports.x = void 0; +/// +exports.x = Foo(); + + + Change:: delete moduleFile1 -//// [/a/b/referenceFile1.js] file written with same contents +Input:: //// [/a/b/moduleFile1.ts] deleted Output:: @@ -141,3 +143,5 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/referenceFile1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-all-files-if-a-global-file-changed-shape.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-all-files-if-a-global-file-changed-shape.js index 5644e04edd8ce..3a98bd3751764 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-all-files-if-a-global-file-changed-shape.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-all-files-if-a-global-file-changed-shape.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,19 +85,45 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change shape of global file +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; -//// [/a/b/globalFile3.ts] -interface GlobalFoo { age: number }var T2: string; -//// [/a/b/moduleFile1.js] file written with same contents -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents //// [/a/b/globalFile3.js] -var T2; -//// [/a/b/moduleFile2.js] file written with same contents +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: change shape of global file + +Input:: +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number }var T2: string; + Output:: >> Screen clear @@ -182,3 +177,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents +//// [/a/b/globalFile3.js] +var T2; + + +//// [/a/b/moduleFile2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js index 560e738af08bb..3d873bcaeab2b 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -33,44 +33,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/file1Consumer1Consumer1.ts] import {y} from "./file1Consumer1"; -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer1Consumer1.js] -"use strict"; -exports.__esModule = true; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -128,19 +92,50 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change file1Consumer1 +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = void 0; +function Foo() { } +exports.Foo = Foo; +; -//// [/a/b/file1Consumer1.ts] -import {Foo} from "./moduleFile1"; export var y = 10;export var T: number; //// [/a/b/file1Consumer1.js] "use strict"; exports.__esModule = true; -exports.T = exports.y = void 0; +exports.y = void 0; exports.y = 10; -//// [/a/b/file1Consumer1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer1Consumer1.js] +"use strict"; +exports.__esModule = true; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: change file1Consumer1 + +Input:: +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10;export var T: number; + Output:: >> Screen clear @@ -194,22 +189,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.T = exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer1Consumer1.js] file written with same contents + Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` +Input:: //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = exports.T = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents Output:: >> Screen clear @@ -264,32 +258,27 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change file1Consumer1 and moduleFile1 - -//// [/a/b/moduleFile1.ts] -export var T2: number;export function Foo() { }; - -//// [/a/b/file1Consumer1.ts] -import {Foo} from "./moduleFile1"; export var y = 10;export var T: number;export var T2: number; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T2 = void 0; +exports.Foo = exports.T = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.T2 = exports.T = exports.y = void 0; -exports.y = 10; +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents + +Change:: change file1Consumer1 and moduleFile1 +Input:: +//// [/a/b/moduleFile1.ts] +export var T2: number;export function Foo() { }; + +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10;export var T: number;export var T2: number; -//// [/a/b/file1Consumer1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents Output:: >> Screen clear @@ -344,3 +333,22 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T2 = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.T2 = exports.T = exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-work-fine-for-files-with-circular-references.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-work-fine-for-files-with-circular-references.js index f1b6699c15ad6..c174eb5dbef8c 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-work-fine-for-files-with-circular-references.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-work-fine-for-files-with-circular-references.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -23,23 +23,8 @@ export var t2 = 10; //// [/a/b/tsconfig.json] {} -//// [/a/b/file2.js] -"use strict"; -exports.__esModule = true; -exports.t2 = void 0; -/// -exports.t2 = 10; - - -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; -exports.t1 = void 0; -/// -exports.t1 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -81,23 +66,31 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change file1 +//// [/a/b/file2.js] +"use strict"; +exports.__esModule = true; +exports.t2 = void 0; +/// +exports.t2 = 10; -//// [/a/b/file1.ts] -/// -export var t1 = 10;export var t3 = 10; -//// [/a/b/file2.js] file written with same contents //// [/a/b/file1.js] "use strict"; exports.__esModule = true; -exports.t3 = exports.t1 = void 0; +exports.t1 = void 0; /// exports.t1 = 10; -exports.t3 = 10; +Change:: change file1 + +Input:: +//// [/a/b/file1.ts] +/// +export var t1 = 10;export var t3 = 10; + + Output:: >> Screen clear [12:00:25 AM] File change detected. Starting incremental compilation... @@ -137,3 +130,14 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/file2.js] file written with same contents +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; +exports.t3 = exports.t1 = void 0; +/// +exports.t1 = 10; +exports.t3 = 10; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-does-not-have-out-or-outFile.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-does-not-have-out-or-outFile.js index 8f4987a5c2da9..d4c53518f35f4 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-does-not-have-out-or-outFile.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-does-not-have-out-or-outFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/tsconfig.json +Input:: //// [/a/a.ts] let x = 1 @@ -21,15 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/a.js] -var x = 1; - - -//// [/a/b.js] -var y = 1; - - +/a/lib/tsc.js --w -p /a/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -71,15 +64,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/a.js] +var x = 1; + + +//// [/a/b.js] +var y = 1; + + + Change:: Make change in the file +Input:: //// [/a/a.ts] let x = 11 -//// [/a/a.js] -var x = 11; - - Output:: >> Screen clear @@ -119,3 +118,8 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/a.js] +var x = 11; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js index abdb4c96f95c3..99b1aa3893d50 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/tsconfig.json +Input:: //// [/a/a.ts] let x = 1 @@ -21,12 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/out.js] -var x = 1; -var y = 1; - - +/a/lib/tsc.js --w -p /a/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -65,16 +61,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/out.js] +var x = 1; +var y = 1; + + + Change:: Make change in the file +Input:: //// [/a/a.ts] let x = 11 -//// [/a/out.js] -var x = 11; -var y = 1; - - Output:: >> Screen clear @@ -113,3 +111,9 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/out.js] +var x = 11; +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-outFile.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-outFile.js index 13ae6e640e25f..058d1dd761d11 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-outFile.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-outFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/tsconfig.json +Input:: //// [/a/a.ts] let x = 1 @@ -21,12 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/out.js] -var x = 1; -var y = 1; - - +/a/lib/tsc.js --w -p /a/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -65,16 +61,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/out.js] +var x = 1; +var y = 1; + + + Change:: Make change in the file +Input:: //// [/a/a.ts] let x = 11 -//// [/a/out.js] -var x = 11; -var y = 1; - - Output:: >> Screen clear @@ -113,3 +111,9 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/out.js] +var x = 11; +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/with---outFile-and-multiple-declaration-files-in-the-program.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/with---outFile-and-multiple-declaration-files-in-the-program.js index 981e805e512f0..249c18eb769de 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/with---outFile-and-multiple-declaration-files-in-the-program.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/with---outFile-and-multiple-declaration-files-in-the-program.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/project/tsconfig.json +Input:: //// [/a/b/output/AnotherDependency/file1.d.ts] declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } } @@ -27,23 +27,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/project/tsconfig.json] {"compilerOptions":{"outFile":"../output/common.js","target":"es5"},"files":["/a/b/output/AnotherDependency/file1.d.ts","/a/b/dependencies/file2.d.ts","/a/b/project/src/main.ts","/a/b/project/src/main2.ts"]} -//// [/a/b/output/common.js] -var Main; -(function (Main) { - function fooBar() { } - Main.fooBar = fooBar; -})(Main || (Main = {})); -var main; -(function (main) { - var file4; - (function (file4) { - function foo(a) { } - file4.foo = foo; - })(file4 = main.file4 || (main.file4 = {})); -})(main || (main = {})); - - +/a/lib/tsc.js --w -p /a/b/project/tsconfig.json Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -91,3 +76,20 @@ FsWatchesRecursive:: {"directoryName":"/a/b/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/output/common.js] +var Main; +(function (Main) { + function fooBar() { } + Main.fooBar = fooBar; +})(Main || (Main = {})); +var main; +(function (main) { + var file4; + (function (file4) { + function foo(a) { } + file4.foo = foo; + })(file4 = main.file4 || (main.file4 = {})); +})(main || (main = {})); + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/without---outFile-and-multiple-declaration-files-in-the-program.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/without---outFile-and-multiple-declaration-files-in-the-program.js index 576e836605f60..c1a9b5adeadef 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/without---outFile-and-multiple-declaration-files-in-the-program.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/without---outFile-and-multiple-declaration-files-in-the-program.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/project/tsconfig.json +Input:: //// [/a/b/output/AnotherDependency/file1.d.ts] declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } } @@ -27,26 +27,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/project/tsconfig.json] {"compilerOptions":{"outDir":"../output","target":"es5"},"files":["/a/b/output/AnotherDependency/file1.d.ts","/a/b/dependencies/file2.d.ts","/a/b/project/src/main.ts","/a/b/project/src/main2.ts"]} -//// [/a/b/output/main.js] -var Main; -(function (Main) { - function fooBar() { } - Main.fooBar = fooBar; -})(Main || (Main = {})); - - -//// [/a/b/output/main2.js] -var main; -(function (main) { - var file4; - (function (file4) { - function foo(a) { } - file4.foo = foo; - })(file4 = main.file4 || (main.file4 = {})); -})(main || (main = {})); - - +/a/lib/tsc.js --w -p /a/b/project/tsconfig.json Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -99,3 +81,23 @@ FsWatchesRecursive:: {"directoryName":"/a/b/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/output/main.js] +var Main; +(function (Main) { + function fooBar() { } + Main.fooBar = fooBar; +})(Main || (Main = {})); + + +//// [/a/b/output/main2.js] +var main; +(function (main) { + var file4; + (function (file4) { + function foo(a) { } + file4.foo = foo; + })(file4 = main.file4 || (main.file4 = {})); +})(main || (main = {})); + + diff --git a/tests/baselines/reference/tscWatch/emit/when-module-emit-is-specified-as-node/when-instead-of-filechanged-recursive-directory-watcher-is-invoked.js b/tests/baselines/reference/tscWatch/emit/when-module-emit-is-specified-as-node/when-instead-of-filechanged-recursive-directory-watcher-is-invoked.js index 83c28e293c699..ab135cdcb547e 100644 --- a/tests/baselines/reference/tscWatch/emit/when-module-emit-is-specified-as-node/when-instead-of-filechanged-recursive-directory-watcher-is-invoked.js +++ b/tests/baselines/reference/tscWatch/emit/when-module-emit-is-specified-as-node/when-instead-of-filechanged-recursive-directory-watcher-is-invoked.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --p /a/rootFolder/project/tsconfig.json +Input:: //// [/a/rootFolder/project/tsconfig.json] {"compilerOptions":{"module":"none","allowJs":true,"outDir":"Static/scripts/"},"include":["Scripts/**/*"]} @@ -21,15 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/rootFolder/project/Static/scripts/Javascript.js] -var zz = 10; - - -//// [/a/rootFolder/project/Static/scripts/TypeScript.js] -var z = 10; - - +/a/lib/tsc.js --w --p /a/rootFolder/project/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -71,16 +64,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Modify typescript file +//// [/a/rootFolder/project/Static/scripts/Javascript.js] +var zz = 10; -//// [/a/rootFolder/project/Scripts/TypeScript.ts] -var zz30 = 100; -//// [/a/rootFolder/project/Static/scripts/Javascript.js] file written with same contents //// [/a/rootFolder/project/Static/scripts/TypeScript.js] -var zz30 = 100; +var z = 10; + +Change:: Modify typescript file + +Input:: +//// [/a/rootFolder/project/Scripts/TypeScript.ts] +var zz30 = 100; + Output:: >> Screen clear @@ -122,3 +120,9 @@ FsWatchesRecursive:: {"directoryName":"/a/rootfolder/project/scripts","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/rootFolder/project/Static/scripts/Javascript.js] file written with same contents +//// [/a/rootFolder/project/Static/scripts/TypeScript.js] +var zz30 = 100; + + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-file-changes.js index d76c98d99bfec..678f442c81778 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,42 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - this.d = 1; - } - return C; -}()); -exports.C = C; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.B = void 0; -var c_1 = require("./c"); -var B = /** @class */ (function () { - function B() { - this.c = new c_1.C(); - } - return B; -}()); -exports.B = B; - - -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -115,28 +81,51 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; exports.C = void 0; var C = /** @class */ (function () { function C() { - this.d2 = 1; + this.d = 1; } return C; }()); exports.C = C; -//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.B = void 0; +var c_1 = require("./c"); +var B = /** @class */ (function () { + function B() { + this.c = new c_1.C(); + } + return B; +}()); +exports.B = B; + + +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + Output:: >> Screen clear @@ -180,3 +169,18 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + this.d2 = 1; + } + return C; +}()); +exports.C = C; + + +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index 463c9de0544c7..cbfbf3d44b125 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,15 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -90,8 +83,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { @@ -143,3 +146,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js index ab5afbce6a0d1..657185cbc021b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,47 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -161,8 +122,50 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + + Change:: Rename property x2 to x of interface Coords +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -173,8 +176,6 @@ export interface Coords { y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] file written with same contents Output:: >> Screen clear @@ -242,3 +243,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 03e43850ee96a..ced09b7bee581 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:00:54 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -152,74 +213,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:00:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents Output:: >> Screen clear @@ -273,3 +274,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index d9199bcceeff8..861edfaf54824 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:00:50 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -134,70 +191,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:00:50 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents Output:: >> Screen clear @@ -248,3 +249,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..573187027d65f --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js @@ -0,0 +1,534 @@ +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js --w --incremental +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:04 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:09 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:10 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:14 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... + + +[12:01:26 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js index 52b857514a001..506e4dbccaa26 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,14 +90,117 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:00:58 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -117,12 +221,130 @@ console.log("hi"); +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:01:02 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:03 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:07 AM] File change detected. Starting incremental compilation... -[12:00:53 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:08 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:12 AM] File change detected. Starting incremental compilation... + + +[12:01:16 AM] Found 0 errors. Watching for file changes. @@ -158,3 +380,57 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 58a0005b30727..c1499426dfe62 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,6 +34,53 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] +Program options: {"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} +/user/username/projects/myproject/c.ts: + {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject: + {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -87,12 +134,22 @@ export {}; +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + + Output:: >> Screen clear -[12:00:25 AM] Starting compilation in watch mode... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:38 AM] Found 0 errors. Watching for file changes. +[12:00:55 AM] Found 0 errors. Watching for file changes. @@ -105,10 +162,8 @@ Program files:: /user/username/projects/myproject/a.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -132,14 +187,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -161,46 +208,3 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents - -Output:: ->> Screen clear -[12:00:42 AM] File change detected. Starting incremental compilation... - - -[12:00:55 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} -/user/username/projects/myproject/c.ts: - {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/myproject: - {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index 5e8a348d78390..982a89273f3ab 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,19 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - -//// [/user/username/projects/myproject/a.d.ts] -export {}; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -94,8 +83,22 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + +//// [/user/username/projects/myproject/a.d.ts] +export {}; + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { @@ -147,3 +150,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 236386fd3c440..1bb82e91064ac 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,77 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/a.d.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x2: number; - y: number; -} - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.d.ts] -import { Point } from "./a"; -export interface PointWrapper extends Point { -} - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/c.d.ts] -import { PointWrapper } from "./b"; -export declare function getPoint(): PointWrapper; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/d.d.ts] -export {}; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - -//// [/user/username/projects/myproject/e.d.ts] -import "./d"; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -191,20 +122,81 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property x2 to x of interface Coords +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; -//// [/user/username/projects/myproject/a.ts] + +//// [/user/username/projects/myproject/a.d.ts] export interface Point { name: string; c: Coords; } export interface Coords { - x: number; + x2: number; y: number; -} +} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.d.ts] +import { Point } from "./a"; +export interface PointWrapper extends Point { +} + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/c.d.ts] +import { PointWrapper } from "./b"; +export declare function getPoint(): PointWrapper; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/d.d.ts] +export {}; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + +//// [/user/username/projects/myproject/e.d.ts] +import "./d"; + + + +Change:: Rename property x2 to x of interface Coords + +Input:: +//// [/user/username/projects/myproject/a.ts] export interface Point { name: string; c: Coords; @@ -212,11 +204,8 @@ export interface Point { export interface Coords { x: number; y: number; -} - +} -//// [/user/username/projects/myproject/b.js] file written with same contents -//// [/user/username/projects/myproject/b.d.ts] file written with same contents Output:: >> Screen clear @@ -284,3 +273,18 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x: number; + y: number; +} + + +//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 8fd7efd32500b..e3932bd535b8b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:08 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -192,81 +253,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:01:08 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents Output:: >> Screen clear @@ -320,3 +314,13 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 76c72db2a767e..02b7ae21fec85 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:01:02 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -165,77 +222,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:01:02 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents Output:: >> Screen clear @@ -286,3 +280,13 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..7366de158e26b --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js @@ -0,0 +1,551 @@ +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js --w --incremental +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:10 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:15 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:16 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:34 AM] File change detected. Starting incremental compilation... + + +[12:01:35 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js index 5a066cb731c36..5c49133a9b39f 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,14 +90,117 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -131,12 +235,130 @@ export {}; +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:01:08 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:09 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:13 AM] File change detected. Starting incremental compilation... -[12:00:59 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + + +[12:01:25 AM] Found 0 errors. Watching for file changes. @@ -172,3 +394,58 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:29 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 98bae9be0b240..f3453be352cc5 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,42 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - this.d = 1; - } - return C; -}()); -exports.C = C; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.B = void 0; -var c_1 = require("./c"); -var B = /** @class */ (function () { - function B() { - this.c = new c_1.C(); - } - return B; -}()); -exports.B = B; - - -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -115,28 +81,51 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; exports.C = void 0; var C = /** @class */ (function () { function C() { - this.d2 = 1; + this.d = 1; } return C; }()); exports.C = C; -//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.B = void 0; +var c_1 = require("./c"); +var B = /** @class */ (function () { + function B() { + this.c = new c_1.C(); + } + return B; +}()); +exports.B = B; + + +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + Output:: >> Screen clear @@ -187,3 +176,18 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + this.d2 = 1; + } + return C; +}()); +exports.C = C; + + +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index 885f76b281a30..8f3711da6535a 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,15 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -90,8 +83,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { @@ -150,3 +153,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js index 39be95277fede..341a037d53973 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,47 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -161,8 +122,50 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + + Change:: Rename property x2 to x of interface Coords +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -173,8 +176,6 @@ export interface Coords { y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] file written with same contents Output:: >> Screen clear @@ -226,3 +227,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index e927c312aca2d..7da3a7dbe7b08 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:00:54 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -152,74 +213,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:00:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents Output:: >> Screen clear @@ -285,3 +286,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 96f39107d7d48..9f3185b89fc4a 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:00:50 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -134,70 +191,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:00:50 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents Output:: >> Screen clear @@ -259,3 +260,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..4c54f4a3dcf5a --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js @@ -0,0 +1,538 @@ +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js --w --incremental +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:04 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:09 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:10 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:14 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... + + +[12:01:26 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js index 41bbb52ea00c9..1d9f4c72e4d04 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -39,6 +39,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -95,14 +96,117 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:00:58 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -123,12 +227,130 @@ console.log("hi"); +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:01:02 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:03 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:07 AM] File change detected. Starting incremental compilation... -[12:00:53 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:08 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:12 AM] File change detected. Starting incremental compilation... + + +[12:01:16 AM] Found 0 errors. Watching for file changes. @@ -164,3 +386,57 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 753bb12c9089f..c7c400db6feae 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,6 +34,53 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] +Program options: {"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} +/user/username/projects/myproject/c.ts: + {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject: + {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -87,12 +134,28 @@ export {}; +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + + Output:: >> Screen clear -[12:00:25 AM] Starting compilation in watch mode... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:38 AM] Found 0 errors. Watching for file changes. +a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. + +4 console.log(b.c.d); +   ~ + + +[12:00:58 AM] Found 1 error. Watching for file changes. @@ -105,7 +168,6 @@ Program files:: /user/username/projects/myproject/a.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/b.ts /user/username/projects/myproject/a.ts @@ -132,14 +194,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -162,53 +216,3 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents - -Output:: ->> Screen clear -[12:00:42 AM] File change detected. Starting incremental compilation... - - -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - - -[12:00:58 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} -/user/username/projects/myproject/c.ts: - {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/myproject: - {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index 1aed7b22bc0e4..439545f26df85 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,19 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - -//// [/user/username/projects/myproject/a.d.ts] -export {}; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -94,15 +83,28 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + +//// [/user/username/projects/myproject/a.d.ts] +export {}; + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { d2: number; } -//// [/user/username/projects/myproject/a.d.ts] file written with same contents Output:: >> Screen clear @@ -155,3 +157,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 3ab5d9765474b..a82d079b1ff45 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,77 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/a.d.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x2: number; - y: number; -} - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.d.ts] -import { Point } from "./a"; -export interface PointWrapper extends Point { -} - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/c.d.ts] -import { PointWrapper } from "./b"; -export declare function getPoint(): PointWrapper; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/d.d.ts] -export {}; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - -//// [/user/username/projects/myproject/e.d.ts] -import "./d"; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -191,20 +122,81 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property x2 to x of interface Coords +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; -//// [/user/username/projects/myproject/a.ts] + +//// [/user/username/projects/myproject/a.d.ts] export interface Point { name: string; c: Coords; } export interface Coords { - x: number; + x2: number; y: number; -} +} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.d.ts] +import { Point } from "./a"; +export interface PointWrapper extends Point { +} + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/c.d.ts] +import { PointWrapper } from "./b"; +export declare function getPoint(): PointWrapper; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/d.d.ts] +export {}; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + +//// [/user/username/projects/myproject/e.d.ts] +import "./d"; + + + +Change:: Rename property x2 to x of interface Coords + +Input:: +//// [/user/username/projects/myproject/a.ts] export interface Point { name: string; c: Coords; @@ -212,13 +204,8 @@ export interface Point { export interface Coords { x: number; y: number; -} - +} -//// [/user/username/projects/myproject/b.js] file written with same contents -//// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/c.d.ts] file written with same contents -//// [/user/username/projects/myproject/d.d.ts] file written with same contents Output:: >> Screen clear @@ -270,3 +257,20 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x: number; + y: number; +} + + +//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.d.ts] file written with same contents +//// [/user/username/projects/myproject/c.d.ts] file written with same contents +//// [/user/username/projects/myproject/d.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 18c3f4e5ea19d..fb0b270d9dfec 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:08 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -192,86 +253,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:01:08 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Output:: >> Screen clear @@ -337,3 +326,18 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/app.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 9f9528102adb4..71b8c163bbca7 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:01:02 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -165,81 +222,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:01:02 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Output:: >> Screen clear @@ -301,3 +291,17 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/app.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..c39991c7ecb7c --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js @@ -0,0 +1,549 @@ +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"declaration":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js --w --incremental +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:10 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:15 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:16 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:34 AM] File change detected. Starting incremental compilation... + + +[12:01:35 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js index 521d633599d9c..abfaf05f87ddb 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,14 +90,117 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -131,12 +235,130 @@ export {}; +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:01:08 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:09 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:13 AM] File change detected. Starting incremental compilation... -[12:00:59 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + + +[12:01:25 AM] Found 0 errors. Watching for file changes. @@ -172,3 +394,58 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:29 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 9befd300cb59f..99e300fde170d 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,42 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - this.d = 1; - } - return C; -}()); -exports.C = C; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.B = void 0; -var c_1 = require("./c"); -var B = /** @class */ (function () { - function B() { - this.c = new c_1.C(); - } - return B; -}()); -exports.B = B; - - -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -115,27 +81,51 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; exports.C = void 0; var C = /** @class */ (function () { function C() { - this.d2 = 1; + this.d = 1; } return C; }()); exports.C = C; +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.B = void 0; +var c_1 = require("./c"); +var B = /** @class */ (function () { + function B() { + this.c = new c_1.C(); + } + return B; +}()); +exports.B = B; + + +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + Output:: >> Screen clear @@ -186,3 +176,17 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + this.d2 = 1; + } + return C; +}()); +exports.C = C; + + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index d2a6bdb3d1760..8d5b58eb79166 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,15 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -90,8 +83,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { @@ -150,3 +153,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js index 16443b207d4ed..51bd8f1d19a6c 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,47 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -161,8 +122,50 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + + Change:: Rename property x2 to x of interface Coords +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -173,7 +176,6 @@ export interface Coords { y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -225,3 +227,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 1c96e77804b39..9012a45cbe34b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:00:54 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -152,73 +213,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:00:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents Output:: >> Screen clear @@ -284,3 +286,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 950359dda9e4e..1fd4cc8df5be6 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:00:50 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -134,69 +191,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:00:50 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents Output:: >> Screen clear @@ -258,3 +260,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..fae85fec53efc --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js @@ -0,0 +1,534 @@ +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"isolatedModules":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js --w --incremental +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:04 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:09 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:10 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:14 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... + + +[12:01:26 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js index 3a9cebc8071d4..3e4e7d9ebc884 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,14 +90,117 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:00:58 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -117,12 +221,130 @@ console.log("hi"); +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:01:02 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:03 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:07 AM] File change detected. Starting incremental compilation... -[12:00:53 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:08 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:12 AM] File change detected. Starting incremental compilation... + + +[12:01:16 AM] Found 0 errors. Watching for file changes. @@ -158,3 +380,57 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 246ed8ea68640..670907d8c8b8e 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,6 +34,53 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] +Program options: {"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} +/user/username/projects/myproject/c.ts: + {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject: + {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -87,12 +134,28 @@ export {}; +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + + Output:: >> Screen clear -[12:00:25 AM] Starting compilation in watch mode... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:38 AM] Found 0 errors. Watching for file changes. +a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. + +4 console.log(b.c.d); +   ~ + + +[12:00:55 AM] Found 1 error. Watching for file changes. @@ -105,7 +168,6 @@ Program files:: /user/username/projects/myproject/a.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/b.ts /user/username/projects/myproject/a.ts @@ -132,14 +194,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -161,53 +215,3 @@ export declare class C { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents - -Output:: ->> Screen clear -[12:00:42 AM] File change detected. Starting incremental compilation... - - -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - - -[12:00:55 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} -/user/username/projects/myproject/c.ts: - {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/myproject: - {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index d3d3612e5869d..99797e241d431 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,19 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - -//// [/user/username/projects/myproject/a.d.ts] -export {}; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -94,15 +83,28 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + +//// [/user/username/projects/myproject/a.d.ts] +export {}; + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { d2: number; } -//// [/user/username/projects/myproject/a.d.ts] file written with same contents Output:: >> Screen clear @@ -155,3 +157,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index a34115616e14c..b0941f6d5c530 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,77 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/a.d.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x2: number; - y: number; -} - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.d.ts] -import { Point } from "./a"; -export interface PointWrapper extends Point { -} - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/c.d.ts] -import { PointWrapper } from "./b"; -export declare function getPoint(): PointWrapper; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/d.d.ts] -export {}; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - -//// [/user/username/projects/myproject/e.d.ts] -import "./d"; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -191,20 +122,81 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property x2 to x of interface Coords +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; -//// [/user/username/projects/myproject/a.ts] + +//// [/user/username/projects/myproject/a.d.ts] export interface Point { name: string; c: Coords; } export interface Coords { - x: number; + x2: number; y: number; -} +} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.d.ts] +import { Point } from "./a"; +export interface PointWrapper extends Point { +} + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/c.d.ts] +import { PointWrapper } from "./b"; +export declare function getPoint(): PointWrapper; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/d.d.ts] +export {}; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + +//// [/user/username/projects/myproject/e.d.ts] +import "./d"; + + + +Change:: Rename property x2 to x of interface Coords + +Input:: +//// [/user/username/projects/myproject/a.ts] export interface Point { name: string; c: Coords; @@ -212,12 +204,8 @@ export interface Point { export interface Coords { x: number; y: number; -} - +} -//// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/c.d.ts] file written with same contents -//// [/user/username/projects/myproject/d.d.ts] file written with same contents Output:: >> Screen clear @@ -269,3 +257,19 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x: number; + y: number; +} + + +//// [/user/username/projects/myproject/b.d.ts] file written with same contents +//// [/user/username/projects/myproject/c.d.ts] file written with same contents +//// [/user/username/projects/myproject/d.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index e793fd4f72b8d..6ac5eafcfdda2 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:08 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -192,85 +253,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:01:08 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Output:: >> Screen clear @@ -336,3 +326,17 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/app.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 8eed0ceda00ab..fdfdf054d5326 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:01:02 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -165,80 +222,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:01:02 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Output:: >> Screen clear @@ -300,3 +291,16 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/app.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..ff43939b2d827 --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js @@ -0,0 +1,551 @@ +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js --w --incremental +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:10 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:15 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:16 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:34 AM] File change detected. Starting incremental compilation... + + +[12:01:35 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js index afc8a1c445691..4c37c0c9949cf 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,14 +90,117 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Syntax error + +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -131,12 +235,130 @@ export {}; +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:01:08 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:09 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:13 AM] File change detected. Starting incremental compilation... -[12:00:59 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + + +[12:01:25 AM] Found 0 errors. Watching for file changes. @@ -172,3 +394,58 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:29 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js index a3b100ebb2fd0..846b40f92ed59 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/logger.ts] export class logger { } @@ -21,26 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/logger.js] -"use strict"; -exports.__esModule = true; -exports.logger = void 0; -var logger = /** @class */ (function () { - function logger() { - } - return logger; -}()); -exports.logger = logger; - - -//// [/user/username/projects/myproject/another.js] -"use strict"; -exports.__esModule = true; -var logger_1 = require("./logger"); -new logger_1.logger(); - - +/a/lib/tsc.js --w --p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -82,18 +64,32 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change module name from logger to Logger +//// [/user/username/projects/myproject/logger.js] +"use strict"; +exports.__esModule = true; +exports.logger = void 0; +var logger = /** @class */ (function () { + function logger() { + } + return logger; +}()); +exports.logger = logger; -//// [/user/username/projects/myproject/another.ts] -import { logger } from "./Logger"; new logger(); //// [/user/username/projects/myproject/another.js] "use strict"; exports.__esModule = true; -var Logger_1 = require("./Logger"); -new Logger_1.logger(); +var logger_1 = require("./logger"); +new logger_1.logger(); + +Change:: Change module name from logger to Logger + +Input:: +//// [/user/username/projects/myproject/another.ts] +import { logger } from "./Logger"; new logger(); + Output:: >> Screen clear @@ -139,3 +135,11 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/another.js] +"use strict"; +exports.__esModule = true; +var Logger_1 = require("./Logger"); +new Logger_1.logger(); + + diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js index 2eb2a2a367c1d..da71904a3e9dc 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/logger.ts] export class logger { } @@ -21,26 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/logger.js] -"use strict"; -exports.__esModule = true; -exports.logger = void 0; -var logger = /** @class */ (function () { - function logger() { - } - return logger; -}()); -exports.logger = logger; - - -//// [/user/username/projects/myproject/another.js] -"use strict"; -exports.__esModule = true; -var logger_1 = require("./logger"); -new logger_1.logger(); - - +/a/lib/tsc.js --w --p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -82,8 +64,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/logger.js] +"use strict"; +exports.__esModule = true; +exports.logger = void 0; +var logger = /** @class */ (function () { + function logger() { + } + return logger; +}()); +exports.logger = logger; + + +//// [/user/username/projects/myproject/another.js] +"use strict"; +exports.__esModule = true; +var logger_1 = require("./logger"); +new logger_1.logger(); + + + Change:: Change name of file from logger to Logger +Input:: //// [/user/username/projects/myproject/Logger.ts] file was renamed from file /user/username/projects/myproject/logger.ts Output:: @@ -129,3 +132,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-incremental.js b/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-incremental.js index 365c6f2a18c40..20b55b9b93e8d 100644 --- a/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -42,6 +42,35 @@ export { C } from "./c"; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"target":"es5","module":"commonjs","declaration":true,"emitDeclarationOnly":true}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/a.ts","/users/username/projects/project/b.ts","/users/username/projects/project/c.ts","/users/username/projects/project/index.ts"] +Program options: {"incremental":true,"target":1,"module":1,"declaration":true,"emitDeclarationOnly":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/c.ts +/users/username/projects/project/b.ts +/users/username/projects/project/a.ts +/users/username/projects/project/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/c.ts +/users/username/projects/project/b.ts +/users/username/projects/project/a.ts +/users/username/projects/project/index.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/c.d.ts] import { A } from "./a"; export interface C { @@ -151,6 +180,18 @@ export { C } from "./c"; } +Change:: + +Input:: +//// [/users/username/projects/project/a.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} + + + Output:: @@ -164,7 +205,6 @@ Program files:: /users/username/projects/project/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /users/username/projects/project/c.ts /users/username/projects/project/b.ts /users/username/projects/project/a.ts @@ -178,16 +218,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.Success -Change:: - -//// [/users/username/projects/project/a.ts] -import { B } from "./b"; -export interface A { - b: B; - foo: any; -} - - //// [/users/username/projects/project/c.d.ts] file written with same contents //// [/users/username/projects/project/b.d.ts] file written with same contents //// [/users/username/projects/project/a.d.ts] @@ -280,29 +310,3 @@ export interface A { "version": "FakeTSVersion" } - -Output:: - - -Program root files: ["/users/username/projects/project/a.ts","/users/username/projects/project/b.ts","/users/username/projects/project/c.ts","/users/username/projects/project/index.ts"] -Program options: {"incremental":true,"target":1,"module":1,"declaration":true,"emitDeclarationOnly":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/c.ts -/users/username/projects/project/b.ts -/users/username/projects/project/a.ts -/users/username/projects/project/index.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/c.ts -/users/username/projects/project/b.ts -/users/username/projects/project/a.ts -/users/username/projects/project/index.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-watch.js b/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-watch.js index 05a0761a77f37..effba9ef87ed9 100644 --- a/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -42,6 +42,57 @@ export { C } from "./c"; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"target":"es5","module":"commonjs","declaration":true,"emitDeclarationOnly":true}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:27 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/a.ts","/users/username/projects/project/b.ts","/users/username/projects/project/c.ts","/users/username/projects/project/index.ts"] +Program options: {"incremental":true,"target":1,"module":1,"declaration":true,"emitDeclarationOnly":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/c.ts +/users/username/projects/project/b.ts +/users/username/projects/project/a.ts +/users/username/projects/project/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/c.ts +/users/username/projects/project/b.ts +/users/username/projects/project/a.ts +/users/username/projects/project/index.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/a.ts: + {"fileName":"/users/username/projects/project/a.ts","pollingInterval":250} +/users/username/projects/project/b.ts: + {"fileName":"/users/username/projects/project/b.ts","pollingInterval":250} +/users/username/projects/project/c.ts: + {"fileName":"/users/username/projects/project/c.ts","pollingInterval":250} +/users/username/projects/project/index.ts: + {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/c.d.ts] import { A } from "./a"; export interface C { @@ -152,12 +203,24 @@ export { C } from "./c"; } +Change:: + +Input:: +//// [/users/username/projects/project/a.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} + + + Output:: >> Screen clear -[12:00:27 AM] Starting compilation in watch mode... +[12:00:42 AM] Starting compilation in watch mode... -[12:00:38 AM] Found 0 errors. Watching for file changes. +[12:00:58 AM] Found 0 errors. Watching for file changes. @@ -171,7 +234,6 @@ Program files:: /users/username/projects/project/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /users/username/projects/project/c.ts /users/username/projects/project/b.ts /users/username/projects/project/a.ts @@ -201,16 +263,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/a.ts] -import { B } from "./b"; -export interface A { - b: B; - foo: any; -} - - //// [/users/username/projects/project/c.d.ts] file written with same contents //// [/users/username/projects/project/b.d.ts] file written with same contents //// [/users/username/projects/project/a.d.ts] @@ -304,51 +356,3 @@ export interface A { "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:42 AM] Starting compilation in watch mode... - - -[12:00:58 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/a.ts","/users/username/projects/project/b.ts","/users/username/projects/project/c.ts","/users/username/projects/project/index.ts"] -Program options: {"incremental":true,"target":1,"module":1,"declaration":true,"emitDeclarationOnly":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/c.ts -/users/username/projects/project/b.ts -/users/username/projects/project/a.ts -/users/username/projects/project/index.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/c.ts -/users/username/projects/project/b.ts -/users/username/projects/project/a.ts -/users/username/projects/project/index.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/a.ts: - {"fileName":"/users/username/projects/project/a.ts","pollingInterval":250} -/users/username/projects/project/b.ts: - {"fileName":"/users/username/projects/project/b.ts","pollingInterval":250} -/users/username/projects/project/c.ts: - {"fileName":"/users/username/projects/project/c.ts","pollingInterval":250} -/users/username/projects/project/index.ts: - {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js index 38683519ba85b..90c3ae77f08e4 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,40 @@ export const y: string = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd"}} + +/a/lib/tsc.js -i +Output:: +file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. + +1 export const y: string = 20; +   ~ + + + +Found 1 error. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -88,6 +122,13 @@ define(["require", "exports"], function (require, exports) { } +Change:: + +Input:: +//// [/users/username/projects/project/file1.ts] +export const z = 10; + + Output:: file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -108,9 +149,7 @@ Program files:: /users/username/projects/project/file2.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts WatchedFiles:: @@ -120,11 +159,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated -Change:: - -//// [/users/username/projects/project/file1.ts] -export const z = 10; - //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -182,33 +216,3 @@ define(["require", "exports"], function (require, exports) { "version": "FakeTSVersion" } - -Output:: -file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. - -1 export const y: string = 20; -   ~ - - - -Found 1 error. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/file1.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-watch.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-watch.js index 6b5182eb320b7..9dd7e5107581a 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,55 @@ export const y: string = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd"}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. + +1 export const y: string = 20; +   ~ + + +[12:00:30 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -89,9 +138,16 @@ define(["require", "exports"], function (require, exports) { } +Change:: + +Input:: +//// [/users/username/projects/project/file1.ts] +export const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -100,7 +156,7 @@ Output::    ~ -[12:00:30 AM] Found 1 error. Watching for file changes. +[12:00:41 AM] Found 1 error. Watching for file changes. @@ -112,9 +168,7 @@ Program files:: /users/username/projects/project/file2.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts WatchedFiles:: /users/username/projects/project/tsconfig.json: @@ -136,11 +190,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file1.ts] -export const z = 10; - //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -199,48 +248,3 @@ define(["require", "exports"], function (require, exports) { "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. - -1 export const y: string = 20; -   ~ - - -[12:00:41 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/file1.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-incremental.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-incremental.js index 56905961a52bd..84c54399ab0e0 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,31 @@ export const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd"}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -76,6 +101,13 @@ define(["require", "exports"], function (require, exports) { } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +export const z = 10; + + Output:: @@ -87,8 +119,6 @@ Program files:: /users/username/projects/project/file2.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts /users/username/projects/project/file2.ts WatchedFiles:: @@ -99,11 +129,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.Success -Change:: - -//// [/users/username/projects/project/file2.ts] -export const z = 10; - //// [/users/username/projects/project/file2.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -149,24 +174,3 @@ define(["require", "exports"], function (require, exports) { "version": "FakeTSVersion" } - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/file2.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-watch.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-watch.js index 3e47a20b302bc..4dc9c9bac62ec 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,49 @@ export const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd"}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -77,12 +120,19 @@ define(["require", "exports"], function (require, exports) { } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +export const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... -[12:00:30 AM] Found 0 errors. Watching for file changes. +[12:00:41 AM] Found 0 errors. Watching for file changes. @@ -94,8 +144,6 @@ Program files:: /users/username/projects/project/file2.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts /users/username/projects/project/file2.ts WatchedFiles:: @@ -118,11 +166,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file2.ts] -export const z = 10; - //// [/users/username/projects/project/file2.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -169,42 +212,3 @@ define(["require", "exports"], function (require, exports) { "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -[12:00:41 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/file2.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-incremental.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-incremental.js index 45a1509e76e76..54598288bb73c 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,28 @@ export const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd","outFile":"out.js"}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"outFile":"/users/username/projects/project/out.js","configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/out.js] define("file1", ["require", "exports"], function (require, exports) { "use strict"; @@ -77,23 +99,3 @@ define("file2", ["require", "exports"], function (require, exports) { ====================================================================== - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"outFile":"/users/username/projects/project/out.js","configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -No cached semantic diagnostics in the builder:: - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-watch.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-watch.js index 35d0ead9ec197..1e53b7ef91e02 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,46 @@ export const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd","outFile":"out.js"}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:28 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"outFile":"/users/username/projects/project/out.js","watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/out.js] define("file1", ["require", "exports"], function (require, exports) { "use strict"; @@ -77,41 +117,3 @@ define("file2", ["require", "exports"], function (require, exports) { ====================================================================== - -Output:: ->> Screen clear -[12:00:23 AM] Starting compilation in watch mode... - - -[12:00:28 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"outFile":"/users/username/projects/project/out.js","watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -No cached semantic diagnostics in the builder:: - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js index f18ae0b753a34..b4d69bd3cf76a 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,40 @@ const x = 10; //// [/users/username/projects/project/file2.ts] const y: string = 20; + +/a/lib/tsc.js -i +Output:: +file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +1 const y: string = 20; +   ~ + + + +Found 1 error. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + //// [/users/username/projects/project/file1.js] var x = 10; @@ -77,6 +111,13 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file1.ts] +const z = 10; + + Output:: file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -109,11 +150,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated -Change:: - -//// [/users/username/projects/project/file1.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] var z = 10; @@ -166,35 +202,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: -file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -1 const y: string = 20; -   ~ - - - -Found 1 error. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-watch.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-watch.js index a89fd0ac73be0..ee0119a60f240 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,55 @@ const x = 10; //// [/users/username/projects/project/file2.ts] const y: string = 20; + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +1 const y: string = 20; +   ~ + + +[12:00:30 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] var x = 10; @@ -78,9 +127,16 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file1.ts] +const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -89,7 +145,7 @@ Output::    ~ -[12:00:30 AM] Found 1 error. Watching for file changes. +[12:00:44 AM] Found 1 error. Watching for file changes. @@ -125,11 +181,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file1.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] var z = 10; @@ -183,50 +234,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -1 const y: string = 20; -   ~ - - -[12:00:44 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-incremental.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-incremental.js index c0f957dbfc787..e0b106a3661bd 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i -p tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,31 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -i -p tsconfig.json +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"project":"/users/username/projects/project/tsconfig.json","configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/file1.js] var x = 10; @@ -66,6 +91,13 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +const z = 10; + + Output:: @@ -89,11 +121,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.Success -Change:: - -//// [/users/username/projects/project/file2.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] file written with same contents //// [/users/username/projects/project/file2.js] var z = 10; @@ -135,26 +162,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"project":"/users/username/projects/project/tsconfig.json","configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-watch.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-watch.js index 436fedacfabd5..048847f50ab15 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,49 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -w -p tsconfig.json +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"watch":true,"project":"/users/username/projects/project/tsconfig.json","configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] var x = 10; @@ -67,12 +110,19 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... -[12:00:30 AM] Found 0 errors. Watching for file changes. +[12:00:44 AM] Found 0 errors. Watching for file changes. @@ -108,11 +158,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file2.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] file written with same contents //// [/users/username/projects/project/file2.js] var z = 10; @@ -155,44 +200,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -[12:00:44 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"watch":true,"project":"/users/username/projects/project/tsconfig.json","configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-incremental.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-incremental.js index 340a0870acc7f..cfe0d394096f8 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,31 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/file1.js] var x = 10; @@ -65,6 +90,13 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +const z = 10; + + Output:: @@ -88,11 +120,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.Success -Change:: - -//// [/users/username/projects/project/file2.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] file written with same contents //// [/users/username/projects/project/file2.js] var z = 10; @@ -133,26 +160,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-watch.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-watch.js index d6403f05f9832..a13bc347bf484 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,49 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] var x = 10; @@ -66,12 +109,19 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... -[12:00:30 AM] Found 0 errors. Watching for file changes. +[12:00:44 AM] Found 0 errors. Watching for file changes. @@ -107,11 +157,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file2.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] file written with same contents //// [/users/username/projects/project/file2.js] var z = 10; @@ -153,44 +198,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -[12:00:44 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js index 9912192f03220..b23aae24c4e93 100644 --- a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -23,6 +23,31 @@ console.log(Config.value); //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/globals.d.ts","/users/username/projects/project/index.ts"] +Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/globals.d.ts +/users/username/projects/project/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/globals.d.ts +/users/username/projects/project/index.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/index.js] console.log(Config.value); @@ -63,19 +88,30 @@ console.log(Config.value); } +Change:: + +Input:: +//// [/users/username/projects/project/globals.d.ts] deleted + Output:: +index.ts:1:13 - error TS2304: Cannot find name 'Config'. + +1 console.log(Config.value); +   ~~~~~~ + + +Found 1 error. + -Program root files: ["/users/username/projects/project/globals.d.ts","/users/username/projects/project/index.ts"] + +Program root files: ["/users/username/projects/project/index.ts"] Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/users/username/projects/project/globals.d.ts /users/username/projects/project/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/globals.d.ts /users/username/projects/project/index.ts WatchedFiles:: @@ -84,9 +120,7 @@ FsWatches:: FsWatchesRecursive:: -exitCode:: ExitStatus.Success - -Change:: +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated //// [/users/username/projects/project/index.js] file written with same contents //// [/users/username/projects/project/tsconfig.tsbuildinfo] @@ -130,33 +164,3 @@ Change:: "version": "FakeTSVersion" } -//// [/users/username/projects/project/globals.d.ts] deleted - -Output:: -index.ts:1:13 - error TS2304: Cannot find name 'Config'. - -1 console.log(Config.value); -   ~~~~~~ - - - -Found 1 error. - - - -Program root files: ["/users/username/projects/project/index.ts"] -Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/index.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/index.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-watch.js b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-watch.js index 844cd06bc43eb..937711368678d 100644 --- a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -23,6 +23,49 @@ console.log(Config.value); //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:28 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/globals.d.ts","/users/username/projects/project/index.ts"] +Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/globals.d.ts +/users/username/projects/project/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/globals.d.ts +/users/username/projects/project/index.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/globals.d.ts: + {"fileName":"/users/username/projects/project/globals.d.ts","pollingInterval":250} +/users/username/projects/project/index.ts: + {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/index.js] console.log(Config.value); @@ -64,32 +107,38 @@ console.log(Config.value); } +Change:: + +Input:: +//// [/users/username/projects/project/globals.d.ts] deleted + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:30 AM] Starting compilation in watch mode... -[12:00:28 AM] Found 0 errors. Watching for file changes. +index.ts:1:13 - error TS2304: Cannot find name 'Config'. + +1 console.log(Config.value); +   ~~~~~~ +[12:00:37 AM] Found 1 error. Watching for file changes. + -Program root files: ["/users/username/projects/project/globals.d.ts","/users/username/projects/project/index.ts"] + +Program root files: ["/users/username/projects/project/index.ts"] Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/users/username/projects/project/globals.d.ts /users/username/projects/project/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/globals.d.ts /users/username/projects/project/index.ts WatchedFiles:: /users/username/projects/project/tsconfig.json: {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/globals.d.ts: - {"fileName":"/users/username/projects/project/globals.d.ts","pollingInterval":250} /users/username/projects/project/index.ts: {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} /a/lib/lib.d.ts: @@ -105,8 +154,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - //// [/users/username/projects/project/index.js] file written with same contents //// [/users/username/projects/project/tsconfig.tsbuildinfo] { @@ -150,46 +197,3 @@ Change:: "version": "FakeTSVersion" } -//// [/users/username/projects/project/globals.d.ts] deleted - -Output:: ->> Screen clear -[12:00:30 AM] Starting compilation in watch mode... - - -index.ts:1:13 - error TS2304: Cannot find name 'Config'. - -1 console.log(Config.value); -   ~~~~~~ - - -[12:00:37 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/index.ts"] -Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/index.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/index.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/index.ts: - {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/with---out-incremental.js b/tests/baselines/reference/tscWatch/incremental/with---out-incremental.js index 755aae38414ce..8752fcfc950da 100644 --- a/tests/baselines/reference/tscWatch/incremental/with---out-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/with---out-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,28 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"outFile":"out.js"}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"outFile":"/users/username/projects/project/out.js","configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/out.js] var x = 10; var y = 20; @@ -57,23 +79,3 @@ var y = 20; ====================================================================== - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"outFile":"/users/username/projects/project/out.js","configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -No cached semantic diagnostics in the builder:: - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/with---out-watch.js b/tests/baselines/reference/tscWatch/incremental/with---out-watch.js index 48f323ca94904..74d8a0e7d8fad 100644 --- a/tests/baselines/reference/tscWatch/incremental/with---out-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/with---out-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,43 +21,8 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"outFile":"out.js"}} -//// [/users/username/projects/project/out.js] -var x = 10; -var y = 20; - - -//// [/users/username/projects/project/out.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "./", - "sourceFiles": [ - "./file1.ts", - "./file2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 24, - "kind": "text" - } - ] - } - }, - "version": "FakeTSVersion" -} - -//// [/users/username/projects/project/out.tsbuildinfo.baseline.txt] -====================================================================== -File:: /users/username/projects/project/out.js ----------------------------------------------------------------------- -text: (0-24) -var x = 10; -var y = 20; - -====================================================================== - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -95,3 +60,40 @@ FsWatchesRecursive:: {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/users/username/projects/project/out.js] +var x = 10; +var y = 20; + + +//// [/users/username/projects/project/out.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "./", + "sourceFiles": [ + "./file1.ts", + "./file2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 24, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/users/username/projects/project/out.tsbuildinfo.baseline.txt] +====================================================================== +File:: /users/username/projects/project/out.js +---------------------------------------------------------------------- +text: (0-24) +var x = 10; +var y = 20; + +====================================================================== + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Configure-file-diagnostics-events-are-generated-when-the-config-file-has-errors.js b/tests/baselines/reference/tscWatch/programUpdates/Configure-file-diagnostics-events-are-generated-when-the-config-file-has-errors.js index 383145eb54d45..8c7c69a022520 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Configure-file-diagnostics-events-are-generated-when-the-config-file-has-errors.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Configure-file-diagnostics-events-are-generated-when-the-config-file-has-errors.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 10 @@ -23,11 +23,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/app.js] -var x = 10; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -76,3 +73,8 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/app.js] +var x = 10; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Options-Diagnostic-locations-reported-correctly-with-changes-in-configFile-contents-when-options-change.js b/tests/baselines/reference/tscWatch/programUpdates/Options-Diagnostic-locations-reported-correctly-with-changes-in-configFile-contents-when-options-change.js index a1ba8d3cd229c..997998994b27d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Options-Diagnostic-locations-reported-correctly-with-changes-in-configFile-contents-when-options-change.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Options-Diagnostic-locations-reported-correctly-with-changes-in-configFile-contents-when-options-change.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 10 @@ -26,11 +26,8 @@ interface Array { length: number; [n: number]: T; } } } -//// [/a/b/app.js] -var x = 10; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXBwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQSJ9 - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -84,8 +81,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/app.js] +var x = 10; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXBwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQSJ9 + + Change:: Remove the comment from config file +Input:: //// [/a/b/tsconfig.json] { @@ -148,3 +151,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Proper-errors-document-is-not-contained-in-project.js b/tests/baselines/reference/tscWatch/programUpdates/Proper-errors-document-is-not-contained-in-project.js index 554a671cc9219..8c83002697e72 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Proper-errors-document-is-not-contained-in-project.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Proper-errors-document-is-not-contained-in-project.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] @@ -18,10 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] { -//// [/a/b/app.js] - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -69,3 +67,7 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/app.js] + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Reports-errors-when-the-config-file-changes.js b/tests/baselines/reference/tscWatch/programUpdates/Reports-errors-when-the-config-file-changes.js index 65754c1610855..fde76a8484b63 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Reports-errors-when-the-config-file-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Reports-errors-when-the-config-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 10 @@ -18,11 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/app.js] -var x = 10; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -60,8 +57,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/app.js] +var x = 10; + + + Change:: change config file to add error +Input:: //// [/a/b/tsconfig.json] { "compilerOptions": { @@ -111,8 +114,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: change config file to remove error +Input:: //// [/a/b/tsconfig.json] { "compilerOptions": { @@ -154,3 +159,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Updates-diagnostics-when-'--noUnusedLabels'-changes.js b/tests/baselines/reference/tscWatch/programUpdates/Updates-diagnostics-when-'--noUnusedLabels'-changes.js index 594cd2eb8fabf..385e212c21511 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Updates-diagnostics-when-'--noUnusedLabels'-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Updates-diagnostics-when-'--noUnusedLabels'-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -18,11 +18,8 @@ label: while (1) {} //// [/tsconfig.json] {"compilerOptions":{"allowUnusedLabels":true}} -//// [/a.js] -label: while (1) { } - - +/a/lib/tsc.js -w -p /tsconfig.json Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -58,8 +55,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a.js] +label: while (1) { } + + + Change:: Disable allowUnsusedLabels +Input:: //// [/tsconfig.json] {"compilerOptions":{"allowUnusedLabels":false}} @@ -105,8 +108,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Enable allowUnsusedLabels +Input:: //// [/tsconfig.json] {"compilerOptions":{"allowUnusedLabels":true}} @@ -145,3 +150,4 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/add-new-files-to-a-configured-program-without-file-list.js b/tests/baselines/reference/tscWatch/programUpdates/add-new-files-to-a-configured-program-without-file-list.js index f8c37664c82c0..74d384d0d8bd4 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/add-new-files-to-a-configured-program-without-file-list.js +++ b/tests/baselines/reference/tscWatch/programUpdates/add-new-files-to-a-configured-program-without-file-list.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/commonFile1.ts] let x = 1 @@ -18,11 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {} -//// [/a/b/commonFile1.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -60,16 +57,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +var x = 1; + + + Change:: Create commonFile2 -//// [/a/b/commonFile1.js] file written with same contents +Input:: //// [/a/b/commonFile2.ts] let y = 1 -//// [/a/b/commonFile2.js] -var y = 1; - - Output:: >> Screen clear @@ -111,3 +109,9 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] file written with same contents +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/add-the-missing-module-file-for-inferred-project-should-remove-the-module-not-found-error.js b/tests/baselines/reference/tscWatch/programUpdates/add-the-missing-module-file-for-inferred-project-should-remove-the-module-not-found-error.js index 28536787baa6f..b7cd480a70459 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/add-the-missing-module-file-for-inferred-project-should-remove-the-module-not-found-error.js +++ b/tests/baselines/reference/tscWatch/programUpdates/add-the-missing-module-file-for-inferred-project-should-remove-the-module-not-found-error.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/file1.ts +Input:: //// [/a/b/file1.ts] import * as T from "./moduleFile"; T.bar(); @@ -15,14 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; -var T = require("./moduleFile"); -T.bar(); - - +/a/lib/tsc.js -w /a/b/file1.ts Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -62,20 +56,20 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; +var T = require("./moduleFile"); +T.bar(); + + + Change:: Create module file -//// [/a/b/file1.js] file written with same contents +Input:: //// [/a/b/moduleFile.ts] export function bar() { } -//// [/a/b/moduleFile.js] -"use strict"; -exports.__esModule = true; -exports.bar = void 0; -function bar() { } -exports.bar = bar; - - Output:: >> Screen clear @@ -110,3 +104,13 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/file1.js] file written with same contents +//// [/a/b/moduleFile.js] +"use strict"; +exports.__esModule = true; +exports.bar = void 0; +function bar() { } +exports.bar = bar; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-in-list-of-files).js b/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-in-list-of-files).js index 05b4dff88047c..dbca0e6dee9f9 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-in-list-of-files).js +++ b/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-in-list-of-files).js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] let x = 1 @@ -21,11 +21,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {"compilerOptions":{},"files":["f1.ts"]} -//// [/a/b/f1.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -61,16 +58,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/f1.js] +var x = 1; + + + Change:: Modify config to make f2 as root too +Input:: //// [/a/b/tsconfig.json] {"compilerOptions":{},"files":["f1.ts","f2.ts"]} -//// [/a/b/f1.js] file written with same contents -//// [/a/b/f2.js] -var y = 1; - - Output:: >> Screen clear @@ -110,3 +108,9 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] file written with same contents +//// [/a/b/f2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-on-disk).js b/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-on-disk).js index 9ce22191c99f4..481bb09e67e25 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-on-disk).js +++ b/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-on-disk).js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] let x = 1 @@ -18,11 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {} -//// [/a/b/f1.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -60,16 +57,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/f1.js] +var x = 1; + + + Change:: Write f2 -//// [/a/b/f1.js] file written with same contents +Input:: //// [/a/b/f2.ts] let y = 1 -//// [/a/b/f2.js] -var y = 1; - - Output:: >> Screen clear @@ -111,3 +109,9 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] file written with same contents +//// [/a/b/f2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/can-handle-tsconfig-file-name-with-difference-casing.js b/tests/baselines/reference/tscWatch/programUpdates/can-handle-tsconfig-file-name-with-difference-casing.js index 4b09ae0d84c00..ea62b80683445 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/can-handle-tsconfig-file-name-with-difference-casing.js +++ b/tests/baselines/reference/tscWatch/programUpdates/can-handle-tsconfig-file-name-with-difference-casing.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /A/B/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 1 @@ -18,11 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {"include":["app.ts"]} -//// [/A/B/app.js] -var x = 1; - - +/a/lib/tsc.js -w -p /A/B/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -57,3 +54,8 @@ FsWatchesRecursive:: {"directoryName":"/A/B/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/A/B/app.js] +var x = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/can-update-configured-project-when-set-of-root-files-was-not-changed.js b/tests/baselines/reference/tscWatch/programUpdates/can-update-configured-project-when-set-of-root-files-was-not-changed.js index 54c0a0a507672..b38bb0fcc1a2c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/can-update-configured-project-when-set-of-root-files-was-not-changed.js +++ b/tests/baselines/reference/tscWatch/programUpdates/can-update-configured-project-when-set-of-root-files-was-not-changed.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] let x = 1 @@ -21,15 +21,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {"compilerOptions":{},"files":["f1.ts","f2.ts"]} -//// [/a/b/f1.js] -var x = 1; - - -//// [/a/b/f2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -69,17 +62,22 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Modify config to set outFile option +//// [/a/b/f1.js] +var x = 1; -//// [/a/b/tsconfig.json] -{"compilerOptions":{"outFile":"out.js"},"files":["f1.ts","f2.ts"]} -//// [/a/b/out.js] -var x = 1; +//// [/a/b/f2.js] var y = 1; +Change:: Modify config to set outFile option + +Input:: +//// [/a/b/tsconfig.json] +{"compilerOptions":{"outFile":"out.js"},"files":["f1.ts","f2.ts"]} + + Output:: >> Screen clear [12:00:26 AM] File change detected. Starting incremental compilation... @@ -115,3 +113,9 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/out.js] +var x = 1; +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js b/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js index b5479b072793b..cdd141acda896 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js +++ b/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/f1.ts +Input:: //// [/a/b/f1.ts] export * from "./f2" @@ -21,30 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/f2.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -exports.x = 1; - - -//// [/a/b/f1.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./f2"), exports); - - +/a/lib/tsc.js -w /a/b/f1.ts Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -80,12 +58,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Modify f2 to include f3 +//// [/a/b/f2.js] +"use strict"; +exports.__esModule = true; +exports.x = void 0; +exports.x = 1; -//// [/a/b/f2.ts] -export * from "../c/f3" -//// [/a/b/f2.js] +//// [/a/b/f1.js] "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -98,16 +78,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); }; exports.__esModule = true; -__exportStar(require("../c/f3"), exports); +__exportStar(require("./f2"), exports); -//// [/a/b/f1.js] file written with same contents -//// [/a/c/f3.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 1; +Change:: Modify f2 to include f3 + +Input:: +//// [/a/b/f2.ts] +export * from "../c/f3" Output:: @@ -147,3 +126,28 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/f2.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("../c/f3"), exports); + + +//// [/a/b/f1.js] file written with same contents +//// [/a/c/f3.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/config-file-includes-the-file.js b/tests/baselines/reference/tscWatch/programUpdates/config-file-includes-the-file.js index c12d28459fa22..8bffb59231bb6 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/config-file-includes-the-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/config-file-includes-the-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/c/tsconfig.json +Input:: //// [/a/b/f1.ts] export let x = 5 @@ -24,26 +24,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/c/tsconfig.json] {"compilerOptions":{},"files":["f2.ts","f3.ts"]} -//// [/a/b/f1.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -exports.x = 5; - - -//// [/a/c/f2.js] -"use strict"; -exports.__esModule = true; - - -//// [/a/c/f3.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 1; - - +/a/lib/tsc.js -w -p /a/c/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -86,3 +68,23 @@ FsWatchesRecursive:: {"directoryName":"/a/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] +"use strict"; +exports.__esModule = true; +exports.x = void 0; +exports.x = 5; + + +//// [/a/c/f2.js] +"use strict"; +exports.__esModule = true; + + +//// [/a/c/f3.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/config-file-is-deleted.js b/tests/baselines/reference/tscWatch/programUpdates/config-file-is-deleted.js index 73d445952b7c5..3147228ef6c39 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/config-file-is-deleted.js +++ b/tests/baselines/reference/tscWatch/programUpdates/config-file-is-deleted.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] let x = 1; @@ -21,15 +21,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {} -//// [/a/b/f1.js] -var x = 1; - - -//// [/a/b/f2.js] -var y = 2; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -71,8 +64,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/f1.js] +var x = 1; + + +//// [/a/b/f2.js] +var y = 2; + + + Change:: Delete config file +Input:: //// [/a/b/tsconfig.json] deleted Output:: @@ -103,3 +106,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + diff --git a/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js index 3763be7ba6d47..2ea212b52861d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js @@ -1,4 +1,4 @@ -/compiler/tsc.js -w -p /src/tsconfig.json +Input:: //// [/compiler/lib.es5.d.ts] /// interface Boolean {} @@ -22,11 +22,8 @@ var x: Promise; //// [/src/tsconfig.json] {"compilerOptions":{"module":"commonjs","target":"es5","noImplicitAny":true,"sourceMap":false,"lib":["es5"]}} -//// [/src/app.js] -var x; - - +/compiler/tsc.js -w -p /src/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -70,12 +67,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/src/app.js] +var x; + + + Change:: Change the lib in config +Input:: //// [/src/tsconfig.json] {"compilerOptions":{"module":"commonjs","target":"es5","noImplicitAny":true,"sourceMap":false,"lib":["es5","es2015.promise"]}} -//// [/src/app.js] file written with same contents Output:: >> Screen clear @@ -117,3 +119,5 @@ FsWatchesRecursive:: {"directoryName":"/src/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/src/app.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/create-configured-project-without-file-list.js b/tests/baselines/reference/tscWatch/programUpdates/create-configured-project-without-file-list.js index bc2124b1e496d..4bb5744fad1bb 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/create-configured-project-without-file-list.js +++ b/tests/baselines/reference/tscWatch/programUpdates/create-configured-project-without-file-list.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/tsconfig.json] { @@ -30,15 +30,8 @@ let y = 1 //// [/a/b/e/f3.ts] let z = 1 -//// [/a/b/c/f1.js] -var x = 1; - - -//// [/a/b/d/f2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -79,3 +72,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/c/f1.js] +var x = 1; + + +//// [/a/b/d/f2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/create-watch-without-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/create-watch-without-config-file.js index 0fe8f7ca2c816..665e8faa7bed1 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/create-watch-without-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/create-watch-without-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/c/app.ts +Input:: //// [/a/b/c/app.ts] import {f} from "./module" @@ -21,14 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/c/app.js] -"use strict"; -exports.__esModule = true; -var module_1 = require("./module"); -console.log(module_1.f); - - +/a/lib/tsc.js -w /a/b/c/app.ts Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -77,3 +71,11 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/c/app.js] +"use strict"; +exports.__esModule = true; +var module_1 = require("./module"); +console.log(module_1.f); + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js index 0d56470f85eb6..1475c4730da93 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js +++ b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/f1.ts /a/c/f3.ts --noImplicitAny +Input:: //// [/a/b/f1.ts] export * from "./f2" @@ -21,46 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/c/f3.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 1; - - -//// [/a/b/f2.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("../c/f3"), exports); - - -//// [/a/b/f1.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./f2"), exports); - - +/a/lib/tsc.js -w /a/b/f1.ts /a/c/f3.ts --noImplicitAny Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -100,9 +62,49 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/c/f3.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 1; + + +//// [/a/b/f2.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("../c/f3"), exports); + + +//// [/a/b/f1.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("./f2"), exports); + + + Change:: Delete f2 -//// [/a/b/f1.js] file written with same contents +Input:: //// [/a/b/f2.ts] deleted Output:: @@ -145,3 +147,5 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js index 6973c5ff627cb..e2b1478004eff 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js +++ b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/f1.ts --noImplicitAny +Input:: //// [/a/b/f1.ts] export * from "./f2" @@ -21,46 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/c/f3.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 1; - - -//// [/a/b/f2.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("../c/f3"), exports); - - -//// [/a/b/f1.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./f2"), exports); - - +/a/lib/tsc.js -w /a/b/f1.ts --noImplicitAny Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -100,9 +62,49 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/c/f3.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 1; + + +//// [/a/b/f2.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("../c/f3"), exports); + + +//// [/a/b/f1.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("./f2"), exports); + + + Change:: Delete f2 -//// [/a/b/f1.js] file written with same contents +Input:: //// [/a/b/f2.ts] deleted Output:: @@ -142,3 +144,5 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/files-explicitly-excluded-in-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/files-explicitly-excluded-in-config-file.js index 820146d84146b..c593913bad2ab 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/files-explicitly-excluded-in-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/files-explicitly-excluded-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -27,15 +27,8 @@ let t = 1; "exclude": ["/a/c"] } -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -76,3 +69,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js b/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js index 2a5c379d7ead6..e4ee4063e16a4 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js +++ b/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -71,9 +64,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + + Change:: delete file2 -//// [/a/b/commonFile1.js] file written with same contents +Input:: //// [/a/b/commonFile2.ts] deleted Output:: @@ -112,10 +114,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] file written with same contents + Change:: recreate file2 -//// [/a/b/commonFile1.js] file written with same contents -//// [/a/b/commonFile2.js] file written with same contents +Input:: //// [/a/b/commonFile2.ts] let y = 1 @@ -160,3 +163,6 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] file written with same contents +//// [/a/b/commonFile2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/handles-the-missing-files---that-were-added-to-program-because-they-were-added-with-tripleSlashRefs.js b/tests/baselines/reference/tscWatch/programUpdates/handles-the-missing-files---that-were-added-to-program-because-they-were-added-with-tripleSlashRefs.js index a14b42fb5a897..f1351053e1555 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/handles-the-missing-files---that-were-added-to-program-because-they-were-added-with-tripleSlashRefs.js +++ b/tests/baselines/reference/tscWatch/programUpdates/handles-the-missing-files---that-were-added-to-program-because-they-were-added-with-tripleSlashRefs.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/commonFile1.ts +Input:: //// [/a/b/commonFile1.ts] /// let x = y @@ -16,12 +16,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/commonFile1.js] -/// -var x = y; - - +/a/lib/tsc.js -w /a/b/commonFile1.ts Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -67,16 +63,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +/// +var x = y; + + + Change:: create file2 -//// [/a/b/commonFile1.js] file written with same contents +Input:: //// [/a/b/commonFile2.ts] let y = 1 -//// [/a/b/commonFile2.js] -var y = 1; - - Output:: >> Screen clear @@ -112,3 +110,9 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] file written with same contents +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/if-config-file-doesnt-have-errors,-they-are-not-reported.js b/tests/baselines/reference/tscWatch/programUpdates/if-config-file-doesnt-have-errors,-they-are-not-reported.js index 41c2dc2f15990..60769793c9aa4 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/if-config-file-doesnt-have-errors,-they-are-not-reported.js +++ b/tests/baselines/reference/tscWatch/programUpdates/if-config-file-doesnt-have-errors,-they-are-not-reported.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 10 @@ -20,11 +20,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/app.js] -var x = 10; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -61,3 +58,8 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/app.js] +var x = 10; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-able-to-handle-@types-if-input-file-list-is-empty.js b/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-able-to-handle-@types-if-input-file-list-is-empty.js index dc4c73a43daef..19e51cd2be441 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-able-to-handle-@types-if-input-file-list-is-empty.js +++ b/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-able-to-handle-@types-if-input-file-list-is-empty.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/tsconfig.json +Input:: //// [/a/app.ts] let x = 1 @@ -25,6 +25,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } +/a/lib/tsc.js -w -p /a/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -57,3 +58,4 @@ FsWatchesRecursive:: {"directoryName":"/a/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-tolerated-without-crashing-the-server.js b/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-tolerated-without-crashing-the-server.js index d5aceb0fc031c..7c42ae36622a6 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-tolerated-without-crashing-the-server.js +++ b/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-tolerated-without-crashing-the-server.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/file1.ts] let t = 10; @@ -22,6 +22,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -57,3 +58,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b/something","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-configured-projects.js b/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-configured-projects.js index 0a26775551849..281cd8f1500d3 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-configured-projects.js +++ b/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-configured-projects.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile.ts] export function bar() { }; @@ -21,23 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile.js] -"use strict"; -exports.__esModule = true; -exports.bar = void 0; -function bar() { } -exports.bar = bar; -; - - -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; -var T = require("./moduleFile"); -T.bar(); - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -79,13 +64,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename moduleFile to moduleFile1 - -//// [/a/b/file1.js] file written with same contents -//// [/a/b/moduleFile1.ts] -export function bar() { }; - -//// [/a/b/moduleFile1.js] +//// [/a/b/moduleFile.js] "use strict"; exports.__esModule = true; exports.bar = void 0; @@ -94,6 +73,20 @@ exports.bar = bar; ; +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; +var T = require("./moduleFile"); +T.bar(); + + + +Change:: Rename moduleFile to moduleFile1 + +Input:: +//// [/a/b/moduleFile1.ts] +export function bar() { }; + //// [/a/b/moduleFile.ts] deleted //// [/a/b/moduleFile.js] deleted @@ -147,13 +140,8 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename moduleFile1 back to moduleFile - //// [/a/b/file1.js] file written with same contents -//// [/a/b/moduleFile.ts] -export function bar() { }; - -//// [/a/b/moduleFile.js] +//// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; exports.bar = void 0; @@ -162,6 +150,13 @@ exports.bar = bar; ; + +Change:: Rename moduleFile1 back to moduleFile + +Input:: +//// [/a/b/moduleFile.ts] +export function bar() { }; + //// [/a/b/moduleFile1.ts] deleted Output:: @@ -203,3 +198,14 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/file1.js] file written with same contents +//// [/a/b/moduleFile.js] +"use strict"; +exports.__esModule = true; +exports.bar = void 0; +function bar() { } +exports.bar = bar; +; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-inferred-projects.js b/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-inferred-projects.js index f5074478f1ed7..a7176047b19b3 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-inferred-projects.js +++ b/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-inferred-projects.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/file1.ts +Input:: //// [/a/b/moduleFile.ts] export function bar() { }; @@ -18,23 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile.js] -"use strict"; -exports.__esModule = true; -exports.bar = void 0; -function bar() { } -exports.bar = bar; -; - - -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; -var T = require("./moduleFile"); -T.bar(); - - +/a/lib/tsc.js -w /a/b/file1.ts Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -70,9 +55,26 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/moduleFile.js] +"use strict"; +exports.__esModule = true; +exports.bar = void 0; +function bar() { } +exports.bar = bar; +; + + +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; +var T = require("./moduleFile"); +T.bar(); + + + Change:: Rename moduleFile to moduleFile1 -//// [/a/b/file1.js] file written with same contents +Input:: //// [/a/b/moduleFile1.ts] export function bar() { }; @@ -117,21 +119,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1.js] file written with same contents + Change:: Rename moduleFile1 back to moduleFile -//// [/a/b/file1.js] file written with same contents +Input:: //// [/a/b/moduleFile.ts] export function bar() { }; -//// [/a/b/moduleFile.js] -"use strict"; -exports.__esModule = true; -exports.bar = void 0; -function bar() { } -exports.bar = bar; -; - - //// [/a/b/moduleFile1.ts] deleted Output:: @@ -167,3 +162,14 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/file1.js] file written with same contents +//// [/a/b/moduleFile.js] +"use strict"; +exports.__esModule = true; +exports.bar = void 0; +function bar() { } +exports.bar = bar; +; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-file-not-in-rootDir.js b/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-file-not-in-rootDir.js index 25944808c930b..9dae5b72d6415 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-file-not-in-rootDir.js +++ b/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-file-not-in-rootDir.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] import { x } from "../b"; @@ -21,19 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/lib/b.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -exports.x = 10; - - -//// [/user/username/projects/myproject/lib/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -81,14 +70,27 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/lib/b.js] +"use strict"; +exports.__esModule = true; +exports.x = void 0; +exports.x = 10; + + +//// [/user/username/projects/myproject/lib/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Make changes to file a +Input:: //// [/user/username/projects/myproject/a.ts] import { x } from "../b"; -//// [/user/username/projects/myproject/lib/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -134,3 +136,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-isolatedModules.js b/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-isolatedModules.js index e0ca8774e8a03..34abbb6c26af9 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-isolatedModules.js +++ b/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-isolatedModules.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] export const a: string = ""; @@ -22,21 +22,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -exports.a = void 0; -exports.a = ""; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -var a_1 = require("./a"); -var b = a_1.a; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -78,17 +65,26 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change shape of a - -//// [/user/username/projects/myproject/a.ts] -export const a: number = 1 - //// [/user/username/projects/myproject/a.js] "use strict"; exports.__esModule = true; exports.a = void 0; -exports.a = 1; +exports.a = ""; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +var a_1 = require("./a"); +var b = a_1.a; + + + +Change:: Change shape of a +Input:: +//// [/user/username/projects/myproject/a.ts] +export const a: number = 1 Output:: @@ -136,3 +132,11 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +exports.a = void 0; +exports.a = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-handle-non-existing-directories-in-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/should-handle-non-existing-directories-in-config-file.js index 1250de66a8d8f..6956eefabadbb 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-handle-non-existing-directories-in-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-handle-non-existing-directories-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/tsconfig.json +Input:: //// [/a/src/app.ts] let x = 1; @@ -18,11 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/src/app.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -61,3 +58,8 @@ FsWatchesRecursive:: {"directoryName":"/a/src","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/src/app.js] +var x = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-ignore-non-existing-files-specified-in-the-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/should-ignore-non-existing-files-specified-in-the-config-file.js index 221058a3b08db..0ea531d36e9ab 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-ignore-non-existing-files-specified-in-the-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-ignore-non-existing-files-specified-in-the-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/commonFile1.ts] let x = 1 @@ -27,11 +27,8 @@ interface Array { length: number; [n: number]: T; } ] } -//// [/a/b/commonFile1.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -69,3 +66,8 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js index 3ba97be0f14e7..f950d8d330a3d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -91,33 +91,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/file1.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); - - -//// [/user/username/projects/myproject/decls/file1.d.ts] -export declare const c = 30; - - -//// [/user/username/projects/myproject/src/file2.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - -//// [/user/username/projects/myproject/decls/src/file2.d.ts] -export declare const d = 30; - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -160,3 +135,30 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); + + +//// [/user/username/projects/myproject/decls/file1.d.ts] +export declare const c = 30; + + +//// [/user/username/projects/myproject/src/file2.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + +//// [/user/username/projects/myproject/decls/src/file2.d.ts] +export declare const d = 30; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js index 637cf598966a8..f42ca90642cae 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -91,33 +91,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/build/file1.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); - - -//// [/user/username/projects/myproject/decls/file1.d.ts] -export declare const c = 30; - - -//// [/user/username/projects/myproject/build/src/file2.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - -//// [/user/username/projects/myproject/decls/src/file2.d.ts] -export declare const d = 30; - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -160,3 +135,30 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/build/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); + + +//// [/user/username/projects/myproject/decls/file1.d.ts] +export declare const c = 30; + + +//// [/user/username/projects/myproject/build/src/file2.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + +//// [/user/username/projects/myproject/decls/src/file2.d.ts] +export declare const d = 30; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js index 0e126eb1e1b8a..27f7ee5540ce7 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -90,25 +90,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/build/file1.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); - - -//// [/user/username/projects/myproject/build/src/file2.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -151,3 +134,22 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/build/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); + + +//// [/user/username/projects/myproject/build/src/file2.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js index a0a613282c1cb..8ccdecf74f3cf 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -90,22 +90,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/build/outFile.js] -define("file1", ["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); -define("src/file2", ["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -145,3 +131,19 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/build/outFile.js] +define("file1", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); +define("src/file2", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js index 7eec5119a937c..6607ad9b4557e 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -90,25 +90,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/file1.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); - - -//// [/user/username/projects/myproject/src/file2.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -151,3 +134,22 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); + + +//// [/user/username/projects/myproject/src/file2.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-properly-handle-module-resolution-changes-in-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/should-properly-handle-module-resolution-changes-in-config-file.js index bcd52553d3a26..4b86525e95d89 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-properly-handle-module-resolution-changes-in-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-properly-handle-module-resolution-changes-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -29,12 +29,8 @@ export interface T {} "files": ["/a/b/file1.ts"] } -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -76,8 +72,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; + + + Change:: Change module resolution to classic +Input:: //// [/a/b/tsconfig.json] { "compilerOptions": { @@ -86,12 +89,6 @@ Change:: Change module resolution to classic "files": ["/a/b/file1.ts"] } -//// [/a/b/file1.js] file written with same contents -//// [/a/module1.js] -"use strict"; -exports.__esModule = true; - - Output:: >> Screen clear @@ -132,3 +129,10 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/file1.js] file written with same contents +//// [/a/module1.js] +"use strict"; +exports.__esModule = true; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-reflect-change-in-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/should-reflect-change-in-config-file.js index aad3af9641372..569755bec0ad2 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-reflect-change-in-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-reflect-change-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -24,15 +24,8 @@ let y = 1 "files": ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"] } -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -72,15 +65,24 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + + Change:: Change config +Input:: //// [/a/b/tsconfig.json] { "compilerOptions": {}, "files": ["/a/b/commonFile1.ts"] } -//// [/a/b/commonFile1.js] file written with same contents Output:: >> Screen clear @@ -115,3 +117,5 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-tolerate-config-file-errors-and-still-try-to-build-a-project.js b/tests/baselines/reference/tscWatch/programUpdates/should-tolerate-config-file-errors-and-still-try-to-build-a-project.js index 5daca3fac5e91..266ba8c22eeb9 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-tolerate-config-file-errors-and-still-try-to-build-a-project.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-tolerate-config-file-errors-and-still-try-to-build-a-project.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/commonFile1.ts] let x = 1 @@ -27,15 +27,8 @@ interface Array { length: number; [n: number]: T; } "someOtherProperty": {} } -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -82,3 +75,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/shouldnt-report-error-about-unused-function-incorrectly-when-file-changes-from-global-to-module.js b/tests/baselines/reference/tscWatch/programUpdates/shouldnt-report-error-about-unused-function-incorrectly-when-file-changes-from-global-to-module.js index 28658ce6bfb6d..376ccfa6b83c1 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/shouldnt-report-error-about-unused-function-incorrectly-when-file-changes-from-global-to-module.js +++ b/tests/baselines/reference/tscWatch/programUpdates/shouldnt-report-error-about-unused-function-incorrectly-when-file-changes-from-global-to-module.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/file.ts --noUnusedLocals +Input:: //// [/a/b/file.ts] function one() {} function two() { @@ -20,16 +20,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/file.js] -function one() { } -function two() { - return function three() { - one(); - }; -} - - +/a/lib/tsc.js -w /a/b/file.ts --noUnusedLocals Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -61,8 +53,19 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file.js] +function one() { } +function two() { + return function three() { + one(); + }; +} + + + Change:: Change file to module +Input:: //// [/a/b/file.ts] function one() {} export function two() { @@ -71,19 +74,6 @@ export function two() { } } -//// [/a/b/file.js] -"use strict"; -exports.__esModule = true; -exports.two = void 0; -function one() { } -function two() { - return function three() { - one(); - }; -} -exports.two = two; - - Output:: >> Screen clear @@ -114,3 +104,17 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/file.js] +"use strict"; +exports.__esModule = true; +exports.two = void 0; +function one() { } +function two() { + return function three() { + one(); + }; +} +exports.two = two; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/types-should-load-from-config-file-path-if-config-exists.js b/tests/baselines/reference/tscWatch/programUpdates/types-should-load-from-config-file-path-if-config-exists.js index f3f9980ec6ee6..4b8bd538da9b5 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/types-should-load-from-config-file-path-if-config-exists.js +++ b/tests/baselines/reference/tscWatch/programUpdates/types-should-load-from-config-file-path-if-config-exists.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 1 @@ -21,11 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/app.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -66,3 +63,8 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/app.js] +var x = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js index dcb283b1626cc..c9eae41a5e3a6 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -25,29 +25,8 @@ export class B {} //// [/tsconfig.json] {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error"}} -//// [/b.js] -export class B { -} - - -//// [/a.js] -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import './b'; -let A = class A { - constructor(p) { } -}; -A = __decorate([ - ((_) => { }) -], A); -export { A }; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -99,8 +78,32 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/b.js] +export class B { +} + + +//// [/a.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +import './b'; +let A = class A { + constructor(p) { } +}; +A = __decorate([ + ((_) => { }) +], A); +export { A }; + + + Change:: Enable experimentalDecorators +Input:: //// [/tsconfig.json] {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error","experimentalDecorators":true}} @@ -150,33 +153,13 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Enable emitDecoratorMetadata +Input:: //// [/tsconfig.json] {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error","experimentalDecorators":true,"emitDecoratorMetadata":true}} -//// [/b.js] file written with same contents -//// [/a.js] -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -import { B } from './b'; -let A = class A { - constructor(p) { } -}; -A = __decorate([ - ((_) => { }), - __metadata("design:paramtypes", [B]) -], A); -export { A }; - - Output:: >> Screen clear @@ -216,3 +199,26 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/b.js] file written with same contents +//// [/a.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { B } from './b'; +let A = class A { + constructor(p) { } +}; +A = __decorate([ + ((_) => { }), + __metadata("design:paramtypes", [B]) +], A); +export { A }; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-when-useDefineForClassFields-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-when-useDefineForClassFields-changes.js index 0e2e3b2a407c6..faaefae32a897 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-when-useDefineForClassFields-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-when-useDefineForClassFields-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a.ts] class C { get prop() { return 1; } } class D extends C { prop = 1; } @@ -19,19 +19,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a.js] -class C { - get prop() { return 1; } -} -class D extends C { - constructor() { - super(...arguments); - this.prop = 1; - } -} - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -73,11 +62,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Enable useDefineForClassFields - -//// [/tsconfig.json] -{"compilerOptions":{"target":"es6","useDefineForClassFields":true}} - //// [/a.js] class C { get prop() { return 1; } @@ -85,17 +69,19 @@ class C { class D extends C { constructor() { super(...arguments); - Object.defineProperty(this, "prop", { - enumerable: true, - configurable: true, - writable: true, - value: 1 - }); + this.prop = 1; } } +Change:: Enable useDefineForClassFields + +Input:: +//// [/tsconfig.json] +{"compilerOptions":{"target":"es6","useDefineForClassFields":true}} + + Output:: >> Screen clear [12:00:20 AM] File change detected. Starting incremental compilation... @@ -136,3 +122,21 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a.js] +class C { + get prop() { return 1; } +} +class D extends C { + constructor() { + super(...arguments); + Object.defineProperty(this, "prop", { + enumerable: true, + configurable: true, + writable: true, + value: 1 + }); + } +} + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js index 0a8654e0e8af0..2b98765e7340c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] export class C {} @@ -22,27 +22,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - } - return C; -}()); -exports.C = C; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.f = void 0; -function f(p) { return p; } -exports.f = f; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -84,13 +65,33 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + } + return C; +}()); +exports.C = C; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.f = void 0; +function f(p) { return p; } +exports.f = f; + + + Change:: Set to "remove" +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"importsNotUsedAsValues":"remove"}} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] file written with same contents Output:: >> Screen clear @@ -133,21 +134,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] file written with same contents + Change:: Set to "error" +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"importsNotUsedAsValues":"error"}} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.f = void 0; -require("./a"); -function f(p) { return p; } -exports.f = f; - - Output:: >> Screen clear @@ -196,13 +191,23 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.f = void 0; +require("./a"); +function f(p) { return p; } +exports.f = f; + + + Change:: Set to "preserve" +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"importsNotUsedAsValues":"preserve"}} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] file written with same contents Output:: >> Screen clear @@ -244,3 +249,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-correctly-when-declaration-emit-is-disabled-in-compiler-options.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-correctly-when-declaration-emit-is-disabled-in-compiler-options.js index d62fc0c146401..e2399e591432e 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-correctly-when-declaration-emit-is-disabled-in-compiler-options.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-correctly-when-declaration-emit-is-disabled-in-compiler-options.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] import test from './b'; test(4, 5); @@ -26,6 +26,7 @@ interface Array { length: number; [n: number]: T; } {"compilerOptions":{"module":"commonjs","noEmit":true,"strict":true}} +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -67,8 +68,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changed x type to string +Input:: //// [/user/username/projects/myproject/b.ts] function test(x: string, y: number) { return x + y / 5; @@ -122,8 +125,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changed x type to number +Input:: //// [/user/username/projects/myproject/b.ts] function test(x: number, y: number) { return x + y / 5; @@ -171,8 +176,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changed y type to string +Input:: //// [/user/username/projects/myproject/b.ts] function test(x: number, y: string) { return x + y / 5; @@ -232,8 +239,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changed y type to number +Input:: //// [/user/username/projects/myproject/b.ts] function test(x: number, y: number) { return x + y / 5; @@ -280,3 +289,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-default-options.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-default-options.js index 6a02e56478e85..674187b400ebb 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-default-options.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-default-options.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -24,12 +24,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -75,8 +71,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -84,7 +87,6 @@ var x: string; var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -119,8 +121,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -130,7 +135,6 @@ interface Document { var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -176,3 +180,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipDefaultLibCheck.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipDefaultLibCheck.js index 27a39ad5f9c85..e7e117d2bb7ca 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipDefaultLibCheck.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipDefaultLibCheck.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipDefaultLibCheck +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -24,12 +24,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipDefaultLibCheck Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -69,8 +65,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -78,7 +81,6 @@ var x: string; var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -112,8 +114,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -123,7 +128,6 @@ interface Document { var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -162,3 +166,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipLibCheck.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipLibCheck.js index 09ed3add077b9..a17bb0d71dd9c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipLibCheck.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipLibCheck.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipLibCheck +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -24,12 +24,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipLibCheck Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -69,8 +65,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -78,7 +81,6 @@ var x: string; var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -112,8 +114,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -123,7 +128,6 @@ interface Document { var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -162,3 +166,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-default-options.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-default-options.js index 9f620946381a7..9e7cabec7d4b2 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-default-options.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-default-options.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; @@ -21,11 +21,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -var y; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -71,17 +68,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var y; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] var x: string; var y: number; -//// [/user/username/projects/myproject/a.js] -var x; -var y; - - Output:: >> Screen clear @@ -116,18 +114,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var x; +var y; + + + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; } var y: number; -//// [/user/username/projects/myproject/a.js] -var y; - - Output:: >> Screen clear @@ -173,3 +174,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +var y; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipDefaultLibCheck.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipDefaultLibCheck.js index 82a34f7f07ed7..26197fbed5039 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipDefaultLibCheck.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipDefaultLibCheck.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipDefaultLibCheck +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; @@ -21,11 +21,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -var y; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipDefaultLibCheck Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -65,17 +62,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var y; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] var x: string; var y: number; -//// [/user/username/projects/myproject/a.js] -var x; -var y; - - Output:: >> Screen clear @@ -109,18 +107,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var x; +var y; + + + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; } var y: number; -//// [/user/username/projects/myproject/a.js] -var y; - - Output:: >> Screen clear @@ -159,3 +160,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +var y; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipLibCheck.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipLibCheck.js index d169086a9efe4..6fdf9db37840a 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipLibCheck.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipLibCheck.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipLibCheck +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; @@ -21,11 +21,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -var y; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipLibCheck Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -65,17 +62,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var y; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] var x: string; var y: number; -//// [/user/username/projects/myproject/a.js] -var x; -var y; - - Output:: >> Screen clear @@ -109,18 +107,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var x; +var y; + + + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; } var y: number; -//// [/user/username/projects/myproject/a.js] -var y; - - Output:: >> Screen clear @@ -159,3 +160,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +var y; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-ambient-modules-of-program-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-ambient-modules-of-program-changes.js index 1258794a1ff4e..8b67e172bac26 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-ambient-modules-of-program-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-ambient-modules-of-program-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] declare module 'a' { type foo = number; @@ -20,10 +20,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -61,17 +59,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] + + + Change:: Create b.ts with same content -//// [/user/username/projects/myproject/a.js] file written with same contents +Input:: //// [/user/username/projects/myproject/b.ts] declare module 'a' { type foo = number; } -//// [/user/username/projects/myproject/b.js] - - Output:: >> Screen clear @@ -136,9 +135,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] + + + Change:: Delete b.ts -//// [/user/username/projects/myproject/a.js] file written with same contents +Input:: //// [/user/username/projects/myproject/b.ts] deleted Output:: @@ -177,3 +181,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js index 39846bc903905..43b900800db31 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a.ts] export class C {} @@ -21,24 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - } - return C; -}()); -exports.C = C; - - -//// [/b.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -78,8 +62,27 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + } + return C; +}()); +exports.C = C; + + +//// [/b.js] +"use strict"; +exports.__esModule = true; + + + Change:: Enable forceConsistentCasingInFileNames +Input:: //// [/tsconfig.json] {"compilerOptions":{"forceConsistentCasingInFileNames":true}} @@ -125,3 +128,4 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-noErrorTruncation-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-noErrorTruncation-changes.js index 26e2b95740d30..4cd2f3fec0e4d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-noErrorTruncation-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-noErrorTruncation-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] declare var v: { reallyLongPropertyName1: string | number | boolean | object | symbol | bigint; @@ -27,11 +27,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -v === 'foo'; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -75,8 +72,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +v === 'foo'; + + + Change:: Enable noErrorTruncation +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"noErrorTruncation":true}} @@ -123,3 +126,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js index 56496aadaed0d..bf48d4bb0305f 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] declare function foo(): null | { hello: any }; foo().hello @@ -19,11 +19,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -foo().hello; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -61,8 +58,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +foo().hello; + + + Change:: Enable strict null checks +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"strictNullChecks":true}} @@ -110,8 +113,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Set always strict false +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"strict":true,"alwaysStrict":false}} @@ -159,8 +164,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Disable strict +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{}} @@ -201,3 +208,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-moduleResolution-when-resolveJsonModule-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-moduleResolution-when-resolveJsonModule-changes.js index d669ad19c971e..5fa7e3d226fea 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-moduleResolution-when-resolveJsonModule-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-moduleResolution-when-resolveJsonModule-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] import * as data from './data.json' @@ -21,12 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -74,12 +70,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Enable resolveJsonModule +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"moduleResolution":"node","resolveJsonModule":true}} -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -125,3 +127,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/watched-files-when-file-is-deleted-and-new-file-is-added-as-part-of-change.js b/tests/baselines/reference/tscWatch/programUpdates/watched-files-when-file-is-deleted-and-new-file-is-added-as-part-of-change.js index e51a3a1bfbc47..3e02860609b1c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/watched-files-when-file-is-deleted-and-new-file-is-added-as-part-of-change.js +++ b/tests/baselines/reference/tscWatch/programUpdates/watched-files-when-file-is-deleted-and-new-file-is-added-as-part-of-change.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /home/username/project/tsconfig.json +Input:: //// [/home/username/project/src/file1.ts] var a = 10; @@ -18,11 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/home/username/project/tsconfig.json] {} -//// [/home/username/project/src/file1.js] -var a = 10; - - +/a/lib/tsc.js -w -p /home/username/project/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -60,15 +57,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/home/username/project/src/file1.js] +var a = 10; + + + Change:: Rename file1 to file2 +Input:: //// [/home/username/project/src/file2.ts] var a = 10; -//// [/home/username/project/src/file2.js] -var a = 10; - - //// [/home/username/project/src/file1.ts] deleted Output:: @@ -107,3 +106,8 @@ FsWatchesRecursive:: {"directoryName":"/home/username/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/home/username/project/src/file2.js] +var a = 10; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/when-skipLibCheck-and-skipDefaultLibCheck-changes.js b/tests/baselines/reference/tscWatch/programUpdates/when-skipLibCheck-and-skipDefaultLibCheck-changes.js index ee1196dc4cb2a..4221bac04f8a6 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/when-skipLibCheck-and-skipDefaultLibCheck-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/when-skipLibCheck-and-skipDefaultLibCheck-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; @@ -28,10 +28,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -91,8 +89,13 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] + + + Change:: Changing config to {"compilerOptions":{"skipLibCheck":true}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"skipLibCheck":true}} @@ -143,8 +146,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{"skipDefaultLibCheck":true}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"skipDefaultLibCheck":true}} @@ -201,8 +206,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{}} @@ -264,8 +271,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{"skipDefaultLibCheck":true}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"skipDefaultLibCheck":true}} @@ -321,8 +330,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{"skipLibCheck":true}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"skipLibCheck":true}} @@ -373,8 +384,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{}} @@ -436,3 +449,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/works-correctly-when-config-file-is-changed-but-its-content-havent.js b/tests/baselines/reference/tscWatch/programUpdates/works-correctly-when-config-file-is-changed-but-its-content-havent.js index f1bd9f9249f00..80c355787ea67 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/works-correctly-when-config-file-is-changed-but-its-content-havent.js +++ b/tests/baselines/reference/tscWatch/programUpdates/works-correctly-when-config-file-is-changed-but-its-content-havent.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -20,19 +20,12 @@ let y = 1 //// [/a/b/tsconfig.json] { - "compilerOptions": {}, - "files": ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"] - } - -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - + "compilerOptions": {}, + "files": ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"] + } +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -72,8 +65,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + + Change:: Modify config without changing content +Input:: //// [/a/b/tsconfig.json] file changed its modified time Output:: @@ -111,3 +114,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-with-configFile.js b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-with-configFile.js index 4ce614c9b47ce..45aef15dcb94a 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-with-configFile.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-with-configFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,12 +21,8 @@ export const x = 10; //// [/user/username/projects/myproject/tsconfig.json] {} -//// [/user/username/projects/myproject/test.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:27 AM] Starting compilation in watch mode... @@ -70,8 +66,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/test.js] +"use strict"; +exports.__esModule = true; + + + Change:: npm install file and folder that start with '.' +Input:: //// [/user/username/projects/myproject/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts] {"something":10} @@ -99,3 +102,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js index 9cc74754ada77..feac89681480f 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /user/username/projects/myproject/test.ts +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,12 +21,8 @@ export const x = 10; //// [/user/username/projects/myproject/tsconfig.json] {} -//// [/user/username/projects/myproject/test.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w /user/username/projects/myproject/test.ts Output:: >> Screen clear [12:00:27 AM] Starting compilation in watch mode... @@ -64,8 +60,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/test.js] +"use strict"; +exports.__esModule = true; + + + Change:: npm install file and folder that start with '.' +Input:: //// [/user/username/projects/myproject/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts] {"something":10} @@ -87,3 +90,4 @@ FsWatchesRecursive:: {"directoryName":"/user","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/when-types-in-compiler-option-are-global-and-installed-at-later-point.js b/tests/baselines/reference/tscWatch/resolutionCache/when-types-in-compiler-option-are-global-and-installed-at-later-point.js index 5efdeb8a51f1c..cc54ce3b6d9fb 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/when-types-in-compiler-option-are-global-and-installed-at-later-point.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/when-types-in-compiler-option-are-global-and-installed-at-later-point.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/lib/app.ts] myapp.component("hello"); @@ -18,11 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/lib/app.js] -myapp.component("hello"); - - +/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -61,9 +58,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/lib/app.js] +myapp.component("hello"); + + + Change:: npm install ts-types -//// [/user/username/projects/myproject/lib/app.js] file written with same contents +Input:: //// [/user/username/projects/myproject/node_modules/@myapp/ts-types/package.json] {"version":"1.65.1","types":"types/somefile.define.d.ts"} @@ -115,8 +117,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/lib/app.js] file written with same contents + Change:: No change, just check program +Input:: Output:: @@ -139,3 +144,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/with-modules-linked-to-sibling-folder.js b/tests/baselines/reference/tscWatch/resolutionCache/with-modules-linked-to-sibling-folder.js index 09189652cdbbb..e48b55e02cd5a 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/with-modules-linked-to-sibling-folder.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/with-modules-linked-to-sibling-folder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -28,12 +28,8 @@ export * from './other'; //// [/user/username/projects/myproject/linked-package/dist/other.d.ts] export declare const Foo = "BAR"; -//// [/user/username/projects/myproject/main/index.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:39 AM] Starting compilation in watch mode... @@ -84,3 +80,9 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/main/index.js] +"use strict"; +exports.__esModule = true; + + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-included-file-with-ambient-module-changes.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-included-file-with-ambient-module-changes.js index e1ee3c43a7981..2014f8e515324 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-included-file-with-ambient-module-changes.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-included-file-with-ambient-module-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /a/b/foo.ts /a/b/bar.d.ts +Input:: //// [/a/b/foo.ts] import * as fs from "fs"; @@ -27,12 +27,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/foo.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w /a/b/foo.ts /a/b/bar.d.ts Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -78,8 +74,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/foo.js] +"use strict"; +exports.__esModule = true; + + + Change:: Add fs definition +Input:: //// [/a/b/bar.d.ts] declare module "url" { @@ -95,7 +98,6 @@ declare module "fs" { } -//// [/a/b/foo.js] file written with same contents Output:: >> Screen clear @@ -134,3 +136,5 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/foo.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-module-resolution-changes-to-ambient-module.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-module-resolution-changes-to-ambient-module.js index 63a69f1c92124..e374a0d0dc510 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-module-resolution-changes-to-ambient-module.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-module-resolution-changes-to-ambient-module.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/foo.ts +Input:: //// [/a/b/foo.ts] import * as fs from "fs"; @@ -15,12 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/foo.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w /a/b/foo.ts Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -62,9 +58,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/foo.js] +"use strict"; +exports.__esModule = true; + + + Change:: npm install node types -//// [/a/b/foo.js] file written with same contents +Input:: //// [/a/b/node_modules/@types/node/package.json] { @@ -116,3 +118,5 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/foo.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-renaming-node_modules-folder-that-already-contains-@types-folder.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-renaming-node_modules-folder-that-already-contains-@types-folder.js index 5292d5cbd3464..7d12e796d5a99 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-renaming-node_modules-folder-that-already-contains-@types-folder.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-renaming-node_modules-folder-that-already-contains-@types-folder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /user/username/projects/myproject/a.ts +Input:: //// [/user/username/projects/myproject/a.ts] import * as q from "qqq"; @@ -18,12 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/user/username/projects/myproject/node_modules2/@types/qqq/index.d.ts] export {} -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w /user/username/projects/myproject/a.ts Output:: >> Screen clear [12:00:27 AM] Starting compilation in watch mode... @@ -65,9 +61,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: npm install -//// [/user/username/projects/myproject/a.js] file written with same contents +Input:: //// [/user/username/projects/myproject/node_modules/@types/qqq/index.d.ts] export {} @@ -110,3 +112,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-reusing-program-with-files-from-external-library.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-reusing-program-with-files-from-external-library.js index 89679dca449b6..2ed6c5df30e9c 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-reusing-program-with-files-from-external-library.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-reusing-program-with-files-from-external-library.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/projects/myProject/src +Input:: //// [/a/b/projects/myProject/src/file1.ts] import module1 = require("module1"); module1("hello"); @@ -26,21 +26,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/projects/myProject/src/tsconfig.json] {"compilerOptions":{"allowJs":true,"rootDir":".","outDir":"../dist","moduleResolution":"node","maxNodeModuleJsDepth":1}} -//// [/a/b/projects/myProject/dist/file1.js] -"use strict"; -exports.__esModule = true; -var module1 = require("module1"); -module1("hello"); - - -//// [/a/b/projects/myProject/dist/file2.js] -"use strict"; -exports.__esModule = true; -var module11 = require("module1"); -module11("hello"); - - +/a/lib/tsc.js --w -p /a/b/projects/myProject/src Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -92,21 +79,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Add new line to file1 - -//// [/a/b/projects/myProject/src/file1.ts] -import module1 = require("module1"); -module1("hello"); -; - //// [/a/b/projects/myProject/dist/file1.js] "use strict"; exports.__esModule = true; var module1 = require("module1"); module1("hello"); -; +//// [/a/b/projects/myProject/dist/file2.js] +"use strict"; +exports.__esModule = true; +var module11 = require("module1"); +module11("hello"); + + + +Change:: Add new line to file1 + +Input:: +//// [/a/b/projects/myProject/src/file1.ts] +import module1 = require("module1"); +module1("hello"); +; + Output:: >> Screen clear @@ -155,3 +150,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b/projects/myproject/src","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/projects/myProject/dist/file1.js] +"use strict"; +exports.__esModule = true; +var module1 = require("module1"); +module1("hello"); +; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js index a06ca8733cea7..d82be755b8ec9 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/username/project/tsconfig.json +Input:: //// [/a/username/project/src/file1.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/username/project/src/file1.js] - - +/a/lib/tsc.js --w -p /a/username/project/tsconfig.json Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -55,12 +53,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename file1 to file2 +//// [/a/username/project/src/file1.js] -//// [/a/username/project/src/file2.ts] -//// [/a/username/project/src/file2.js] +Change:: Rename file1 to file2 + +Input:: +//// [/a/username/project/src/file2.ts] //// [/a/username/project/src/file1.ts] deleted @@ -96,3 +96,7 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/username/project/src/file2.js] + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js index 2a79ce7e351e0..8d0b6caa2c622 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/username/project/tsconfig.json +Input:: //// [/a/username/project/src/file1.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/username/project/src/file1.js] - - +/a/lib/tsc.js --w -p /a/username/project/tsconfig.json Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -61,12 +59,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename file1 to file2 +//// [/a/username/project/src/file1.js] -//// [/a/username/project/src/file2.ts] -//// [/a/username/project/src/file2.js] +Change:: Rename file1 to file2 + +Input:: +//// [/a/username/project/src/file2.ts] //// [/a/username/project/src/file1.ts] deleted @@ -108,3 +108,7 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/username/project/src/file2.js] + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js index 6fa14c6d54db3..a3384144c857d 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/username/project/tsconfig.json +Input:: //// [/a/username/project/src/file1.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/username/project/src/file1.js] - - +/a/lib/tsc.js --w -p /a/username/project/tsconfig.json Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -61,12 +59,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename file1 to file2 +//// [/a/username/project/src/file1.js] -//// [/a/username/project/src/file2.ts] -//// [/a/username/project/src/file2.js] +Change:: Rename file1 to file2 + +Input:: +//// [/a/username/project/src/file2.ts] //// [/a/username/project/src/file1.ts] deleted @@ -108,3 +108,7 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/username/project/src/file2.js] + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js index 7c71ca719af84..70099b8e28b28 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -28,12 +28,8 @@ export {} //// [/home/user/projects/myproject/node_modules/b] symlink(/home/user/projects/myproject/node_modules/realb) //// [/home/user/projects/myproject/node_modules/reala/node_modules/b] symlink(/home/user/projects/myproject/node_modules/b) //// [/home/user/projects/myproject/node_modules/realb/node_modules/a] symlink(/home/user/projects/myproject/node_modules/a) -//// [/home/user/projects/myproject/src/file.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w Output:: [12:00:45 AM] Starting compilation in watch mode... @@ -145,3 +141,9 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/home/user/projects/myproject/src/file.js] +"use strict"; +exports.__esModule = true; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js index a69d068cc9db5..2a49142932e80 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,12 +21,8 @@ export const x = 10; //// [/user/username/projects/myproject/tsconfig.json] {} -//// [/user/username/projects/myproject/src/file1.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -74,8 +70,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/src/file1.js] +"use strict"; +exports.__esModule = true; + + + Change:: Pending updates because of file1.js creation +Input:: Output:: >> Screen clear @@ -121,9 +124,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Remove directory node_modules -//// [/user/username/projects/myproject/src/file1.js] file written with same contents +Input:: //// [/user/username/projects/myproject/node_modules/file2/index.d.ts] deleted Output:: @@ -172,8 +176,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/src/file1.js] file written with same contents + Change:: Pending directory watchers and program update +Input:: Output:: >> Screen clear @@ -220,8 +227,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Start npm install +Input:: Output:: @@ -247,8 +256,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: npm install folder creation of file2 +Input:: Output:: @@ -274,8 +285,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: npm install index file in file2 +Input:: //// [/user/username/projects/myproject/node_modules/file2/index.d.ts] export const x = 10; @@ -304,8 +317,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Updates the program +Input:: Output:: @@ -333,9 +348,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Pending updates -//// [/user/username/projects/myproject/src/file1.js] file written with same contents +Input:: Output:: >> Screen clear @@ -382,3 +398,5 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/src/file1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js index a5a414e5bc047..ecc281833ef12 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /a/username/project/typescript.ts +Input:: //// [/a/username/project/typescript.ts] var z = 10; @@ -15,11 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/username/project/typescript.js] -var z = 10; - - +/a/lib/tsc.js --w /a/username/project/typescript.ts Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -47,8 +44,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/username/project/typescript.js] +var z = 10; + + + Change:: Time spent to Transition libFile and file1 to low priority queue +Input:: Output:: @@ -60,8 +63,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Make change to file +Input:: //// [/a/username/project/typescript.ts] var zz30 = 100; @@ -76,12 +81,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Callbacks: medium priority + high priority queue and scheduled program update - -//// [/a/username/project/typescript.js] -var zz30 = 100; +Change:: Callbacks: medium priority + high priority queue and scheduled program update +Input:: Output:: >> Screen clear @@ -110,8 +113,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/username/project/typescript.js] +var zz30 = 100; + + + Change:: Polling queues polled and everything is in the high polling queue +Input:: Output:: @@ -122,3 +131,4 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js index af9d83b410c1e..0fae6f910f811 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {"watchOptions":{"fallbackPolling":"PriorityInterval"}} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -70,3 +63,12 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js index c602b4405029f..c7f1f7684a7d7 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {"watchOptions":{"watchDirectory":"UseFsEvents"}} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -70,3 +63,12 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-as-watch-options-to-extend.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-as-watch-options-to-extend.js index 6da07d029e0e3..5642ce423754a 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-as-watch-options-to-extend.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-as-watch-options-to-extend.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json --watchFile UseFsEvents +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json --watchFile UseFsEvents Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -70,3 +63,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-option.js index 1a34046c57268..04fc286ceec81 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-option.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {"watchOptions":{"watchFile":"UseFsEvents"}} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -70,3 +63,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + From 9fbcb99a3335ae9514f97a4a6e882147f5c9f944 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 2 Jun 2020 12:38:40 -0700 Subject: [PATCH 39/48] Emit build info even on noEmitOnError or tsc --build (#38853) * Emit buildinfo when there are errors with noEmitOnError? TODO: --build mode * Always emit tsbuild info even if there are non syntax errors in tsc --build mode * Sort affectedFilesPendingEmit for consistent build info text --- src/compiler/builder.ts | 43 +++- src/compiler/builderPublic.ts | 2 + src/compiler/program.ts | 27 +- src/compiler/tsbuildPublic.ts | 140 ++++++----- src/compiler/watch.ts | 1 + src/testRunner/unittests/tsbuild/helpers.ts | 47 +++- .../inferredTypeFromTransitiveModule.ts | 15 +- ...s-not-in-rootDir-at-the-import-location.js | 108 ++++++++ ...hange-in-signature-with-isolatedModules.js | 225 +++++++++++++++++ .../semantic-errors-with-incremental.js | 80 +++++- .../initial-build/include-only.js | 56 +++++ ...ojects-if-upstream-projects-have-errors.js | 80 ++++++ ...de-resolution-with-external-module-name.js | 49 ++++ .../demo/updates-with-bad-reference.js | 236 ++++++++++++++++- ...mit-any-files-on-error-with-incremental.js | 96 +++++-- .../when-preserveWatchOutput-is-not-used.js | 136 +++++++++- ...veWatchOutput-is-passed-on-command-line.js | 138 +++++++++- .../with-noEmitOnError-semantic-errors.js | 81 +++++- .../with-noEmitOnError-syntax-errors.js | 69 ++++- .../with-noEmitOnError-with-incremental.js | 206 ++++++++++++--- .../with-noEmitOnError-with-incremental.js | 238 ++++++++++++++---- .../with-noEmitOnError-with-incremental.js | 204 ++++++++++++--- .../with-noEmitOnError-with-incremental.js | 236 +++++++++++++---- .../with-noEmitOnError-with-incremental.js | 206 ++++++++++++--- .../with-noEmitOnError-with-incremental.js | 238 ++++++++++++++---- 25 files changed, 2548 insertions(+), 409 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 3eb2115daaf7b..5f3bc171bb525 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -148,7 +148,7 @@ namespace ts { /** * true if build info is emitted */ - emittedBuildInfo?: boolean; + buildInfoEmitPending: boolean; /** * Already seen emitted files */ @@ -250,14 +250,14 @@ namespace ts { BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, /*firstSourceFile*/ undefined) .forEach(file => state.changedFilesSet.set(file.resolvedPath, true)); } - else if (oldCompilerOptions && compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { + else if (oldCompilerOptions && !outFile(compilerOptions) && compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { // Add all files to affectedFilesPendingEmit since emit changed newProgram.getSourceFiles().forEach(f => addToAffectedFilesPendingEmit(state, f.resolvedPath, BuilderFileEmit.Full)); Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); state.seenAffectedFiles = state.seenAffectedFiles || createMap(); } - state.emittedBuildInfo = !state.changedFilesSet.size && !state.affectedFilesPendingEmit; + state.buildInfoEmitPending = !!state.changedFilesSet.size; return state; } @@ -611,7 +611,7 @@ namespace ts { isBuildInfoEmit?: boolean ) { if (isBuildInfoEmit) { - state.emittedBuildInfo = true; + state.buildInfoEmitPending = false; } else if (affected === state.program) { state.changedFilesSet.clear(); @@ -624,6 +624,7 @@ namespace ts { } if (isPendingEmit) { state.affectedFilesPendingEmitIndex!++; + state.buildInfoEmitPending = true; } else { state.affectedFilesIndex!++; @@ -688,12 +689,14 @@ namespace ts { } export type ProgramBuildInfoDiagnostic = string | [string, readonly ReusableDiagnostic[]]; + export type ProgramBuilderInfoFilePendingEmit = [string, BuilderFileEmit]; export interface ProgramBuildInfo { fileInfos: MapLike; options: CompilerOptions; referencedMap?: MapLike; exportedModulesMap?: MapLike; semanticDiagnosticsPerFile?: ProgramBuildInfoDiagnostic[]; + affectedFilesPendingEmit?: ProgramBuilderInfoFilePendingEmit[]; } /** @@ -751,6 +754,17 @@ namespace ts { result.semanticDiagnosticsPerFile = semanticDiagnosticsPerFile; } + if (state.affectedFilesPendingEmit) { + const affectedFilesPendingEmit: ProgramBuilderInfoFilePendingEmit[] = []; + const seenFiles = createMap(); + for (const path of state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(compareStringsCaseSensitive)) { + if (addToSeen(seenFiles, path)) { + affectedFilesPendingEmit.push([relativeToBuildInfo(path), state.affectedFilesPendingEmitKind!.get(path)!]); + } + } + result.affectedFilesPendingEmit = affectedFilesPendingEmit; + } + return result; function relativeToBuildInfoEnsuringAbsolutePath(path: string) { @@ -916,6 +930,7 @@ namespace ts { else if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { (builderProgram as EmitAndSemanticDiagnosticsBuilderProgram).getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; (builderProgram as EmitAndSemanticDiagnosticsBuilderProgram).emitNextAffectedFile = emitNextAffectedFile; + builderProgram.emitBuildInfo = emitBuildInfo; } else { notImplemented(); @@ -923,6 +938,15 @@ namespace ts { return builderProgram; + function emitBuildInfo(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken): EmitResult { + if (state.buildInfoEmitPending) { + const result = Debug.checkDefined(state.program).emitBuildInfo(writeFile || maybeBind(host, host.writeFile), cancellationToken); + state.buildInfoEmitPending = false; + return result; + } + return emitSkippedWithNoDiagnostics; + } + /** * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host @@ -936,7 +960,7 @@ namespace ts { if (!outFile(state.compilerOptions)) { const pendingAffectedFile = getNextAffectedFilePendingEmit(state); if (!pendingAffectedFile) { - if (state.emittedBuildInfo) { + if (!state.buildInfoEmitPending) { return undefined; } @@ -993,7 +1017,7 @@ namespace ts { function emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult { if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); - const result = handleNoEmitOptions(builderProgram, targetSourceFile, cancellationToken); + const result = handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); if (result) return result; if (!targetSourceFile) { // Emit and report any errors we ran into. @@ -1142,7 +1166,10 @@ namespace ts { referencedMap: getMapOfReferencedSet(program.referencedMap, toPath), exportedModulesMap: getMapOfReferencedSet(program.exportedModulesMap, toPath), semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && arrayToMap(program.semanticDiagnosticsPerFile, value => toPath(isString(value) ? value : value[0]), value => isString(value) ? emptyArray : value[1]), - hasReusableDiagnostic: true + hasReusableDiagnostic: true, + affectedFilesPendingEmit: map(program.affectedFilesPendingEmit, value => toPath(value[0])), + affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && arrayToMap(program.affectedFilesPendingEmit, value => toPath(value[0]), value => value[1]), + affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0, }; return { getState: () => state, @@ -1165,6 +1192,7 @@ namespace ts { getCurrentDirectory: notImplemented, emitNextAffectedFile: notImplemented, getSemanticDiagnosticsOfNextAffectedFile: notImplemented, + emitBuildInfo: notImplemented, close: noop, }; @@ -1195,6 +1223,7 @@ namespace ts { getDeclarationDiagnostics: (sourceFile, cancellationToken) => getProgram().getDeclarationDiagnostics(sourceFile, cancellationToken), getSemanticDiagnostics: (sourceFile, cancellationToken) => getProgram().getSemanticDiagnostics(sourceFile, cancellationToken), emit: (sourceFile, writeFile, cancellationToken, emitOnlyDts, customTransformers) => getProgram().emit(sourceFile, writeFile, cancellationToken, emitOnlyDts, customTransformers), + emitBuildInfo: (writeFile, cancellationToken) => getProgram().emitBuildInfo(writeFile, cancellationToken), getAllDependencies: notImplemented, getCurrentDirectory: () => getProgram().getCurrentDirectory(), close: noop, diff --git a/src/compiler/builderPublic.ts b/src/compiler/builderPublic.ts index bff123b915cb5..e7b7aff636366 100644 --- a/src/compiler/builderPublic.ts +++ b/src/compiler/builderPublic.ts @@ -99,6 +99,8 @@ namespace ts { * in that order would be used to write the files */ emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; + /*@internal*/ + emitBuildInfo(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken): EmitResult; /** * Get the current directory of the program */ diff --git a/src/compiler/program.ts b/src/compiler/program.ts index c9a3f88476fc6..18f730cafea1d 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1585,7 +1585,7 @@ namespace ts { function emitWorker(program: Program, sourceFile: SourceFile | undefined, writeFileCallback: WriteFileCallback | undefined, cancellationToken: CancellationToken | undefined, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers, forceDtsEmit?: boolean): EmitResult { if (!forceDtsEmit) { - const result = handleNoEmitOptions(program, sourceFile, cancellationToken); + const result = handleNoEmitOptions(program, sourceFile, writeFileCallback, cancellationToken); if (result) return result; } @@ -3638,11 +3638,17 @@ namespace ts { } /*@internal*/ - export function handleNoEmitOptions(program: ProgramToEmitFilesAndReportErrors, sourceFile: SourceFile | undefined, cancellationToken: CancellationToken | undefined): EmitResult | undefined { + export const emitSkippedWithNoDiagnostics: EmitResult = { diagnostics: emptyArray, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; + + /*@internal*/ + export function handleNoEmitOptions( + program: ProgramToEmitFilesAndReportErrors, + sourceFile: SourceFile | undefined, + writeFile: WriteFileCallback | undefined, + cancellationToken: CancellationToken | undefined + ): EmitResult | undefined { const options = program.getCompilerOptions(); - if (options.noEmit) { - return { diagnostics: emptyArray, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; - } + if (options.noEmit) return emitSkippedWithNoDiagnostics; // If the noEmitOnError flag is set, then check if we have any errors so far. If so, // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we @@ -3659,9 +3665,14 @@ namespace ts { diagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); } - return diagnostics.length > 0 ? - { diagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true } : - undefined; + if (!diagnostics.length) return undefined; + let emittedFiles: string[] | undefined; + if (!sourceFile && !outFile(options)) { + const emitResult = program.emitBuildInfo(writeFile, cancellationToken); + if (emitResult.diagnostics) diagnostics = [...diagnostics, ...emitResult.diagnostics]; + emittedFiles = emitResult.emittedFiles; + } + return { diagnostics, sourceMaps: undefined, emittedFiles, emitSkipped: true }; } /*@internal*/ diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index a55712c44944b..2ec93db074294 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -699,6 +699,18 @@ namespace ts { }; } + enum BuildStep { + CreateProgram, + SyntaxDiagnostics, + SemanticDiagnostics, + Emit, + EmitBundle, + EmitBuildInfo, + BuildInvalidatedProjectOfBundle, + QueueReferencingProjects, + Done + } + function createBuildOrUpdateInvalidedProject( kind: InvalidatedProjectKind.Build | InvalidatedProjectKind.UpdateBundle, state: SolutionBuilderState, @@ -708,18 +720,7 @@ namespace ts { config: ParsedCommandLine, buildOrder: readonly ResolvedConfigFileName[], ): BuildInvalidedProject | UpdateBundleProject { - enum Step { - CreateProgram, - SyntaxDiagnostics, - SemanticDiagnostics, - Emit, - EmitBundle, - BuildInvalidatedProjectOfBundle, - QueueReferencingProjects, - Done - } - - let step = kind === InvalidatedProjectKind.Build ? Step.CreateProgram : Step.EmitBundle; + let step = kind === InvalidatedProjectKind.Build ? BuildStep.CreateProgram : BuildStep.EmitBundle; let program: T | undefined; let buildResult: BuildResultFlags | undefined; let invalidatedProjectOfBundle: BuildInvalidedProject | undefined; @@ -781,8 +782,11 @@ namespace ts { program => program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) ); } - executeSteps(Step.SemanticDiagnostics, cancellationToken); - if (step !== Step.Emit) return undefined; + executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); + if (step === BuildStep.EmitBuildInfo) { + return emitBuildInfo(writeFile, cancellationToken); + } + if (step !== BuildStep.Emit) return undefined; return emit(writeFile, cancellationToken, customTransformers); }, done @@ -795,19 +799,19 @@ namespace ts { getCompilerOptions: () => config.options, getCurrentDirectory: () => state.currentDirectory, emit: (writeFile: WriteFileCallback | undefined, customTransformers: CustomTransformers | undefined) => { - if (step !== Step.EmitBundle) return invalidatedProjectOfBundle; + if (step !== BuildStep.EmitBundle) return invalidatedProjectOfBundle; return emitBundle(writeFile, customTransformers); }, done, }; function done(cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers) { - executeSteps(Step.Done, cancellationToken, writeFile, customTransformers); + executeSteps(BuildStep.Done, cancellationToken, writeFile, customTransformers); return doneInvalidatedProject(state, projectPath); } function withProgramOrUndefined(action: (program: T) => U | undefined): U | undefined { - executeSteps(Step.CreateProgram); + executeSteps(BuildStep.CreateProgram); return program && action(program); } @@ -821,7 +825,7 @@ namespace ts { if (state.options.dry) { reportStatus(state, Diagnostics.A_non_dry_build_would_build_project_0, project); buildResult = BuildResultFlags.Success; - step = Step.QueueReferencingProjects; + step = BuildStep.QueueReferencingProjects; return; } @@ -831,7 +835,7 @@ namespace ts { reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config)); // Nothing to build - must be a solution file, basically buildResult = BuildResultFlags.None; - step = Step.QueueReferencingProjects; + step = BuildStep.QueueReferencingProjects; return; } @@ -854,7 +858,7 @@ namespace ts { function handleDiagnostics(diagnostics: readonly Diagnostic[], errorFlags: BuildResultFlags, errorType: string) { if (diagnostics.length) { - buildResult = buildErrors( + ({ buildResult, step } = buildErrors( state, projectPath, program, @@ -862,8 +866,7 @@ namespace ts { diagnostics, errorFlags, errorType - ); - step = Step.QueueReferencingProjects; + )); } else { step++; @@ -894,7 +897,7 @@ namespace ts { function emit(writeFileCallback?: WriteFileCallback, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitResult { Debug.assertIsDefined(program); - Debug.assert(step === Step.Emit); + Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly program.backupState(); let declDiagnostics: Diagnostic[] | undefined; @@ -913,7 +916,7 @@ namespace ts { // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); - buildResult = buildErrors( + ({ buildResult, step } = buildErrors( state, projectPath, program, @@ -921,8 +924,7 @@ namespace ts { declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file" - ); - step = Step.QueueReferencingProjects; + )); return { emitSkipped: true, diagnostics: emitResult.diagnostics @@ -967,6 +969,24 @@ namespace ts { return emitResult; } + function emitBuildInfo(writeFileCallback?: WriteFileCallback, cancellationToken?: CancellationToken): EmitResult { + Debug.assertIsDefined(program); + Debug.assert(step === BuildStep.EmitBuildInfo); + const emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken); + if (emitResult.diagnostics.length) { + reportErrors(state, emitResult.diagnostics); + state.diagnostics.set(projectPath, [...state.diagnostics.get(projectPath)!, ...emitResult.diagnostics]); + buildResult = BuildResultFlags.EmitErrors & buildResult!; + } + + if (emitResult.emittedFiles && state.writeFileName) { + emitResult.emittedFiles.forEach(name => listEmittedFile(state, config, name)); + } + afterProgramDone(state, projectPath, program, config); + step = BuildStep.QueueReferencingProjects; + return emitResult; + } + function finishEmit( emitterDiagnostics: DiagnosticCollection, emittedOutputs: FileMap, @@ -977,7 +997,7 @@ namespace ts { ) { const emitDiagnostics = emitterDiagnostics.getDiagnostics(); if (emitDiagnostics.length) { - buildResult = buildErrors( + ({ buildResult, step } = buildErrors( state, projectPath, program, @@ -985,14 +1005,12 @@ namespace ts { emitDiagnostics, BuildResultFlags.EmitErrors, "Emit" - ); - step = Step.QueueReferencingProjects; + )); return emitDiagnostics; } if (state.writeFileName) { emittedOutputs.forEach(name => listEmittedFile(state, config, name)); - if (program) listFiles(program, state.writeFileName); } // Update time stamps for rest of the outputs @@ -1006,8 +1024,7 @@ namespace ts { oldestOutputFileName }); afterProgramDone(state, projectPath, program, config); - state.projectCompilerOptions = state.baseCompilerOptions; - step = Step.QueueReferencingProjects; + step = BuildStep.QueueReferencingProjects; buildResult = resultFlags; return emitDiagnostics; } @@ -1017,7 +1034,7 @@ namespace ts { if (state.options.dry) { reportStatus(state, Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); buildResult = BuildResultFlags.Success; - step = Step.QueueReferencingProjects; + step = BuildStep.QueueReferencingProjects; return undefined; } @@ -1038,7 +1055,7 @@ namespace ts { if (isString(outputFiles)) { reportStatus(state, Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); - step = Step.BuildInvalidatedProjectOfBundle; + step = BuildStep.BuildInvalidatedProjectOfBundle; return invalidatedProjectOfBundle = createBuildOrUpdateInvalidedProject( InvalidatedProjectKind.Build, state, @@ -1070,44 +1087,48 @@ namespace ts { return { emitSkipped: false, diagnostics: emitDiagnostics }; } - function executeSteps(till: Step, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers) { - while (step <= till && step < Step.Done) { + function executeSteps(till: BuildStep, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers) { + while (step <= till && step < BuildStep.Done) { const currentStep = step; switch (step) { - case Step.CreateProgram: + case BuildStep.CreateProgram: createProgram(); break; - case Step.SyntaxDiagnostics: + case BuildStep.SyntaxDiagnostics: getSyntaxDiagnostics(cancellationToken); break; - case Step.SemanticDiagnostics: + case BuildStep.SemanticDiagnostics: getSemanticDiagnostics(cancellationToken); break; - case Step.Emit: + case BuildStep.Emit: emit(writeFile, cancellationToken, customTransformers); break; - case Step.EmitBundle: + case BuildStep.EmitBuildInfo: + emitBuildInfo(writeFile, cancellationToken); + break; + + case BuildStep.EmitBundle: emitBundle(writeFile, customTransformers); break; - case Step.BuildInvalidatedProjectOfBundle: + case BuildStep.BuildInvalidatedProjectOfBundle: Debug.checkDefined(invalidatedProjectOfBundle).done(cancellationToken); - step = Step.Done; + step = BuildStep.Done; break; - case Step.QueueReferencingProjects: + case BuildStep.QueueReferencingProjects: queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, Debug.checkDefined(buildResult)); step++; break; // Should never be done - case Step.Done: + case BuildStep.Done: default: - assertType(step); + assertType(step); } Debug.assert(step > currentStep); @@ -1247,23 +1268,25 @@ namespace ts { } function afterProgramDone( - { host, watch, builderPrograms }: SolutionBuilderState, + state: SolutionBuilderState, proj: ResolvedConfigFilePath, program: T | undefined, config: ParsedCommandLine ) { if (program) { - if (host.afterProgramEmitAndDiagnostics) { - host.afterProgramEmitAndDiagnostics(program); + if (program && state.writeFileName) listFiles(program, state.writeFileName); + if (state.host.afterProgramEmitAndDiagnostics) { + state.host.afterProgramEmitAndDiagnostics(program); } - if (watch) { + if (state.watch) { program.releaseProgram(); - builderPrograms.set(proj, program); + state.builderPrograms.set(proj, program); } } - else if (host.afterEmitBundle) { - host.afterEmitBundle(config); + else if (state.host.afterEmitBundle) { + state.host.afterEmitBundle(config); } + state.projectCompilerOptions = state.baseCompilerOptions; } function buildErrors( @@ -1272,16 +1295,17 @@ namespace ts { program: T | undefined, config: ParsedCommandLine, diagnostics: readonly Diagnostic[], - errorFlags: BuildResultFlags, - errorType: string + buildResult: BuildResultFlags, + errorType: string, ) { + const canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !outFile(program.getCompilerOptions()); + reportAndStoreErrors(state, resolvedPath, diagnostics); // List files if any other build error using program (emit errors already report files) - if (program && state.writeFileName) listFiles(program, state.writeFileName); state.projectStatus.set(resolvedPath, { type: UpToDateStatusType.Unbuildable, reason: `${errorType} errors` }); + if (canEmitBuildInfo) return { buildResult, step: BuildStep.EmitBuildInfo }; afterProgramDone(state, resolvedPath, program, config); - state.projectCompilerOptions = state.baseCompilerOptions; - return errorFlags; + return { buildResult, step: BuildStep.QueueReferencingProjects }; } function updateModuleResolutionCache( diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index c9e428468e579..59b8e572e2cd4 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -127,6 +127,7 @@ namespace ts { getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[]; getConfigFileParsingDiagnostics(): readonly Diagnostic[]; emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; + emitBuildInfo(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken): EmitResult; } export function listFiles(program: ProgramToEmitFilesAndReportErrors, writeFileName: (s: string) => void) { diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index f6b1572ed8bd8..9f9143f6a3985 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -270,8 +270,8 @@ interface Symbol { baseFs: vfs.FileSystem; newSys: TscCompileSystem; } - function verifyIncrementalCorrectness(input: () => VerifyIncrementalCorrectness) { - it(`Verify emit output file text is same when built clean`, () => { + function verifyIncrementalCorrectness(input: () => VerifyIncrementalCorrectness, index: number) { + it(`Verify emit output file text is same when built clean for incremental scenario at:: ${index}`, () => { const { scenario, subScenario, commandLineArgs, modifyFs, incrementalModifyFs, @@ -291,11 +291,42 @@ interface Symbol { for (const outputFile of arrayFrom(sys.writtenFiles.keys())) { const expectedText = sys.readFile(outputFile); const actualText = newSys.readFile(outputFile); - assert.equal(actualText, expectedText, `File: ${outputFile}`); + if (!isBuildInfoFile(outputFile)) { + assert.equal(actualText, expectedText, `File: ${outputFile}`); + } + else if (actualText !== expectedText) { + // Verify build info without affectedFilesPendingEmit + const { text: actualBuildInfoText, affectedFilesPendingEmit: actualAffectedFilesPendingEmit } = getBuildInfoWithoutAffectedFilesPendingEmit(actualText); + const { text: expectedBuildInfoText, affectedFilesPendingEmit: expectedAffectedFilesPendingEmit } = getBuildInfoWithoutAffectedFilesPendingEmit(expectedText); + assert.equal(actualBuildInfoText, expectedBuildInfoText, `TsBuild info text without affectedFilesPendingEmit: ${outputFile}::\nIncremental buildInfoText:: ${actualText}\nClean buildInfoText:: ${expectedText}`); + // Verify that incrementally pending affected file emit are in clean build since clean build can contain more files compared to incremental depending of noEmitOnError option + if (actualAffectedFilesPendingEmit) { + assert.isDefined(expectedAffectedFilesPendingEmit, `Incremental build contains affectedFilesPendingEmit, clean build should also have it: ${outputFile}::\nIncremental buildInfoText:: ${actualText}\nClean buildInfoText:: ${expectedText}`); + let expectedIndex = 0; + actualAffectedFilesPendingEmit.forEach(([actualFile]) => { + expectedIndex = findIndex(expectedAffectedFilesPendingEmit!, ([expectedFile]) => actualFile === expectedFile, expectedIndex); + assert.notEqual(expectedIndex, -1, `Incremental build contains ${actualFile} file as pending emit, clean build should also have it: ${outputFile}::\nIncremental buildInfoText:: ${actualText}\nClean buildInfoText:: ${expectedText}`); + expectedIndex++; + }); + } + } } }); } + function getBuildInfoWithoutAffectedFilesPendingEmit(text: string | undefined): { text: string | undefined; affectedFilesPendingEmit?: ProgramBuildInfo["affectedFilesPendingEmit"]; } { + const buildInfo = text ? getBuildInfo(text) : undefined; + if (!buildInfo?.program?.affectedFilesPendingEmit) return { text }; + const { program: { affectedFilesPendingEmit, ...programRest }, ...rest } = buildInfo; + return { + text: getBuildInfoText({ + ...rest, + program: programRest + }), + affectedFilesPendingEmit + }; + } + export interface TscIncremental { buildKind: BuildKind; modifyFs: (fs: vfs.FileSystem) => void; @@ -356,12 +387,12 @@ interface Symbol { verifyTscBaseline(() => sys); }); - for (const { + incrementalScenarios.forEach(({ buildKind, modifyFs: incrementalModifyFs, subScenario: incrementalSubScenario, commandLineArgs: incrementalCommandLineArgs - } of incrementalScenarios) { + }, index) => { describe(incrementalSubScenario || buildKind, () => { let newSys: TscCompileSystem; before(() => { @@ -396,9 +427,9 @@ interface Symbol { incrementalModifyFs, modifyFs, tick - })); + }), index); }); - } + }); }); } @@ -497,7 +528,7 @@ interface Symbol { }, modifyFs, tick - }))); + }), index)); }); }); } diff --git a/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts b/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts index f5037f304cef0..eccd6e41aeb1a 100644 --- a/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts +++ b/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts @@ -42,10 +42,17 @@ namespace ts { import { default as bar } from './bar'; bar("hello");`); }, - incrementalScenarios: [{ - buildKind: BuildKind.IncrementalDtsChange, - modifyFs: changeBarParam - }] + incrementalScenarios: [ + { + buildKind: BuildKind.IncrementalDtsChange, + modifyFs: changeBarParam + }, + { + subScenario: "Fix Error", + buildKind: BuildKind.IncrementalDtsChange, + modifyFs: fs => replaceText(fs, "/src/lazyIndex.ts", `bar("hello")`, "bar()") + }, + ] }); }); diff --git a/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js b/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js index e70f1f9d5aa39..1efc8bd513b74 100644 --- a/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js +++ b/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js @@ -197,3 +197,111 @@ Found 7 errors. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +//// [/src/lib/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../animals/animal.ts": { + "version": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", + "signature": "13427676350-export declare type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../../animals/dog.ts": { + "version": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n", + "signature": "10854678623-import Animal from '.';\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\nexport declare function createDog(): Dog;\r\n", + "affectsGlobalScope": false + }, + "../../animals/index.ts": { + "version": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", + "signature": "4477582546-import Animal from './animal';\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", + "affectsGlobalScope": false + }, + "../../core/utilities.ts": { + "version": "-15713992787-import * as A from '../animals';\n\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n", + "signature": "-8177343116-export declare function makeRandomName(): string;\r\nexport declare function lastElementOf(arr: T[]): T | undefined;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "declaration": true, + "target": 1, + "module": 1, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true, + "outDir": "./", + "rootDir": "../../core", + "configFilePath": "../../core/tsconfig.json" + }, + "referencedMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts", + "../../core/utilities.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ], + "../../core/utilities.ts": [ + "../../animals/index.ts" + ] + }, + "exportedModulesMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../lib/lib.d.ts", + "../../animals/animal.ts", + "../../animals/dog.ts", + "../../animals/index.ts", + [ + "../../core/utilities.ts", + [ + { + "file": "../../core/utilities.ts", + "start": 0, + "length": 32, + "messageText": "'A' is declared but its value is never read.", + "category": 1, + "code": 6133, + "reportsUnnecessary": true + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../../animals/animal.ts", + 1 + ], + [ + "../../animals/dog.ts", + 1 + ], + [ + "../../animals/index.ts", + 1 + ], + [ + "../../core/utilities.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js index abc2adbd836a1..000e53f1e6cdb 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -264,3 +264,228 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +//// [/src/obj/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../bar.ts": { + "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", + "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", + "affectsGlobalScope": false + }, + "../bundling.ts": { + "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", + "affectsGlobalScope": false + }, + "../global.d.ts": { + "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "affectsGlobalScope": true + }, + "../lazyindex.ts": { + "version": "3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");", + "signature": "-6224542381-export { default as bar } from './bar';\r\n", + "affectsGlobalScope": false + }, + "../index.ts": { + "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "target": 1, + "declaration": true, + "outDir": "./", + "incremental": true, + "isolatedModules": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "exportedModulesMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../index.ts", + [ + "../lazyindex.ts", + [ + { + "file": "../lazyindex.ts", + "start": 85, + "length": 7, + "messageText": "Expected 0 arguments, but got 1.", + "category": 1, + "code": 2554 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../bar.ts", + 1 + ], + [ + "../index.ts", + 0 + ], + [ + "../lazyindex.ts", + 0 + ] + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: Fix Error +Input:: +//// [/src/lazyIndex.ts] +export { default as bar } from './bar'; + +import { default as bar } from './bar'; +bar(); + + + +Output:: +/lib/tsc --b /src --verbose +[12:07:00 AM] Projects in this build: + * src/tsconfig.json + +[12:07:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/lazyIndex.ts' + +[12:07:00 AM] Building project '/src/tsconfig.json'... + +[12:07:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/obj/bar.d.ts] +declare const _default: () => void; +export default _default; + + +//// [/src/obj/bar.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + + +//// [/src/obj/index.d.ts] +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + + +//// [/src/obj/lazyIndex.d.ts] file written with same contents +//// [/src/obj/lazyIndex.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var bar_1 = require("./bar"); +Object.defineProperty(exports, "bar", { enumerable: true, get: function () { return bar_1.default; } }); +var bar_2 = require("./bar"); +bar_2.default(); + + +//// [/src/obj/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../bar.ts": { + "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", + "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", + "affectsGlobalScope": false + }, + "../bundling.ts": { + "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", + "affectsGlobalScope": false + }, + "../global.d.ts": { + "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "affectsGlobalScope": true + }, + "../lazyindex.ts": { + "version": "-3721262293-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar();", + "signature": "-6224542381-export { default as bar } from './bar';\r\n", + "affectsGlobalScope": false + }, + "../index.ts": { + "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "target": 1, + "declaration": true, + "outDir": "./", + "incremental": true, + "isolatedModules": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "exportedModulesMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../index.ts", + "../lazyindex.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js index 091e9d94ba8bb..807e97f2c3cf3 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js @@ -64,6 +64,79 @@ Semantic diagnostics in builder refreshed for:: /src/src/other.ts +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: no-change-run @@ -90,10 +163,6 @@ Program files:: /src/src/other.ts Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts @@ -118,10 +187,7 @@ Program files:: /src/src/other.ts Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts /src/src/main.ts -/src/src/other.ts //// [/src/dev-build/shared/types/db.js] diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js index e1d0659797c0f..408fd4c55240c 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js @@ -65,3 +65,59 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +//// [/src/dist/tsconfig_withInclude.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../src/hello.json": { + "version": "6651571919-{\n \"hello\": \"world\"\n}", + "signature": "-4341462827-export declare const hello: string;\r\n", + "affectsGlobalScope": true + }, + "../src/index.ts": { + "version": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello", + "signature": "-1680156224-declare const _default: string;\r\nexport default _default;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "moduleResolution": 2, + "module": 1, + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "./", + "skipDefaultLibCheck": true, + "configFilePath": "../tsconfig_withInclude.json" + }, + "referencedMap": { + "../src/index.ts": [ + "../src/hello.json" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../src/hello.json", + "../src/index.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../src/hello.json", + 1 + ], + [ + "../src/index.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js index 20dc07826060f..d988e83869dad 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js @@ -196,3 +196,83 @@ exports.multiply = multiply; "version": "FakeTSVersion" } +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-6409874073-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.muitply();\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-4761685354-export declare function getSecondsInDay(): any;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + [ + "./index.ts", + [ + { + "file": "./index.ts", + "start": 87, + "length": 7, + "code": 2339, + "category": 1, + "messageText": "Property 'muitply' does not exist on type 'typeof import(\"/src/core/index\")'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../core/anothermodule.d.ts", + 1 + ], + [ + "../core/index.d.ts", + 1 + ], + [ + "./index.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js index 10a5f43474c07..1bc69c6c72629 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js @@ -114,3 +114,52 @@ exports.A = A; "version": "FakeTSVersion" } +//// [/src/tsconfig.b.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./b.ts": { + "version": "-17186364832-import {A} from 'a';\nexport const b = new A();", + "signature": "-6598996556-export declare const b: any;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "moduleResolution": 2, + "listFiles": true, + "configFilePath": "./tsconfig.b.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + [ + "./b.ts", + [ + { + "file": "./b.ts", + "start": 16, + "length": 3, + "messageText": "Cannot find module 'a' or its corresponding type declarations.", + "category": 1, + "code": 2307 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./b.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js index a22633150842a..d13fc00f24828 100644 --- a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js +++ b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js @@ -204,19 +204,19 @@ Output::    ~~~~~~~~~~~~ -[12:00:50 AM] Project 'animals/tsconfig.json' can't be built because its dependency 'core' has errors +[12:00:57 AM] Project 'animals/tsconfig.json' can't be built because its dependency 'core' has errors -[12:00:51 AM] Skipping build of project '/user/username/projects/demo/animals/tsconfig.json' because its dependency '/user/username/projects/demo/core' has errors +[12:00:58 AM] Skipping build of project '/user/username/projects/demo/animals/tsconfig.json' because its dependency '/user/username/projects/demo/core' has errors -[12:00:52 AM] Project 'zoo/tsconfig.json' can't be built because its dependency 'animals' was not built +[12:00:59 AM] Project 'zoo/tsconfig.json' can't be built because its dependency 'animals' was not built -[12:00:53 AM] Skipping build of project '/user/username/projects/demo/zoo/tsconfig.json' because its dependency '/user/username/projects/demo/animals' was not built +[12:01:00 AM] Skipping build of project '/user/username/projects/demo/zoo/tsconfig.json' because its dependency '/user/username/projects/demo/animals' was not built -[12:00:54 AM] Found 7 errors. Watching for file changes. +[12:01:01 AM] Found 7 errors. Watching for file changes. @@ -268,6 +268,115 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../animals/animal.ts": { + "version": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", + "signature": "-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "affectsGlobalScope": false + }, + "../../animals/dog.ts": { + "version": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n", + "signature": "6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "affectsGlobalScope": false + }, + "../../animals/index.ts": { + "version": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", + "signature": "1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "affectsGlobalScope": false + }, + "../../core/utilities.ts": { + "version": "-15713992787-import * as A from '../animals';\n\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n", + "signature": "-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "affectsGlobalScope": false + } + }, + "options": { + "declaration": true, + "target": 1, + "module": 1, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true, + "outDir": "./", + "rootDir": "../../core", + "watch": true, + "configFilePath": "../../core/tsconfig.json" + }, + "referencedMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts", + "../../core/utilities.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ], + "../../core/utilities.ts": [ + "../../animals/index.ts" + ] + }, + "exportedModulesMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../animals/animal.ts", + "../../animals/dog.ts", + "../../animals/index.ts", + [ + "../../core/utilities.ts", + [ + { + "file": "../../core/utilities.ts", + "start": 0, + "length": 32, + "messageText": "'A' is declared but its value is never read.", + "category": 1, + "code": 6133, + "reportsUnnecessary": true + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../../animals/animal.ts", + 1 + ], + [ + "../../animals/dog.ts", + 1 + ], + [ + "../../animals/index.ts", + 1 + ], + [ + "../../core/utilities.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: Prepend a line @@ -290,13 +399,13 @@ export function lastElementOf(arr: T[]): T | undefined { Output:: >> Screen clear -[12:00:58 AM] File change detected. Starting incremental compilation... +[12:01:05 AM] File change detected. Starting incremental compilation... -[12:00:59 AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/utilities.js' does not exist +[12:01:06 AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/utilities.js' does not exist -[12:01:00 AM] Building project '/user/username/projects/demo/core/tsconfig.json'... +[12:01:07 AM] Building project '/user/username/projects/demo/core/tsconfig.json'... animals/index.ts:1:20 - error TS6059: File '/user/username/projects/demo/animals/animal.ts' is not under 'rootDir' '/user/username/projects/demo/core'. 'rootDir' is expected to contain all source files. @@ -341,7 +450,7 @@ Output::    ~~~~~~~~~~~~ -[12:01:01 AM] Found 7 errors. Watching for file changes. +[12:01:11 AM] Found 7 errors. Watching for file changes. @@ -389,3 +498,112 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../animals/animal.ts": { + "version": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", + "signature": "-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "affectsGlobalScope": false + }, + "../../animals/dog.ts": { + "version": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n", + "signature": "6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "affectsGlobalScope": false + }, + "../../animals/index.ts": { + "version": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", + "signature": "1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "affectsGlobalScope": false + }, + "../../core/utilities.ts": { + "version": "-10926881769-\nimport * as A from '../animals';\n\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n", + "signature": "-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "affectsGlobalScope": false + } + }, + "options": { + "declaration": true, + "target": 1, + "module": 1, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true, + "outDir": "./", + "rootDir": "../../core", + "watch": true, + "configFilePath": "../../core/tsconfig.json" + }, + "referencedMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts", + "../../core/utilities.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ], + "../../core/utilities.ts": [ + "../../animals/index.ts" + ] + }, + "exportedModulesMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../animals/animal.ts", + "../../animals/dog.ts", + "../../animals/index.ts", + [ + "../../core/utilities.ts", + [ + { + "file": "../../core/utilities.ts", + "start": 1, + "length": 32, + "messageText": "'A' is declared but its value is never read.", + "category": 1, + "code": 6133, + "reportsUnnecessary": true + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../../animals/animal.ts", + 1 + ], + [ + "../../animals/dog.ts", + 1 + ], + [ + "../../animals/index.ts", + 1 + ], + [ + "../../core/utilities.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js index 49d3e41dac119..8d493f6a20fb8 100644 --- a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js +++ b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js @@ -309,7 +309,7 @@ Output::    ~ -[12:01:14 AM] Found 1 error. Watching for file changes. +[12:01:17 AM] Found 1 error. Watching for file changes. @@ -342,6 +342,72 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -350,13 +416,13 @@ Input:: Output:: >> Screen clear -[12:01:18 AM] File change detected. Starting incremental compilation... +[12:01:21 AM] File change detected. Starting incremental compilation... -[12:01:19 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' +[12:01:22 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' -[12:01:20 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:23 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -365,7 +431,7 @@ Output::    ~ -[12:01:21 AM] Found 1 error. Watching for file changes. +[12:01:24 AM] Found 1 error. Watching for file changes. @@ -408,19 +474,19 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... +[12:01:28 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' +[12:01:29 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' -[12:01:27 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:30 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... -[12:01:35 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:38 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... -[12:01:36 AM] Found 0 errors. Watching for file changes. +[12:01:39 AM] Found 0 errors. Watching for file changes. @@ -517,19 +583,19 @@ Input:: Output:: >> Screen clear -[12:01:40 AM] File change detected. Starting incremental compilation... +[12:01:43 AM] File change detected. Starting incremental compilation... -[12:01:41 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' +[12:01:44 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' -[12:01:42 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:45 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... -[12:01:44 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:47 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... -[12:01:45 AM] Found 0 errors. Watching for file changes. +[12:01:48 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js index bc2e4ee3c41c9..ab23323603329 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js @@ -440,7 +440,7 @@ Output::    ~ -[12:01:19 AM] Found 1 error. Watching for file changes. +[12:01:22 AM] Found 1 error. Watching for file changes. @@ -481,6 +481,79 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5445152744-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n\nlet y: string = 10;", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + [ + "./index.ts", + [ + { + "file": "./index.ts", + "start": 184, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./index.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: change core @@ -495,7 +568,7 @@ let x: string = 10; Output:: >> Screen clear -[12:01:23 AM] File change detected. Starting incremental compilation... +[12:01:26 AM] File change detected. Starting incremental compilation... sample1/core/index.ts:5:5 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -510,7 +583,7 @@ Output::    ~ -[12:01:24 AM] Found 2 errors. Watching for file changes. +[12:01:30 AM] Found 2 errors. Watching for file changes. @@ -550,3 +623,60 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-17094159457-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nlet x: string = 10;", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + [ + "./index.ts", + [ + { + "file": "./index.ts", + "start": 186, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./index.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js index 093a9c384ccd0..1cabdaa6df77d 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js @@ -441,7 +441,7 @@ Output::    ~ -[12:01:19 AM] Found 1 error. Watching for file changes. +[12:01:22 AM] Found 1 error. Watching for file changes. @@ -482,6 +482,80 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5445152744-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n\nlet y: string = 10;", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "preserveWatchOutput": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + [ + "./index.ts", + [ + { + "file": "./index.ts", + "start": 184, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./index.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: change core @@ -495,7 +569,7 @@ let x: string = 10; Output:: -[12:01:23 AM] File change detected. Starting incremental compilation... +[12:01:26 AM] File change detected. Starting incremental compilation... sample1/core/index.ts:5:5 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -510,7 +584,7 @@ Output::    ~ -[12:01:24 AM] Found 2 errors. Watching for file changes. +[12:01:30 AM] Found 2 errors. Watching for file changes. @@ -550,3 +624,61 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-17094159457-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nlet x: string = 10;", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "watch": true, + "preserveWatchOutput": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + [ + "./index.ts", + [ + { + "file": "./index.ts", + "start": 186, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./index.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js index f9209ae7cce24..22affa64eef36 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js @@ -64,6 +64,80 @@ Semantic diagnostics in builder refreshed for:: /src/src/other.ts +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "project": "..", + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: no-change-run @@ -90,10 +164,6 @@ Program files:: /src/src/other.ts Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts @@ -118,10 +188,7 @@ Program files:: /src/src/other.ts Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts /src/src/main.ts -/src/src/other.ts //// [/src/dev-build/shared/types/db.js] diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js index bf88e9a634f61..4155f637fec09 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js @@ -71,6 +71,68 @@ Semantic diagnostics in builder refreshed for:: /src/src/other.ts +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "2626879346-import { A } from \"../shared/types/db\";\r\nconst a = {\r\n lastName: 'sdsd'\r\n;", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "project": "..", + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: no-change-run @@ -102,10 +164,6 @@ Program files:: /src/src/other.ts Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts @@ -132,10 +190,7 @@ Program files:: /src/src/other.ts Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts /src/src/main.ts -/src/src/other.ts //// [/src/dev-build/shared/types/db.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js index 573187027d65f..2211239b58d9e 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js @@ -50,7 +50,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:32 AM] Found 1 error. Watching for file changes. +[12:00:37 AM] Found 1 error. Watching for file changes. @@ -90,6 +90,69 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "2626879346-import { A } from \"../shared/types/db\";\r\nconst a = {\r\n lastName: 'sdsd'\r\n;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -98,7 +161,7 @@ Input:: Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... src/main.ts:4:1 - error TS1005: ',' expected. @@ -112,7 +175,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:37 AM] Found 1 error. Watching for file changes. +[12:00:42 AM] Found 1 error. Watching for file changes. @@ -161,10 +224,10 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:00 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -201,25 +264,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -269,6 +313,25 @@ console.log("hi"); "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + Change:: Semantic Error @@ -280,7 +343,7 @@ const a: string = 10; Output:: >> Screen clear -[12:01:04 AM] File change detected. Starting incremental compilation... +[12:01:08 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -289,7 +352,7 @@ Output::    ~ -[12:01:05 AM] Found 1 error. Watching for file changes. +[12:01:12 AM] Found 1 error. Watching for file changes. @@ -326,6 +389,73 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -334,7 +464,7 @@ Input:: Output:: >> Screen clear -[12:01:09 AM] File change detected. Starting incremental compilation... +[12:01:16 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -343,7 +473,7 @@ Output::    ~ -[12:01:10 AM] Found 1 error. Watching for file changes. +[12:01:17 AM] Found 1 error. Watching for file changes. @@ -390,10 +520,10 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... +[12:01:21 AM] File change detected. Starting incremental compilation... -[12:01:21 AM] Found 0 errors. Watching for file changes. +[12:01:28 AM] Found 0 errors. Watching for file changes. @@ -430,12 +560,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -485,6 +609,12 @@ var a = "hello"; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + Change:: No change @@ -493,10 +623,10 @@ Input:: Output:: >> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... +[12:01:32 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Found 0 errors. Watching for file changes. +[12:01:33 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js index 7366de158e26b..3645a89dca2f7 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js @@ -50,7 +50,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:32 AM] Found 1 error. Watching for file changes. +[12:00:37 AM] Found 1 error. Watching for file changes. @@ -90,6 +90,70 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "2626879346-import { A } from \"../shared/types/db\";\r\nconst a = {\r\n lastName: 'sdsd'\r\n;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -98,7 +162,7 @@ Input:: Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... src/main.ts:4:1 - error TS1005: ',' expected. @@ -112,7 +176,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:37 AM] Found 1 error. Watching for file changes. +[12:00:42 AM] Found 1 error. Watching for file changes. @@ -161,10 +225,10 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +[12:01:10 AM] Found 0 errors. Watching for file changes. @@ -201,39 +265,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] -export interface A { - name: string; -} - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] -export {}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] -export {}; - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -284,6 +315,39 @@ export {}; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + Change:: Semantic Error @@ -295,7 +359,7 @@ const a: string = 10; Output:: >> Screen clear -[12:01:10 AM] File change detected. Starting incremental compilation... +[12:01:14 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -304,7 +368,7 @@ Output::    ~ -[12:01:11 AM] Found 1 error. Watching for file changes. +[12:01:18 AM] Found 1 error. Watching for file changes. @@ -341,6 +405,74 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -349,7 +481,7 @@ Input:: Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... +[12:01:22 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -358,7 +490,7 @@ Output::    ~ -[12:01:16 AM] Found 1 error. Watching for file changes. +[12:01:23 AM] Found 1 error. Watching for file changes. @@ -405,10 +537,10 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:20 AM] File change detected. Starting incremental compilation... +[12:01:27 AM] File change detected. Starting incremental compilation... -[12:01:30 AM] Found 0 errors. Watching for file changes. +[12:01:37 AM] Found 0 errors. Watching for file changes. @@ -445,13 +577,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -502,6 +627,13 @@ var a = "hello"; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents Change:: No change @@ -510,10 +642,10 @@ Input:: Output:: >> Screen clear -[12:01:34 AM] File change detected. Starting incremental compilation... +[12:01:41 AM] File change detected. Starting incremental compilation... -[12:01:35 AM] Found 0 errors. Watching for file changes. +[12:01:42 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js index 4c54f4a3dcf5a..0b10e3cc74b15 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js @@ -56,7 +56,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:32 AM] Found 1 error. Watching for file changes. +[12:00:37 AM] Found 1 error. Watching for file changes. @@ -96,6 +96,68 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "2626879346-import { A } from \"../shared/types/db\";\r\nconst a = {\r\n lastName: 'sdsd'\r\n;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -104,7 +166,7 @@ Input:: Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... src/main.ts:4:1 - error TS1005: ',' expected. @@ -118,7 +180,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:37 AM] Found 1 error. Watching for file changes. +[12:00:42 AM] Found 1 error. Watching for file changes. @@ -167,10 +229,10 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:00 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -207,25 +269,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -274,6 +317,25 @@ console.log("hi"); "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + Change:: Semantic Error @@ -285,7 +347,7 @@ const a: string = 10; Output:: >> Screen clear -[12:01:04 AM] File change detected. Starting incremental compilation... +[12:01:08 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -294,7 +356,7 @@ Output::    ~ -[12:01:05 AM] Found 1 error. Watching for file changes. +[12:01:12 AM] Found 1 error. Watching for file changes. @@ -331,6 +393,72 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -339,7 +467,7 @@ Input:: Output:: >> Screen clear -[12:01:09 AM] File change detected. Starting incremental compilation... +[12:01:16 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -348,7 +476,7 @@ Output::    ~ -[12:01:10 AM] Found 1 error. Watching for file changes. +[12:01:17 AM] Found 1 error. Watching for file changes. @@ -395,10 +523,10 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... +[12:01:21 AM] File change detected. Starting incremental compilation... -[12:01:21 AM] Found 0 errors. Watching for file changes. +[12:01:28 AM] Found 0 errors. Watching for file changes. @@ -435,12 +563,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -489,6 +611,12 @@ var a = "hello"; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + Change:: No change @@ -497,10 +625,10 @@ Input:: Output:: >> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... +[12:01:32 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Found 0 errors. Watching for file changes. +[12:01:33 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js index c39991c7ecb7c..53f2428366a3d 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js @@ -50,7 +50,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:32 AM] Found 1 error. Watching for file changes. +[12:00:37 AM] Found 1 error. Watching for file changes. @@ -90,6 +90,69 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "2626879346-import { A } from \"../shared/types/db\";\r\nconst a = {\r\n lastName: 'sdsd'\r\n;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -98,7 +161,7 @@ Input:: Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... src/main.ts:4:1 - error TS1005: ',' expected. @@ -112,7 +175,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:37 AM] Found 1 error. Watching for file changes. +[12:00:42 AM] Found 1 error. Watching for file changes. @@ -161,10 +224,10 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +[12:01:10 AM] Found 0 errors. Watching for file changes. @@ -201,39 +264,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] -export interface A { - name: string; -} - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] -export {}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] -export {}; - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -283,6 +313,39 @@ export {}; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + Change:: Semantic Error @@ -294,7 +357,7 @@ const a: string = 10; Output:: >> Screen clear -[12:01:10 AM] File change detected. Starting incremental compilation... +[12:01:14 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -303,7 +366,7 @@ Output::    ~ -[12:01:11 AM] Found 1 error. Watching for file changes. +[12:01:18 AM] Found 1 error. Watching for file changes. @@ -340,6 +403,73 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -348,7 +478,7 @@ Input:: Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... +[12:01:22 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -357,7 +487,7 @@ Output::    ~ -[12:01:16 AM] Found 1 error. Watching for file changes. +[12:01:23 AM] Found 1 error. Watching for file changes. @@ -404,10 +534,10 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:20 AM] File change detected. Starting incremental compilation... +[12:01:27 AM] File change detected. Starting incremental compilation... -[12:01:30 AM] Found 0 errors. Watching for file changes. +[12:01:37 AM] Found 0 errors. Watching for file changes. @@ -444,13 +574,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -500,6 +623,13 @@ var a = "hello"; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents Change:: No change @@ -508,10 +638,10 @@ Input:: Output:: >> Screen clear -[12:01:34 AM] File change detected. Starting incremental compilation... +[12:01:41 AM] File change detected. Starting incremental compilation... -[12:01:35 AM] Found 0 errors. Watching for file changes. +[12:01:42 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js index fae85fec53efc..f37e12c72a020 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js @@ -50,7 +50,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:32 AM] Found 1 error. Watching for file changes. +[12:00:37 AM] Found 1 error. Watching for file changes. @@ -90,6 +90,69 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "2626879346-import { A } from \"../shared/types/db\";\r\nconst a = {\r\n lastName: 'sdsd'\r\n;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -98,7 +161,7 @@ Input:: Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... src/main.ts:4:1 - error TS1005: ',' expected. @@ -112,7 +175,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:37 AM] Found 1 error. Watching for file changes. +[12:00:42 AM] Found 1 error. Watching for file changes. @@ -161,10 +224,10 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:00 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -201,25 +264,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -269,6 +313,25 @@ console.log("hi"); "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + Change:: Semantic Error @@ -280,7 +343,7 @@ const a: string = 10; Output:: >> Screen clear -[12:01:04 AM] File change detected. Starting incremental compilation... +[12:01:08 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -289,7 +352,7 @@ Output::    ~ -[12:01:05 AM] Found 1 error. Watching for file changes. +[12:01:12 AM] Found 1 error. Watching for file changes. @@ -326,6 +389,73 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -334,7 +464,7 @@ Input:: Output:: >> Screen clear -[12:01:09 AM] File change detected. Starting incremental compilation... +[12:01:16 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -343,7 +473,7 @@ Output::    ~ -[12:01:10 AM] Found 1 error. Watching for file changes. +[12:01:17 AM] Found 1 error. Watching for file changes. @@ -390,10 +520,10 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... +[12:01:21 AM] File change detected. Starting incremental compilation... -[12:01:21 AM] Found 0 errors. Watching for file changes. +[12:01:28 AM] Found 0 errors. Watching for file changes. @@ -430,12 +560,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -485,6 +609,12 @@ var a = "hello"; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + Change:: No change @@ -493,10 +623,10 @@ Input:: Output:: >> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... +[12:01:32 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Found 0 errors. Watching for file changes. +[12:01:33 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js index ff43939b2d827..49f1078e3fccf 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js @@ -50,7 +50,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:32 AM] Found 1 error. Watching for file changes. +[12:00:37 AM] Found 1 error. Watching for file changes. @@ -90,6 +90,70 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "2626879346-import { A } from \"../shared/types/db\";\r\nconst a = {\r\n lastName: 'sdsd'\r\n;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + 1 + ], + [ + "../src/main.ts", + 1 + ], + [ + "../src/other.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -98,7 +162,7 @@ Input:: Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... src/main.ts:4:1 - error TS1005: ',' expected. @@ -112,7 +176,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -[12:00:37 AM] Found 1 error. Watching for file changes. +[12:00:42 AM] Found 1 error. Watching for file changes. @@ -161,10 +225,10 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +[12:01:10 AM] Found 0 errors. Watching for file changes. @@ -201,39 +265,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] -export interface A { - name: string; -} - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] -export {}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] -export {}; - - //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -284,6 +315,39 @@ export {}; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + Change:: Semantic Error @@ -295,7 +359,7 @@ const a: string = 10; Output:: >> Screen clear -[12:01:10 AM] File change detected. Starting incremental compilation... +[12:01:14 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -304,7 +368,7 @@ Output::    ~ -[12:01:11 AM] Found 1 error. Watching for file changes. +[12:01:18 AM] Found 1 error. Watching for file changes. @@ -341,6 +405,74 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + [ + "../src/main.ts", + [ + { + "file": "../src/main.ts", + "start": 46, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'number' is not assignable to type 'string'." + } + ] + ], + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + 1 + ] + ] + }, + "version": "FakeTSVersion" +} + Change:: No change @@ -349,7 +481,7 @@ Input:: Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... +[12:01:22 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -358,7 +490,7 @@ Output::    ~ -[12:01:16 AM] Found 1 error. Watching for file changes. +[12:01:23 AM] Found 1 error. Watching for file changes. @@ -405,10 +537,10 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:20 AM] File change detected. Starting incremental compilation... +[12:01:27 AM] File change detected. Starting incremental compilation... -[12:01:30 AM] Found 0 errors. Watching for file changes. +[12:01:37 AM] Found 0 errors. Watching for file changes. @@ -445,13 +577,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] { "program": { @@ -502,6 +627,13 @@ var a = "hello"; "version": "FakeTSVersion" } +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents Change:: No change @@ -510,10 +642,10 @@ Input:: Output:: >> Screen clear -[12:01:34 AM] File change detected. Starting incremental compilation... +[12:01:41 AM] File change detected. Starting incremental compilation... -[12:01:35 AM] Found 0 errors. Watching for file changes. +[12:01:42 AM] Found 0 errors. Watching for file changes. From d88ea4e1f8eb6ebc90e79d90030488175485109d Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 2 Jun 2020 19:06:12 -0700 Subject: [PATCH 40/48] address PR comments --- src/services/codefixes/generateAccessors.ts | 4 ++-- .../refactors/addOrRemoveBracesToArrowFunction.ts | 4 ++-- src/services/refactors/convertExport.ts | 5 ++--- src/services/refactors/convertImport.ts | 5 ++--- src/services/refactors/extractSymbol.ts | 6 +++--- src/services/refactors/extractType.ts | 4 ++-- ...rAddOrRemoveBracesToArrowFunctionForTriggerReason1.ts} | 2 +- ...orAddOrRemoveBracesToArrowFunctionForTriggerReason2.ts | 8 ++++++++ ...eason.ts => refactorConvertImportForTriggerReason1.ts} | 0 .../fourslash/refactorConvertImportForTriggerReason2.ts | 8 ++++++++ ...rReason.ts => refactorExtractTypeForTriggerReason1.ts} | 0 .../fourslash/refactorExtractTypeForTriggerReason2.ts | 7 +++++++ 12 files changed, 37 insertions(+), 16 deletions(-) rename tests/cases/fourslash/{refactorAddOrRemoveBracesToArrowFunctionForTriggerReason.ts => refactorAddOrRemoveBracesToArrowFunctionForTriggerReason1.ts} (82%) create mode 100644 tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason2.ts rename tests/cases/fourslash/{refactorConvertImportForTriggerReason.ts => refactorConvertImportForTriggerReason1.ts} (100%) create mode 100644 tests/cases/fourslash/refactorConvertImportForTriggerReason2.ts rename tests/cases/fourslash/{refactorExtractTypeForTriggerReason.ts => refactorExtractTypeForTriggerReason1.ts} (100%) create mode 100644 tests/cases/fourslash/refactorExtractTypeForTriggerReason2.ts diff --git a/src/services/codefixes/generateAccessors.ts b/src/services/codefixes/generateAccessors.ts index 904e52d29c586..3c9e82e157cbb 100644 --- a/src/services/codefixes/generateAccessors.ts +++ b/src/services/codefixes/generateAccessors.ts @@ -104,9 +104,9 @@ namespace ts.codefix { return modifierFlags; } - export function getAccessorConvertiblePropertyAtPosition(file: SourceFile, start: number, end: number, userRequested = true): Info | undefined { + export function getAccessorConvertiblePropertyAtPosition(file: SourceFile, start: number, end: number, considerEmptySpans = true): Info | undefined { const node = getTokenAtPosition(file, start); - const cursorRequest = start === end && userRequested; + const cursorRequest = start === end && considerEmptySpans; const declaration = findAncestor(node.parent, isAcceptedDeclaration); // make sure declaration have AccessibilityModifier or Static Modifier or Readonly Modifier const meaning = ModifierFlags.AccessibilityModifier | ModifierFlags.Static | ModifierFlags.Readonly; diff --git a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts index 84e596c5e4116..5a11b862dd8d9 100644 --- a/src/services/refactors/addOrRemoveBracesToArrowFunction.ts +++ b/src/services/refactors/addOrRemoveBracesToArrowFunction.ts @@ -70,12 +70,12 @@ namespace ts.refactor.addOrRemoveBracesToArrowFunction { return { renameFilename: undefined, renameLocation: undefined, edits }; } - function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number, userRequested = true): Info | undefined { + function getConvertibleArrowFunctionAtPosition(file: SourceFile, startPosition: number, considerFunctionBodies = true): Info | undefined { const node = getTokenAtPosition(file, startPosition); const func = getContainingFunction(node); // Only offer a refactor in the function body on explicit refactor requests. if (!func || !isArrowFunction(func) || (!rangeContainsRange(func, node) - || (rangeContainsRange(func.body, node) && !userRequested))) return undefined; + || (rangeContainsRange(func.body, node) && !considerFunctionBodies))) return undefined; if (isExpression(func.body)) { return { diff --git a/src/services/refactors/convertExport.ts b/src/services/refactors/convertExport.ts index b6440de228444..c79833db1ea6b 100644 --- a/src/services/refactors/convertExport.ts +++ b/src/services/refactors/convertExport.ts @@ -27,12 +27,11 @@ namespace ts.refactor { readonly exportingModuleSymbol: Symbol; } - function getInfo(context: RefactorContext, userRequested = true): Info | undefined { + function getInfo(context: RefactorContext, considerPartialSpans = true): Info | undefined { const { file } = context; const span = getRefactorContextSpan(context); const token = getTokenAtPosition(file, span.start); - const cursorRequest = userRequested && span; - const exportNode = !!(getSyntacticModifierFlags(token.parent) & ModifierFlags.Export) && cursorRequest ? token.parent : getParentNodeInSpan(token, file, span); + const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) & ModifierFlags.Export) && considerPartialSpans ? token.parent : getParentNodeInSpan(token, file, span); if (!exportNode || (!isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent)))) { return undefined; } diff --git a/src/services/refactors/convertImport.ts b/src/services/refactors/convertImport.ts index 88c501925c15f..1383aa18ddbd2 100644 --- a/src/services/refactors/convertImport.ts +++ b/src/services/refactors/convertImport.ts @@ -19,12 +19,11 @@ namespace ts.refactor { }); // Can convert imports of the form `import * as m from "m";` or `import d, { x, y } from "m";`. - function getImportToConvert(context: RefactorContext, userRequested = true): NamedImportBindings | undefined { + function getImportToConvert(context: RefactorContext, considerPartialSpans = true): NamedImportBindings | undefined { const { file } = context; const span = getRefactorContextSpan(context); const token = getTokenAtPosition(file, span.start); - const cursorRequest = userRequested && span.length === 0; - const importDecl = cursorRequest ? findAncestor(token, isImportDeclaration) : getParentNodeInSpan(token, file, span); + const importDecl = considerPartialSpans ? findAncestor(token, isImportDeclaration) : getParentNodeInSpan(token, file, span); if (!importDecl || !isImportDeclaration(importDecl) || (importDecl.getEnd() < span.start + span.length)) return undefined; const { importClause } = importDecl; return importClause && importClause.namedBindings; diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 3da484a9ce630..5c274ffbe1817 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -186,12 +186,12 @@ namespace ts.refactor.extractSymbol { * not shown to the user, but can be used by us diagnostically) */ // exported only for tests - export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan, userRequested = true): RangeToExtract { + export function getRangeToExtract(sourceFile: SourceFile, span: TextSpan, considerEmptySpans = true): RangeToExtract { const { length } = span; - if (length === 0 && !userRequested) { + if (length === 0 && !considerEmptySpans) { return { errors: [createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractEmpty)] }; } - const cursorRequest = length === 0 && userRequested; + const cursorRequest = length === 0 && considerEmptySpans; // Walk up starting from the the start position until we find a non-SourceFile node that subsumes the selected span. // This may fail (e.g. you select two statements in the root of a source file) diff --git a/src/services/refactors/extractType.ts b/src/services/refactors/extractType.ts index 4941c4dffd6ac..491fec63bd016 100644 --- a/src/services/refactors/extractType.ts +++ b/src/services/refactors/extractType.ts @@ -58,12 +58,12 @@ namespace ts.refactor { type Info = TypeAliasInfo | InterfaceInfo; - function getRangeToExtract(context: RefactorContext, userRequested = true): Info | undefined { + function getRangeToExtract(context: RefactorContext, considerEmptySpans = true): Info | undefined { const { file, startPosition } = context; const isJS = isSourceFileJS(file); const current = getTokenAtPosition(file, startPosition); const range = createTextRangeFromSpan(getRefactorContextSpan(context)); - const cursorRequest = range.pos === range.end && userRequested; + const cursorRequest = range.pos === range.end && considerEmptySpans; const selection = findAncestor(current, (node => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) && (cursorRequest || nodeOverlapsWithStartEnd(current, file, range.pos, range.end)))); diff --git a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason.ts b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason1.ts similarity index 82% rename from tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason.ts rename to tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason1.ts index a1e940fa7b1ee..4f5e41a8e3ae4 100644 --- a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason.ts +++ b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason1.ts @@ -2,7 +2,7 @@ //// const a = (a: number) => { return/*a*//*b*/ a; }; -// Only offer refactor for empty span if explicity requested +// Only offer refactor for empty span in body if explicity requested goTo.select("a", "b"); verify.not.refactorAvailableForTriggerReason("implicit", "Add or remove braces in an arrow function"); verify.refactorAvailableForTriggerReason("invoked", "Add or remove braces in an arrow function", "Remove braces from arrow function"); diff --git a/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason2.ts b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason2.ts new file mode 100644 index 0000000000000..5677e2c714450 --- /dev/null +++ b/tests/cases/fourslash/refactorAddOrRemoveBracesToArrowFunctionForTriggerReason2.ts @@ -0,0 +1,8 @@ +/// + +//// const a = (a: number) => { re/*a*/tur/*b*/n a; }; + +// Only offer refactor in body if explicity requested +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Add or remove braces in an arrow function"); +verify.refactorAvailableForTriggerReason("invoked", "Add or remove braces in an arrow function", "Remove braces from arrow function"); diff --git a/tests/cases/fourslash/refactorConvertImportForTriggerReason.ts b/tests/cases/fourslash/refactorConvertImportForTriggerReason1.ts similarity index 100% rename from tests/cases/fourslash/refactorConvertImportForTriggerReason.ts rename to tests/cases/fourslash/refactorConvertImportForTriggerReason1.ts diff --git a/tests/cases/fourslash/refactorConvertImportForTriggerReason2.ts b/tests/cases/fourslash/refactorConvertImportForTriggerReason2.ts new file mode 100644 index 0000000000000..1404ade7348e2 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertImportForTriggerReason2.ts @@ -0,0 +1,8 @@ +/// + +////import d, * as /*a*/n/*b*/ from "m"; + +// Only offer refactor for sub span if explicity requested +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Convert import"); +verify.refactorAvailableForTriggerReason("invoked", "Convert import"); diff --git a/tests/cases/fourslash/refactorExtractTypeForTriggerReason.ts b/tests/cases/fourslash/refactorExtractTypeForTriggerReason1.ts similarity index 100% rename from tests/cases/fourslash/refactorExtractTypeForTriggerReason.ts rename to tests/cases/fourslash/refactorExtractTypeForTriggerReason1.ts diff --git a/tests/cases/fourslash/refactorExtractTypeForTriggerReason2.ts b/tests/cases/fourslash/refactorExtractTypeForTriggerReason2.ts new file mode 100644 index 0000000000000..0f81c3cc88b84 --- /dev/null +++ b/tests/cases/fourslash/refactorExtractTypeForTriggerReason2.ts @@ -0,0 +1,7 @@ +/// + +//// var x: s/*a*/tr/*b*/ing; + +goTo.select("a", "b"); +verify.refactorAvailableForTriggerReason("implicit", "Extract type"); +verify.refactorAvailableForTriggerReason("invoked", "Extract type"); From d8091de532d52ec042f3f53408f3b84d39c5a8dd Mon Sep 17 00:00:00 2001 From: csigs Date: Wed, 3 Jun 2020 04:10:42 +0000 Subject: [PATCH 41/48] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index f6c3dc0e81b29..2759a41543b27 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -12000,6 +12000,24 @@ + + + + + + + + + + + + + + + + + + From 7a9e8fc8ec9a63cff04bbfc7f877feb752b6c08a Mon Sep 17 00:00:00 2001 From: typescript-bot Date: Wed, 3 Jun 2020 04:38:50 +0000 Subject: [PATCH 42/48] Update user baselines --- tests/baselines/reference/docker/vscode.log | 57 ++++- tests/baselines/reference/docker/vue-next.log | 12 +- tests/baselines/reference/user/acorn.log | 8 +- .../reference/user/adonis-framework.log | 7 +- tests/baselines/reference/user/async.log | 2 +- tests/baselines/reference/user/axios-src.log | 14 +- tests/baselines/reference/user/bluebird.log | 6 +- .../user/chrome-devtools-frontend.log | 50 ++-- tests/baselines/reference/user/debug.log | 6 +- .../baselines/reference/user/graceful-fs.log | 4 +- tests/baselines/reference/user/lodash.log | 6 +- tests/baselines/reference/user/npm.log | 53 ++-- tests/baselines/reference/user/npmlog.log | 6 +- tests/baselines/reference/user/uglify-js.log | 229 +++++++++--------- .../reference/user/url-search-params.log | 1 - tests/baselines/reference/user/webpack.log | 28 --- tests/baselines/reference/user/zone.js.log | 7 + 17 files changed, 264 insertions(+), 232 deletions(-) delete mode 100644 tests/baselines/reference/user/webpack.log create mode 100644 tests/baselines/reference/user/zone.js.log diff --git a/tests/baselines/reference/docker/vscode.log b/tests/baselines/reference/docker/vscode.log index 45c7728bdb5d0..1fa23a22470b2 100644 --- a/tests/baselines/reference/docker/vscode.log +++ b/tests/baselines/reference/docker/vscode.log @@ -1,11 +1,64 @@ -Exit Code: 0 +Exit Code: 1 Standard output: yarn run vX.X.X $ gulp compile --max_old_space_size=4095 [XX:XX:XX] Node flags detected: --max_old_space_size=4095 [XX:XX:XX] Using gulpfile /vscode/gulpfile.js -Done in ?s. +[XX:XX:XX] Error: /vscode/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts(30,6): 'activeTextEditorControl' is defined as a property in class 'TestEditorService', but is overridden here in 'TestEditorServiceWithActiveEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts(40,6): 'activeEditor' is defined as a property in class 'TestEditorService', but is overridden here in 'TestEditorServiceWithActiveEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/files/browser/views/explorerView.ts(198,6): 'title' is defined as a property in class 'ViewPane', but is overridden here in 'ExplorerView' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts(106,8): 'localExtensionManagementServer' is defined as a property in class 'ExtensionManagementServerService', but is overridden here in '(Anonymous class)' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts(106,7): 'localExtensionManagementServer' is defined as a property in class 'ExtensionManagementServerService', but is overridden here in '(Anonymous class)' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/remote/browser/explorerViewItems.ts(30,2): 'actionRunner' is defined as an accessor in class 'SelectActionViewItem', but is overridden here in 'SwitchRemoteViewItem' as an instance property. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts(202,6): 'minimumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'SettingsEditor2' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts(203,6): 'maximumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'SettingsEditor2' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts(76,6): 'minimumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'PreferencesEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts(77,6): 'maximumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'PreferencesEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/output/browser/outputView.ts(169,16): 'instantiationService' is defined as a property in class 'AbstractTextResourceEditor', but is overridden here in 'OutputEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.ts(63,6): 'minimumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'NotebookEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.ts(64,6): 'maximumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'NotebookEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(38,6): 'minimumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'SideBySideEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(39,6): 'maximumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'SideBySideEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(40,6): 'minimumHeight' is defined as a property in class 'BaseEditor', but is overridden here in 'SideBySideEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(41,6): 'maximumHeight' is defined as a property in class 'BaseEditor', but is overridden here in 'SideBySideEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/base/browser/ui/tree/asyncDataTree.ts(161,6): 'context' is defined as a property in class 'ElementsDragAndDropData', but is overridden here in 'AsyncDataTreeElementsDragAndDropData' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/base/browser/ui/tree/abstractTree.ts(33,6): 'context' is defined as a property in class 'ElementsDragAndDropData', but is overridden here in 'TreeElementsDragAndDropData' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/test/electron-browser/workbenchTestServices.ts(142,16): 'encodingOverrides' is defined as a property in class 'EncodingOracle', but is overridden here in 'TestEncodingOracle' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts(30,6): 'activeTextEditorControl' is defined as a property in class 'TestEditorService', but is overridden here in 'TestEditorServiceWithActiveEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts(40,6): 'activeEditor' is defined as a property in class 'TestEditorService', but is overridden here in 'TestEditorServiceWithActiveEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/files/browser/views/explorerView.ts(198,6): 'title' is defined as a property in class 'ViewPane', but is overridden here in 'ExplorerView' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts(106,8): 'localExtensionManagementServer' is defined as a property in class 'ExtensionManagementServerService', but is overridden here in '(Anonymous class)' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts(106,7): 'localExtensionManagementServer' is defined as a property in class 'ExtensionManagementServerService', but is overridden here in '(Anonymous class)' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/remote/browser/explorerViewItems.ts(30,2): 'actionRunner' is defined as an accessor in class 'SelectActionViewItem', but is overridden here in 'SwitchRemoteViewItem' as an instance property. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts(202,6): 'minimumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'SettingsEditor2' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts(203,6): 'maximumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'SettingsEditor2' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts(76,6): 'minimumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'PreferencesEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts(77,6): 'maximumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'PreferencesEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/output/browser/outputView.ts(169,16): 'instantiationService' is defined as a property in class 'AbstractTextResourceEditor', but is overridden here in 'OutputEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.ts(63,6): 'minimumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'NotebookEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.ts(64,6): 'maximumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'NotebookEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(38,6): 'minimumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'SideBySideEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(39,6): 'maximumWidth' is defined as a property in class 'BaseEditor', but is overridden here in 'SideBySideEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(40,6): 'minimumHeight' is defined as a property in class 'BaseEditor', but is overridden here in 'SideBySideEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(41,6): 'maximumHeight' is defined as a property in class 'BaseEditor', but is overridden here in 'SideBySideEditor' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/base/browser/ui/tree/asyncDataTree.ts(161,6): 'context' is defined as a property in class 'ElementsDragAndDropData', but is overridden here in 'AsyncDataTreeElementsDragAndDropData' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/base/browser/ui/tree/abstractTree.ts(33,6): 'context' is defined as a property in class 'ElementsDragAndDropData', but is overridden here in 'TreeElementsDragAndDropData' as an accessor. +[XX:XX:XX] Error: /vscode/src/vs/workbench/test/electron-browser/workbenchTestServices.ts(142,16): 'encodingOverrides' is defined as a property in class 'EncodingOracle', but is overridden here in 'TestEncodingOracle' as an accessor. +info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Standard error: +[XX:XX:XX] 'compile' errored after +[XX:XX:XX] Error: Found 20 errors + at Stream. (/vscode/build/lib/reporter.js:75:29) + at _end (/vscode/node_modules/through/index.js:65:9) + at Stream.stream.end (/vscode/node_modules/through/index.js:74:5) + at Stream.onend (internal/streams/legacy.js:42:10) + at Stream.emit (events.js:203:15) + at Stream.EventEmitter.emit (domain.js:466:23) + at drain (/vscode/node_modules/through/index.js:34:23) + at Stream.stream.resume (/vscode/node_modules/through/index.js:99:5) + at Stream.ondrain (internal/streams/legacy.js:24:14) + at Stream.emit (events.js:198:13) +error Command failed with exit code 1. diff --git a/tests/baselines/reference/docker/vue-next.log b/tests/baselines/reference/docker/vue-next.log index 9187c7c5d1720..b6966c52d01b4 100644 --- a/tests/baselines/reference/docker/vue-next.log +++ b/tests/baselines/reference/docker/vue-next.log @@ -1,7 +1,7 @@ Exit Code: 0 Standard output: -> @X.X.X-beta.12 build /vue-next +> @X.X.X-beta.14 build /vue-next > node scripts/build.js "--types" Rolling up type definitions for compiler-core... Writing: /vue-next/temp/compiler-core.api.json @@ -105,17 +105,17 @@ created packages/reactivity/dist/reactivity.global.prod.js in ?s [!] (plugin rpt2) Error: /vue-next/packages/runtime-core/src/apiInject.ts(40,9): semantic error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'. packages/runtime-core/src/apiInject.ts Error: /vue-next/packages/runtime-core/src/apiInject.ts(40,9): semantic error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'. - at error (/vue-next/node_modules/rollup/dist/shared/rollup.js:161:30) - at throwPluginError (/vue-next/node_modules/rollup/dist/shared/rollup.js:16989:12) - at Object.error (/vue-next/node_modules/rollup/dist/shared/rollup.js:18021:24) - at Object.error (/vue-next/node_modules/rollup/dist/shared/rollup.js:17162:38) + at error (/vue-next/node_modules/rollup/dist/shared/rollup.js:217:30) + at throwPluginError (/vue-next/node_modules/rollup/dist/shared/rollup.js:17067:12) + at Object.error (/vue-next/node_modules/rollup/dist/shared/rollup.js:17806:24) + at Object.error (/vue-next/node_modules/rollup/dist/shared/rollup.js:17240:38) at RollupContext.error (/vue-next/node_modules/rollup-plugin-typescript2/src/rollupcontext.ts:37:18) at /vue-next/node_modules/rollup-plugin-typescript2/src/print-diagnostics.ts:41:11 at arrayEach (/vue-next/node_modules/rollup-plugin-typescript2/node_modules/lodash/lodash.js:516:11) at forEach (/vue-next/node_modules/rollup-plugin-typescript2/node_modules/lodash/lodash.js:9342:14) at _.each (/vue-next/node_modules/rollup-plugin-typescript2/src/print-diagnostics.ts:9:2) at Object.transform (/vue-next/node_modules/rollup-plugin-typescript2/src/index.ts:242:5) -(node:18) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1 (EPERM): rollup -c --environment COMMIT:74ed7d1,NODE_ENV:production,TARGET:runtime-core,TYPES:true +(node:18) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1 (EPERM): rollup -c --environment COMMIT:db41c45,NODE_ENV:production,TARGET:runtime-core,TYPES:true at makeError (/vue-next/node_modules/execa/lib/error.js:59:11) at handlePromise (/vue-next/node_modules/execa/index.js:112:26) at processTicksAndRejections (internal/process/task_queues.js:97:5) diff --git a/tests/baselines/reference/user/acorn.log b/tests/baselines/reference/user/acorn.log index aa6f40f779829..36cafdeb5b99f 100644 --- a/tests/baselines/reference/user/acorn.log +++ b/tests/baselines/reference/user/acorn.log @@ -118,10 +118,10 @@ node_modules/acorn/acorn/dist/bin.js(58,23): error TS2769: No overload matches t Overload 1 of 3, '(path: string | number | Buffer | URL, options?: { encoding?: null | undefined; flag?: string | undefined; } | null | undefined): Buffer', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. - Overload 2 of 3, '(path: string | number | Buffer | URL, options: string | { encoding: string; flag?: string | undefined; }): string', gave the following error. + Overload 2 of 3, '(path: string | number | Buffer | URL, options: { encoding: BufferEncoding; flag?: string | undefined; } | "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | ... 4 more ... | "hex"): string', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. - Overload 3 of 3, '(path: string | number | Buffer | URL, options?: string | { encoding?: string | null | undefined; flag?: string | undefined; } | null | undefined): string | Buffer', gave the following error. + Overload 3 of 3, '(path: string | number | Buffer | URL, options?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | (BaseEncodingOptions & { ...; }) | null | undefined): string | Buffer', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. node_modules/acorn/bin/_acorn.js(51,30): error TS2339: Property 'getToken' does not exist on type 'Parser'. @@ -135,10 +135,10 @@ node_modules/acorn/bin/_acorn.js(63,23): error TS2769: No overload matches this Overload 1 of 3, '(path: string | number | Buffer | URL, options?: { encoding?: null | undefined; flag?: string | undefined; } | null | undefined): Buffer', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. - Overload 2 of 3, '(path: string | number | Buffer | URL, options: string | { encoding: string; flag?: string | undefined; }): string', gave the following error. + Overload 2 of 3, '(path: string | number | Buffer | URL, options: { encoding: BufferEncoding; flag?: string | undefined; } | "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | ... 4 more ... | "hex"): string', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. - Overload 3 of 3, '(path: string | number | Buffer | URL, options?: string | { encoding?: string | null | undefined; flag?: string | undefined; } | null | undefined): string | Buffer', gave the following error. + Overload 3 of 3, '(path: string | number | Buffer | URL, options?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | (BaseEncodingOptions & { ...; }) | null | undefined): string | Buffer', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | number | Buffer | URL'. Type 'undefined' is not assignable to type 'string | number | Buffer | URL'. node_modules/acorn/bin/run_test262.js(3,21): error TS2307: Cannot find module 'test262-parser-runner' or its corresponding type declarations. diff --git a/tests/baselines/reference/user/adonis-framework.log b/tests/baselines/reference/user/adonis-framework.log index 328b8e884d588..597644c7e6fcc 100644 --- a/tests/baselines/reference/user/adonis-framework.log +++ b/tests/baselines/reference/user/adonis-framework.log @@ -35,6 +35,7 @@ node_modules/adonis-framework/src/Encryption/index.js(101,62): error TS2769: No Argument of type 'string' is not assignable to parameter of type 'Utf8AsciiBinaryEncoding'. node_modules/adonis-framework/src/Encryption/index.js(102,5): error TS2322: Type 'string' is not assignable to type 'Buffer & string'. Type 'string' is not assignable to type 'Buffer'. +node_modules/adonis-framework/src/Encryption/index.js(102,33): error TS2345: Argument of type 'string' is not assignable to parameter of type 'BufferEncoding'. node_modules/adonis-framework/src/Encryption/index.js(114,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Encryption/index.js(119,23): error TS2554: Expected 2 arguments, but got 1. node_modules/adonis-framework/src/Encryption/index.js(183,15): error TS2304: Cannot find name 'Mixed'. @@ -56,8 +57,8 @@ node_modules/adonis-framework/src/Event/index.js(207,24): error TS2304: Cannot f node_modules/adonis-framework/src/Event/index.js(256,52): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'. Type 'Function' provides no match for the signature '(...values: any[]): void'. node_modules/adonis-framework/src/Event/index.js(264,28): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'. -node_modules/adonis-framework/src/Event/index.js(271,25): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[string, any, TimerHandler]'. -node_modules/adonis-framework/src/Event/index.js(278,25): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[string, any, TimerHandler]'. +node_modules/adonis-framework/src/Event/index.js(271,25): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[event: string, name: any, handler: TimerHandler]'. +node_modules/adonis-framework/src/Event/index.js(278,25): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[event: string, name: any, handler: TimerHandler]'. node_modules/adonis-framework/src/Event/index.js(294,30): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'. node_modules/adonis-framework/src/Exceptions/index.js(13,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. node_modules/adonis-framework/src/Exceptions/index.js(27,21): error TS2554: Expected 0 arguments, but got 3. @@ -89,7 +90,7 @@ node_modules/adonis-framework/src/Helpers/index.js(240,45): error TS2345: Argume Type 'undefined' is not assignable to type 'string'. node_modules/adonis-framework/src/Helpers/index.js(256,45): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'. -node_modules/adonis-framework/src/Helpers/index.js(330,23): error TS2532: Object is possibly 'undefined'. +node_modules/adonis-framework/src/Helpers/index.js(330,31): error TS2339: Property 'mainModule' does not exist on type 'Process'. node_modules/adonis-framework/src/Middleware/index.js(13,21): error TS2307: Cannot find module 'adonis-fold' or its corresponding type declarations. node_modules/adonis-framework/src/Middleware/index.js(87,38): error TS1016: A required parameter cannot follow an optional parameter. node_modules/adonis-framework/src/Middleware/index.js(230,20): error TS8024: JSDoc '@param' tag has name 'Middleware', but there is no parameter with that name. diff --git a/tests/baselines/reference/user/async.log b/tests/baselines/reference/user/async.log index 3c9f1a23f42b6..5e662d683c7c3 100644 --- a/tests/baselines/reference/user/async.log +++ b/tests/baselines/reference/user/async.log @@ -92,7 +92,7 @@ node_modules/async/dist/async.js(31,30): error TS1003: Identifier expected. node_modules/async/dist/async.js(298,7): error TS2454: Variable 'unmasked' is used before being assigned. node_modules/async/dist/async.js(622,80): error TS2339: Property 'nodeType' does not exist on type 'NodeModule'. node_modules/async/dist/async.js(748,84): error TS2339: Property 'nodeType' does not exist on type 'NodeModule'. -node_modules/async/dist/async.js(754,49): error TS2339: Property 'process' does not exist on type 'false | Global'. +node_modules/async/dist/async.js(754,49): error TS2339: Property 'process' does not exist on type 'false | (Global & typeof globalThis)'. Property 'process' does not exist on type 'false'. node_modules/async/dist/async.js(810,45): error TS2554: Expected 0 arguments, but got 1. node_modules/async/dist/async.js(923,32): error TS2554: Expected 2 arguments, but got 1. diff --git a/tests/baselines/reference/user/axios-src.log b/tests/baselines/reference/user/axios-src.log index acfb88abfe19f..4330c60d30f13 100644 --- a/tests/baselines/reference/user/axios-src.log +++ b/tests/baselines/reference/user/axios-src.log @@ -10,12 +10,12 @@ lib/adapters/http.js(231,44): error TS2345: Argument of type 'null' is not assig lib/adapters/http.js(237,13): error TS2322: Type 'string' is not assignable to type 'Buffer'. lib/adapters/http.js(249,40): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'. lib/adapters/http.js(278,42): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'. -lib/adapters/xhr.js(64,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. -lib/adapters/xhr.js(76,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. -lib/adapters/xhr.js(83,51): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'. -lib/adapters/xhr.js(86,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. -lib/adapters/xhr.js(99,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. -lib/adapters/xhr.js(169,9): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. +lib/adapters/xhr.js(72,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. +lib/adapters/xhr.js(84,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. +lib/adapters/xhr.js(91,51): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'. +lib/adapters/xhr.js(94,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. +lib/adapters/xhr.js(107,7): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. +lib/adapters/xhr.js(175,9): error TS2322: Type 'null' is not assignable to type 'XMLHttpRequest'. lib/axios.js(23,9): error TS2554: Expected 3 arguments, but got 2. lib/axios.js(25,3): error TS2739: Type '(...args: any[]) => any' is missing the following properties from type 'Axios': defaults, interceptors, request, getUri lib/axios.js(32,7): error TS2339: Property 'Axios' does not exist on type 'Axios'. @@ -44,7 +44,7 @@ lib/core/enhanceError.js(34,26): error TS2339: Property 'columnNumber' does not lib/core/enhanceError.js(37,20): error TS2339: Property 'config' does not exist on type 'Error'. lib/core/enhanceError.js(38,18): error TS2339: Property 'code' does not exist on type 'Error'. lib/core/settle.js(20,7): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'. -lib/helpers/buildURL.js(23,49): error TS1016: A required parameter cannot follow an optional parameter. +lib/helpers/buildURL.js(22,49): error TS1016: A required parameter cannot follow an optional parameter. lib/helpers/cookies.js(16,56): error TS2551: Property 'toGMTString' does not exist on type 'Date'. Did you mean 'toUTCString'? lib/utils.js(258,20): error TS8029: JSDoc '@param' tag has name 'obj1', but there is no parameter with that name. It would match 'arguments' if it had an array type. lib/utils.js(282,20): error TS8029: JSDoc '@param' tag has name 'obj1', but there is no parameter with that name. It would match 'arguments' if it had an array type. diff --git a/tests/baselines/reference/user/bluebird.log b/tests/baselines/reference/user/bluebird.log index 6202553fb08d8..76a5a834bc8a1 100644 --- a/tests/baselines/reference/user/bluebird.log +++ b/tests/baselines/reference/user/bluebird.log @@ -5,10 +5,10 @@ node_modules/bluebird/js/release/bluebird.js(5,15): error TS2367: This condition node_modules/bluebird/js/release/bluebird.js(10,10): error TS2339: Property 'noConflict' does not exist on type 'typeof Promise'. node_modules/bluebird/js/release/debuggability.js(225,17): error TS2403: Subsequent variable declarations must have the same type. Variable 'event' must be of type 'CustomEvent', but here has type 'Event'. node_modules/bluebird/js/release/debuggability.js(232,26): error TS2339: Property 'detail' does not exist on type 'Event'. -node_modules/bluebird/js/release/debuggability.js(258,48): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '["multipleResolves", MultipleResolveListener]'. +node_modules/bluebird/js/release/debuggability.js(258,48): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[event: "multipleResolves", listener: MultipleResolveListener]'. node_modules/bluebird/js/release/debuggability.js(301,9): error TS2322: Type 'Process' is not assignable to type 'boolean'. -node_modules/bluebird/js/release/debuggability.js(301,28): error TS2684: The 'this' context of type '((...args: any[]) => Process) | ((name: any, ...args: any[]) => boolean)' is not assignable to method's 'this' of type '(this: null, name?: any, ...args: any[]) => Process'. - Type '(name: any, ...args: any[]) => boolean' is not assignable to type '(this: null, name?: any, ...args: any[]) => Process'. +node_modules/bluebird/js/release/debuggability.js(301,28): error TS2684: The 'this' context of type '((...args: any[]) => Process) | ((name: any, ...args: any[]) => boolean)' is not assignable to method's 'this' of type '(this: null, args_0?: any, ...args_1: any[]) => Process'. + Type '(name: any, ...args: any[]) => boolean' is not assignable to type '(this: null, args_0?: any, ...args_1: any[]) => Process'. Type 'boolean' is not assignable to type 'Process'. node_modules/bluebird/js/release/debuggability.js(562,19): error TS2350: Only a void function can be called with the 'new' keyword. node_modules/bluebird/js/release/debuggability.js(633,59): error TS2554: Expected 0 arguments, but got 1. diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 13e71352bb460..480b41a4df057 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -1,7 +1,7 @@ Exit Code: 1 Standard output: ../../../../built/local/lib.es5.d.ts(1433,11): error TS2300: Duplicate identifier 'ArrayLike'. -../../../../node_modules/@types/node/globals.d.ts(168,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{}', but here has type 'NodeModule'. +../../../../node_modules/@types/node/globals.d.ts(167,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{}', but here has type 'NodeModule'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(43,8): error TS2339: Property '_importScriptPathPrefix' does not exist on type 'Window & typeof globalThis'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(77,16): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/Runtime.js(78,16): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. @@ -12,7 +12,7 @@ node_modules/chrome-devtools-frontend/front_end/Runtime.js(270,9): error TS2322: node_modules/chrome-devtools-frontend/front_end/Runtime.js(280,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(283,12): error TS2554: Expected 2-3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/Runtime.js(525,9): error TS2322: Type 'Window' is not assignable to type 'Window & typeof globalThis'. - Type 'Window' is missing the following properties from type 'typeof globalThis': globalThis, eval, parseInt, parseFloat, and 871 more. + Type 'Window' is missing the following properties from type 'typeof globalThis': globalThis, eval, parseInt, parseFloat, and 872 more. node_modules/chrome-devtools-frontend/front_end/Runtime.js(527,49): error TS2352: Conversion of type 'Window & typeof globalThis' to type 'new () => any' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Type 'Window & typeof globalThis' provides no match for the signature 'new (): any'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(539,24): error TS2351: This expression is not constructable. @@ -138,8 +138,8 @@ node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane. node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(314,15): error TS1110: Type expected. node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(323,23): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(330,27): error TS2339: Property 'createChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(391,50): error TS2345: Argument of type '0' is not assignable to parameter of type 'string'. -node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(393,50): error TS2345: Argument of type '-1' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(391,50): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(393,50): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(396,27): error TS2339: Property 'focus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(447,26): error TS2339: Property 'breadcrumb' does not exist on type 'ChildNode'. node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(457,30): error TS2339: Property 'breadcrumb' does not exist on type 'ChildNode'. @@ -592,7 +592,7 @@ node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/deta node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(327,17): error TS2300: Duplicate identifier 'NodeDetailsJSON'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(355,17): error TS2300: Duplicate identifier 'NodeDetailsJSON'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/dom.js(63,67): error TS2339: Property 'querySelector' does not exist on type 'Node'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/dom.js(76,43): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/dom.js(76,43): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/dom.js(156,28): error TS2339: Property 'querySelector' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/dom.js(170,31): error TS2339: Property 'querySelectorAll' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/dom.js(177,8): error TS2339: Property 'DOM' does not exist on type 'Window & typeof globalThis'. @@ -622,11 +622,11 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(51,25): error TS2339: Property 'runLighthouseInWorker' does not exist on type 'Window & typeof globalThis'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(52,27): error TS2503: Cannot find namespace 'ReportRenderer'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(113,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(128,1): error TS2739: Type 'Window & typeof globalThis' is missing the following properties from type 'Global': Buffer, GLOBAL, String, root, gc -node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(129,8): error TS2339: Property 'isVinn' does not exist on type 'Global'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(130,8): error TS2339: Property 'document' does not exist on type 'Global'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(131,8): error TS2339: Property 'document' does not exist on type 'Global'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(132,8): error TS2339: Property 'document' does not exist on type 'Global'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(128,1): error TS2322: Type 'Window & typeof globalThis' is not assignable to type 'Global & typeof globalThis'. + Type 'Window & typeof globalThis' is missing the following properties from type 'Global': Buffer, String, gc +node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(129,8): error TS2339: Property 'isVinn' does not exist on type 'Global & typeof globalThis'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(131,17): error TS2540: Cannot assign to 'documentElement' because it is a read-only property. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(132,33): error TS2540: Cannot assign to 'style' because it is a read-only property. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(2,1): error TS2739: Type '(o: any, u: any) => any' is missing the following properties from type 'NodeRequire': resolve, cache, extensions, main node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(2,125): error TS2554: Expected 1 arguments, but got 2. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(2,145): error TS2554: Expected 1 arguments, but got 2. @@ -666,9 +666,9 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15695,1): error TS2304: Cannot find name 'fs'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15695,78): error TS2769: No overload matches this call. Overload 1 of 2, '(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string', gave the following error. - Argument of type '0' is not assignable to parameter of type '(this: any, key: string, value: any) => any'. + Argument of type 'number' is not assignable to parameter of type '(this: any, key: string, value: any) => any'. Overload 2 of 2, '(value: any, replacer?: (string | number)[], space?: string | number): string', gave the following error. - Argument of type '0' is not assignable to parameter of type '(string | number)[]'. + Argument of type 'number' is not assignable to parameter of type '(string | number)[]'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15791,19): error TS2304: Cannot find name 'fs'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15810,1): error TS2304: Cannot find name 'fs'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(15814,1): error TS2304: Cannot find name 'fs'. @@ -4864,13 +4864,13 @@ node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(1292,3 node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(1293,28): error TS2339: Property '__originalDOMTokenListToggle' does not exist on type 'DOMTokenList'. node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(1302,19): error TS2339: Property '__originalDOMTokenListToggle' does not exist on type 'DOMTokenList'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,116): error TS2739: Type 'string[]' is missing the following properties from type '{ chars1: string; chars2: string; lineArray: string[]; }': chars1, chars2, lineArray -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,240): error TS2322: Type '0' is not assignable to type '{ chars1: string; chars2: string; lineArray: string[]; }'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,240): error TS2322: Type 'number' is not assignable to type '{ chars1: string; chars2: string; lineArray: string[]; }'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,321): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,352): error TS2365: Operator '<=' cannot be applied to types 'number' and '{ chars1: string; chars2: string; lineArray: string[]; }'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,375): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,379): error TS2365: Operator '+' cannot be applied to types '{ chars1: string; chars2: string; lineArray: string[]; }' and 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,388): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,476): error TS2322: Type '0' is not assignable to type '{ chars1: string; chars2: string; lineArray: string[]; }'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,476): error TS2322: Type 'number' is not assignable to type '{ chars1: string; chars2: string; lineArray: string[]; }'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(13,201): error TS2403: Subsequent variable declarations must have the same type. Variable 'd' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(15,142): error TS2403: Subsequent variable declarations must have the same type. Variable 'd' must be of type 'any', but here has type 'any[]'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(17,82): error TS2339: Property 'length' does not exist on type 'boolean'. @@ -4882,8 +4882,8 @@ node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(17,351) node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(19,282): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type 'number', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(21,314): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(23,258): error TS2322: Type 'boolean' is not assignable to type 'number'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(23,494): error TS2322: Type 'true' is not assignable to type 'number'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(24,123): error TS2322: Type 'true' is not assignable to type 'number'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(23,494): error TS2322: Type 'boolean' is not assignable to type 'number'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(24,123): error TS2322: Type 'boolean' is not assignable to type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(30,429): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(34,12): error TS2339: Property 'length' does not exist on type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(34,41): error TS2339: Property 'length' does not exist on type 'number'. @@ -7791,7 +7791,7 @@ node_modules/chrome-devtools-frontend/front_end/perf_ui/OverviewGrid.js(450,28): node_modules/chrome-devtools-frontend/front_end/perf_ui/OverviewGrid.js(452,28): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/perf_ui/OverviewGrid.js(453,28): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/perf_ui/PieChart.js(43,33): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'. -node_modules/chrome-devtools-frontend/front_end/perf_ui/PieChart.js(49,30): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/perf_ui/PieChart.js(49,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/perf_ui/PieChart.js(52,41): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/perf_ui/PieChart.js(54,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/perf_ui/PieChart.js(57,41): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. @@ -10492,7 +10492,7 @@ node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(149,10 node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(150,10): error TS2339: Property 'href' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(151,10): error TS2339: Property 'click' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/source_frame/JSONView.js(63,42): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/source_frame/JSONView.js(66,47): error TS2345: Argument of type '0' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/source_frame/JSONView.js(66,47): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/source_frame/JSONView.js(165,28): error TS2339: Property 'setSearchRegex' does not exist on type 'TreeElement'. node_modules/chrome-devtools-frontend/front_end/source_frame/JSONView.js(170,23): error TS2339: Property 'setSearchRegex' does not exist on type 'TreeElement'. node_modules/chrome-devtools-frontend/front_end/source_frame/PreviewFactory.js(14,40): error TS2555: Expected at least 2 arguments, but got 1. @@ -10558,7 +10558,7 @@ node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.j node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(878,71): error TS2367: This condition will always return 'true' since the types 'void' and 'string' have no overlap. node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(882,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(39,42): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(42,53): error TS2345: Argument of type '0' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(42,53): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(54,59): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SupportedType'. node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(73,28): error TS2339: Property 'setSearchRegex' does not exist on type 'TreeElement'. node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(80,23): error TS2339: Property 'setSearchRegex' does not exist on type 'TreeElement'. @@ -10579,7 +10579,7 @@ node_modules/chrome-devtools-frontend/front_end/sources/AddSourceMapURLDialog.js node_modules/chrome-devtools-frontend/front_end/sources/AdvancedSearchView.js(17,52): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/AdvancedSearchView.js(21,54): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/AdvancedSearchView.js(26,39): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/AdvancedSearchView.js(30,39): error TS2345: Argument of type '42' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/sources/AdvancedSearchView.js(30,39): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/sources/AdvancedSearchView.js(41,60): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/AdvancedSearchView.js(47,55): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/AdvancedSearchView.js(53,54): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -12599,7 +12599,7 @@ node_modules/chrome-devtools-frontend/front_end/ui/ResizerWidget.js(58,20): erro node_modules/chrome-devtools-frontend/front_end/ui/ResizerWidget.js(60,13): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/ResizerWidget.js(72,15): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/ResizerWidget.js(74,15): error TS2339: Property 'style' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/RootView.js(13,45): error TS2345: Argument of type 'false' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/ui/RootView.js(13,45): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/ui/RootView.js(34,20): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/RootView.js(36,20): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(49,25): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -13107,7 +13107,7 @@ node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1943,50): error TS node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1961,12): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1966,23): error TS2339: Property 'type' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1967,23): error TS2339: Property 'style' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1968,48): error TS2345: Argument of type '-1' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1968,48): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1969,23): error TS2339: Property 'onchange' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1971,34): error TS2339: Property 'files' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1993,30): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'. @@ -13235,12 +13235,12 @@ node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(141,45): error TS2 node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(146,24): error TS2339: Property 'traverseNextNode' does not exist on type 'XWidget'. node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(156,29): error TS2339: Property 'hasFocus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(161,15): error TS2339: Property 'focus' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(49,52): error TS2345: Argument of type '-1' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(49,52): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(61,23): error TS2339: Property 'root' does not exist on type 'TreeElement'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(123,50): error TS2339: Property 'deepElementFromPoint' does not exist on type 'Document'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(138,52): error TS2339: Property 'pageX' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(138,65): error TS2339: Property 'pageY' does not exist on type 'Event'. -node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(154,52): error TS2345: Argument of type '-1' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(154,52): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(167,48): error TS2339: Property 'focus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(169,27): error TS2339: Property 'focus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(257,105): error TS2339: Property 'shiftKey' does not exist on type 'Event'. @@ -13289,7 +13289,7 @@ node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(945,7): error 'TreeElement' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'TreeElement'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(1063,55): error TS2339: Property 'hasFocus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(1064,28): error TS2339: Property 'focus' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(1078,51): error TS2345: Argument of type '0' is not assignable to parameter of type 'string'. +node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(1078,51): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(1105,39): error TS2339: Property 'hasFocus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(1209,32): error TS2339: Property 'root' does not exist on type 'TreeElement'. node_modules/chrome-devtools-frontend/front_end/ui/treeoutline.js(1217,29): error TS2339: Property 'root' does not exist on type 'TreeElement'. diff --git a/tests/baselines/reference/user/debug.log b/tests/baselines/reference/user/debug.log index c54b72c5b6730..81d34562456d0 100644 --- a/tests/baselines/reference/user/debug.log +++ b/tests/baselines/reference/user/debug.log @@ -39,7 +39,7 @@ node_modules/debug/dist/debug.js(733,82): error TS2339: Property 'type' does not node_modules/debug/dist/debug.js(733,120): error TS2339: Property '__nwjs' does not exist on type 'Process'. node_modules/debug/dist/debug.js(744,146): error TS2551: Property 'WebkitAppearance' does not exist on type 'CSSStyleDeclaration'. Did you mean 'webkitAppearance'? node_modules/debug/dist/debug.js(745,78): error TS2339: Property 'firebug' does not exist on type 'Console'. -node_modules/debug/dist/debug.js(799,156): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. +node_modules/debug/dist/debug.js(799,156): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[message?: any, ...optionalParams: any[]]'. node_modules/debug/dist/debug.js(851,21): error TS2304: Cannot find name 'LocalStorage'. node_modules/debug/src/browser.js(3,100): error TS2539: Cannot assign to '_typeof' because it is not a variable. node_modules/debug/src/browser.js(3,165): error TS2539: Cannot assign to '_typeof' because it is not a variable. @@ -47,7 +47,7 @@ node_modules/debug/src/browser.js(34,74): error TS2339: Property 'type' does not node_modules/debug/src/browser.js(34,112): error TS2339: Property '__nwjs' does not exist on type 'Process'. node_modules/debug/src/browser.js(45,138): error TS2551: Property 'WebkitAppearance' does not exist on type 'CSSStyleDeclaration'. Did you mean 'webkitAppearance'? node_modules/debug/src/browser.js(46,70): error TS2339: Property 'firebug' does not exist on type 'Console'. -node_modules/debug/src/browser.js(100,148): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. +node_modules/debug/src/browser.js(100,148): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[message?: any, ...optionalParams: any[]]'. node_modules/debug/src/browser.js(152,13): error TS2304: Cannot find name 'LocalStorage'. node_modules/debug/src/common.js(51,24): error TS2339: Property 'colors' does not exist on type '{ (namespace: string): Function; debug: ...; default: ...; coerce: (val: any) => any; disable: () => void; enable: (namespaces: string) => void; enabled: (name: string) => boolean; humanize: { ...; }; ... 4 more ...; selectColor: (namespace: string) => string | number; }'. node_modules/debug/src/common.js(51,60): error TS2339: Property 'colors' does not exist on type '{ (namespace: string): Function; debug: ...; default: ...; coerce: (val: any) => any; disable: () => void; enable: (namespaces: string) => void; enabled: (name: string) => boolean; humanize: { ...; }; ... 4 more ...; selectColor: (namespace: string) => string | number; }'. @@ -77,7 +77,7 @@ node_modules/debug/src/node.js(56,5): error TS2322: Type 'false' is not assignab node_modules/debug/src/node.js(58,5): error TS2322: Type 'null' is not assignable to type 'string | undefined'. node_modules/debug/src/node.js(60,5): error TS2322: Type 'number' is not assignable to type 'string | undefined'. node_modules/debug/src/node.js(71,108): error TS2339: Property 'fd' does not exist on type 'WriteStream'. -node_modules/debug/src/node.js(108,55): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any, ...any[]]'. +node_modules/debug/src/node.js(108,55): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[format: any, ...param: any[]]'. node_modules/debug/src/node.js(136,3): error TS2322: Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. diff --git a/tests/baselines/reference/user/graceful-fs.log b/tests/baselines/reference/user/graceful-fs.log index 2e5e2bc2377b3..df34f0ff9b7bd 100644 --- a/tests/baselines/reference/user/graceful-fs.log +++ b/tests/baselines/reference/user/graceful-fs.log @@ -5,9 +5,9 @@ node_modules/graceful-fs/clone.js(15,38): error TS2345: Argument of type 'Proper Type 'undefined' is not assignable to type 'PropertyDescriptor & ThisType'. Type 'undefined' is not assignable to type 'PropertyDescriptor'. node_modules/graceful-fs/graceful-fs.js(34,3): error TS2322: Type '(msg: string, ...param: any[]) => void' is not assignable to type '() => void'. -node_modules/graceful-fs/graceful-fs.js(37,37): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any, ...any[]]'. +node_modules/graceful-fs/graceful-fs.js(37,37): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[format: any, ...param: any[]]'. node_modules/graceful-fs/graceful-fs.js(52,3): error TS2741: Property '__promisify__' is missing in type '(fd: any, cb: any) => void' but required in type 'typeof close'. -node_modules/graceful-fs/graceful-fs.js(74,30): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[number]'. +node_modules/graceful-fs/graceful-fs.js(74,30): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[fd: number]'. node_modules/graceful-fs/graceful-fs.js(86,13): error TS2554: Expected 0 arguments, but got 1. node_modules/graceful-fs/graceful-fs.js(97,54): error TS2339: Property '__patched' does not exist on type 'typeof import("fs")'. node_modules/graceful-fs/graceful-fs.js(99,8): error TS2339: Property '__patched' does not exist on type 'typeof import("fs")'. diff --git a/tests/baselines/reference/user/lodash.log b/tests/baselines/reference/user/lodash.log index ccfcf551bfe4a..042d8b0fdf211 100644 --- a/tests/baselines/reference/user/lodash.log +++ b/tests/baselines/reference/user/lodash.log @@ -154,8 +154,8 @@ node_modules/lodash/_createWrap.js(96,26): error TS2345: Argument of type 'Timer node_modules/lodash/_createWrap.js(97,100): error TS2532: Object is possibly 'undefined'. node_modules/lodash/_createWrap.js(98,28): error TS2345: Argument of type 'TimerHandler' is not assignable to parameter of type 'Function'. Type 'string' is not assignable to type 'Function'. -node_modules/lodash/_createWrap.js(100,44): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[TimerHandler, number, any?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (number | undefined)?, (number | undefined)?]'. - Type 'any[]' is missing the following properties from type '[TimerHandler, number, any?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (number | undefined)?, (number | undefined)?]': 0, 1 +node_modules/lodash/_createWrap.js(100,44): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[func: TimerHandler, bitmask: number, thisArg?: any, partials?: any[] | undefined, holders?: any[] | undefined, partialsRight?: any[] | undefined, holdersRight?: any[] | undefined, argPos?: any[] | undefined, ary?: number | undefined, arity?: number | undefined]'. + Type 'any[]' is missing the following properties from type '[func: TimerHandler, bitmask: number, thisArg?: any, partials?: any[] | undefined, holders?: any[] | undefined, partialsRight?: any[] | undefined, holdersRight?: any[] | undefined, argPos?: any[] | undefined, ary?: number | undefined, arity?: number | undefined]': 0, 1 node_modules/lodash/_createWrap.js(103,51): error TS2345: Argument of type 'TimerHandler' is not assignable to parameter of type 'Function'. Type 'string' is not assignable to type 'Function'. node_modules/lodash/_customDefaultsMerge.js(22,35): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'number'. @@ -179,7 +179,7 @@ node_modules/lodash/_memoizeCapped.js(22,22): error TS2339: Property 'cache' doe node_modules/lodash/_mergeData.js(60,26): error TS2554: Expected 4 arguments, but got 3. node_modules/lodash/_mergeData.js(67,26): error TS2554: Expected 4 arguments, but got 3. node_modules/lodash/_nodeUtil.js(7,80): error TS2339: Property 'nodeType' does not exist on type '{ "\"../../../tests/cases/user/lodash/node_modules/lodash/_nodeUtil\"": any; }'. -node_modules/lodash/_nodeUtil.js(13,47): error TS2339: Property 'process' does not exist on type 'false | Global'. +node_modules/lodash/_nodeUtil.js(13,47): error TS2339: Property 'process' does not exist on type 'false | (Global & typeof globalThis)'. Property 'process' does not exist on type 'false'. node_modules/lodash/_overRest.js(15,32): error TS1016: A required parameter cannot follow an optional parameter. node_modules/lodash/_overRest.js(20,42): error TS2532: Object is possibly 'undefined'. diff --git a/tests/baselines/reference/user/npm.log b/tests/baselines/reference/user/npm.log index 85bbcfa4f142e..03e5111d4d2c1 100644 --- a/tests/baselines/reference/user/npm.log +++ b/tests/baselines/reference/user/npm.log @@ -29,7 +29,7 @@ node_modules/npm/bin/npm-cli.js(128,13): error TS2339: Property 'command' does n node_modules/npm/bin/npm-cli.js(132,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/bin/npm-cli.js(134,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/bin/npm-cli.js(136,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/bin/npm-cli.js(140,32): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?]'. +node_modules/npm/bin/npm-cli.js(140,32): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[er?: any]'. node_modules/npm/html/static/toc.js(3,40): error TS2531: Object is possibly 'null'. node_modules/npm/lib/access.js(58,46): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/access.js(65,18): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. @@ -59,9 +59,9 @@ node_modules/npm/lib/auth/legacy.js(12,30): error TS2339: Property 'config' does node_modules/npm/lib/auth/legacy.js(35,16): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/legacy.js(69,33): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/oauth.js(5,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/auth/oauth.js(6,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, any?, any?]'. +node_modules/npm/lib/auth/oauth.js(6,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[creds?: any, registry?: any, scope?: any, cb?: any]'. node_modules/npm/lib/auth/saml.js(5,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/auth/saml.js(6,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, any?, any?]'. +node_modules/npm/lib/auth/saml.js(6,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[creds?: any, registry?: any, scope?: any, cb?: any]'. node_modules/npm/lib/auth/sso.js(7,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/sso.js(20,7): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/sso.js(28,36): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -184,8 +184,9 @@ node_modules/npm/lib/config/core.js(409,29): error TS2769: No overload matches t Argument of type '(orig: string, esc: any, name: any) => string | undefined' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. -node_modules/npm/lib/config/defaults.js(20,52): error TS2345: Argument of type 'never[]' is not assignable to parameter of type '[any, ...any[]]'. - Property '0' is missing in type 'never[]' but required in type '[any, ...any[]]'. +node_modules/npm/lib/config/defaults.js(20,52): error TS2345: Argument of type 'never[]' is not assignable to parameter of type '[format: any, ...param: any[]]'. + Property '0' is missing in type 'never[]' but required in type '[format: any, ...param: any[]]'. +node_modules/npm/lib/config/defaults.js(240,36): error TS2554: Expected 1 arguments, but got 0. node_modules/npm/lib/config/gentle-fs.js(16,11): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/gentle-fs.js(17,11): error TS2339: Property 'globalPrefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/gentle-fs.js(18,11): error TS2339: Property 'dir' does not exist on type 'typeof EventEmitter'. @@ -338,10 +339,10 @@ node_modules/npm/lib/help.js(48,16): error TS2339: Property 'commands' does not node_modules/npm/lib/help.js(77,34): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/help.js(118,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/help.js(130,43): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/help.js(146,7): error TS2322: Type '"cli"' is not assignable to type 'number'. -node_modules/npm/lib/help.js(149,7): error TS2322: Type '"api"' is not assignable to type 'number'. -node_modules/npm/lib/help.js(152,7): error TS2322: Type '"files"' is not assignable to type 'number'. -node_modules/npm/lib/help.js(155,7): error TS2322: Type '"misc"' is not assignable to type 'number'. +node_modules/npm/lib/help.js(146,7): error TS2322: Type 'string' is not assignable to type 'number'. +node_modules/npm/lib/help.js(149,7): error TS2322: Type 'string' is not assignable to type 'number'. +node_modules/npm/lib/help.js(152,7): error TS2322: Type 'string' is not assignable to type 'number'. +node_modules/npm/lib/help.js(155,7): error TS2322: Type 'string' is not assignable to type 'number'. node_modules/npm/lib/help.js(160,55): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/npm/lib/help.js(164,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/help.js(170,9): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -379,8 +380,8 @@ node_modules/npm/lib/install.js(268,26): error TS2339: Property 'config' does no node_modules/npm/lib/install.js(269,9): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install.js(272,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install.js(273,7): error TS2532: Object is possibly 'undefined'. -node_modules/npm/lib/install.js(273,7): error TS2684: The 'this' context of type '((err: any, ...args: any[]) => any) | undefined' is not assignable to method's 'this' of type '(this: null, err?: any, ...args: any[]) => any'. - Type 'undefined' is not assignable to type '(this: null, err?: any, ...args: any[]) => any'. +node_modules/npm/lib/install.js(273,7): error TS2684: The 'this' context of type '((err: any, ...args: any[]) => any) | undefined' is not assignable to method's 'this' of type '(this: null, args_0?: any, ...args_1: any[]) => any'. + Type 'undefined' is not assignable to type '(this: null, args_0?: any, ...args_1: any[]) => any'. node_modules/npm/lib/install.js(340,25): error TS2339: Property 'failing' does not exist on type 'Installer'. node_modules/npm/lib/install.js(369,18): error TS2769: No overload matches this call. The last overload gave the following error. @@ -564,9 +565,6 @@ node_modules/npm/lib/ls.js(538,12): error TS2339: Property 'config' does not exi node_modules/npm/lib/ls.js(544,56): error TS2339: Property 'globalDir' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/npm.js(5,13): error TS2551: Property 'echo' does not exist on type '{ Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; ... 13 more ...; Sleep(intTime: number): void; }'. Did you mean 'Echo'? node_modules/npm/lib/npm.js(12,13): error TS2551: Property 'quit' does not exist on type '{ Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; ... 13 more ...; Sleep(intTime: number): void; }'. Did you mean 'Quit'? -node_modules/npm/lib/npm.js(30,14): error TS2769: No overload matches this call. - The last overload gave the following error. - Argument of type '"log"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/npm.js(58,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/npm.js(68,7): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/npm.js(71,7): error TS2339: Property 'limit' does not exist on type 'typeof EventEmitter'. @@ -586,7 +584,7 @@ node_modules/npm/lib/npm.js(208,7): error TS2339: Property 'load' does not exist node_modules/npm/lib/npm.js(225,15): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/npm.js(228,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/npm.js(231,30): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/npm.js(234,19): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +node_modules/npm/lib/npm.js(234,19): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. node_modules/npm/lib/npm.js(253,17): error TS2339: Property 'installPrefix' does not exist on type 'Process'. node_modules/npm/lib/npm.js(347,52): error TS2345: Argument of type 'PropertyDescriptor | undefined' is not assignable to parameter of type 'PropertyDescriptor & ThisType'. Type 'undefined' is not assignable to type 'PropertyDescriptor & ThisType'. @@ -843,9 +841,6 @@ node_modules/npm/lib/utils/correct-mkdir.js(103,20): error TS2345: Argument of t node_modules/npm/lib/utils/error-handler.js(12,21): error TS2339: Property 'rollbacks' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/error-handler.js(23,36): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/error-handler.js(29,16): error TS2339: Property 'version' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/utils/error-handler.js(33,12): error TS2769: No overload matches this call. - The last overload gave the following error. - Argument of type '"timing"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/utils/error-handler.js(38,16): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. @@ -901,13 +896,7 @@ node_modules/npm/lib/utils/metrics.js(61,31): error TS2345: Argument of type 'Bu node_modules/npm/lib/utils/metrics.js(62,7): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/metrics.js(64,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/metrics.js(65,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/utils/output.js(6,30): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. -node_modules/npm/lib/utils/perf.js(9,12): error TS2769: No overload matches this call. - The last overload gave the following error. - Argument of type '"time"' is not assignable to parameter of type 'Signals'. -node_modules/npm/lib/utils/perf.js(10,12): error TS2769: No overload matches this call. - The last overload gave the following error. - Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/utils/output.js(6,30): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[message?: any, ...optionalParams: any[]]'. node_modules/npm/lib/utils/read-local-package.js(7,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/read-local-package.js(9,29): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/spawn.js(26,8): error TS2339: Property 'file' does not exist on type 'Error'. @@ -983,10 +972,11 @@ node_modules/npm/test/broken-under-nyc-and-travis/lifecycle-path.js(18,23): erro node_modules/npm/test/broken-under-nyc-and-travis/whoami.js(7,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. node_modules/npm/test/common-tap.js(5,47): error TS2339: Property '_extend' does not exist on type 'typeof import("util")'. node_modules/npm/test/common-tap.js(10,3): error TS2741: Property '__promisify__' is missing in type '(...args: any[]) => void' but required in type 'typeof setImmediate'. -node_modules/npm/test/common-tap.js(10,36): error TS2322: Type '(...args: any[]) => void' is not assignable to type '(callback: (...args: any[]) => void, ...args: any[]) => Immediate'. - Type 'void' is not assignable to type 'Immediate'. -node_modules/npm/test/common-tap.js(12,28): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[(...args: any[]) => void, number, ...any[]]'. - Type 'any[]' is missing the following properties from type '[(...args: any[]) => void, number, ...any[]]': 0, 1 +node_modules/npm/test/common-tap.js(10,36): error TS2322: Type '(...args: any[]) => void' is not assignable to type '((callback: (...args: any[]) => void, ...args: any[]) => Immediate) & typeof setImmediate'. + Type '(...args: any[]) => void' is not assignable to type '(callback: (...args: any[]) => void, ...args: any[]) => Immediate'. + Type 'void' is not assignable to type 'Immediate'. +node_modules/npm/test/common-tap.js(12,28): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[callback: (...args: any[]) => void, ms: number, ...args: any[]]'. + Type 'any[]' is missing the following properties from type '[callback: (...args: any[]) => void, ms: number, ...args: any[]]': 0, 1 node_modules/npm/test/common-tap.js(175,17): error TS2339: Property '_storage' does not exist on type 'Environment'. node_modules/npm/test/common-tap.js(181,31): error TS2339: Property '_storage' does not exist on type 'Environment'. node_modules/npm/test/common-tap.js(192,12): error TS2339: Property '_storage' does not exist on type 'Environment'. @@ -1628,6 +1618,8 @@ node_modules/npm/test/tap/publish-access-unscoped.js(31,35): error TS2345: Argum node_modules/npm/test/tap/publish-config.js(4,22): error TS2307: Cannot find module 'tap' or its corresponding type declarations. node_modules/npm/test/tap/publish-invalid-semver-tag.js(2,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. node_modules/npm/test/tap/publish-invalid-semver-tag.js(8,18): error TS2307: Cannot find module 'npm-registry-mock' or its corresponding type declarations. +node_modules/npm/test/tap/publish-invalid-semver-tag.js(26,59): error TS2345: Argument of type '{ name: string; version: string; }' is not assignable to parameter of type 'string | DataView | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array'. + Type '{ name: string; version: string; }' is missing the following properties from type 'Float64Array': BYTES_PER_ELEMENT, buffer, byteLength, byteOffset, and 26 more. node_modules/npm/test/tap/publish-invalid-semver-tag.js(37,9): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'. node_modules/npm/test/tap/publish-invalid-semver-tag.js(53,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/test/tap/publish-invalid-semver-tag.js(54,7): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. @@ -1750,7 +1742,7 @@ node_modules/npm/test/tap/shrinkwrap-version-match.js(3,21): error TS2307: Canno node_modules/npm/test/tap/sorted-package-json.js(1,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. node_modules/npm/test/tap/sorted-package-json.js(10,18): error TS2307: Cannot find module 'npm-registry-mock' or its corresponding type declarations. node_modules/npm/test/tap/spawn-enoent-help.js(2,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. -node_modules/npm/test/tap/spawn-enoent-help.js(28,20): error TS2339: Property 'cooked' does not exist on type 'Global'. +node_modules/npm/test/tap/spawn-enoent-help.js(28,20): error TS2339: Property 'cooked' does not exist on type 'Global & typeof globalThis'. node_modules/npm/test/tap/spawn-enoent.js(2,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. node_modules/npm/test/tap/spec-local-specifiers.js(3,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. node_modules/npm/test/tap/spec-local-specifiers.js(6,18): error TS2307: Cannot find module 'npm-registry-mock' or its corresponding type declarations. @@ -1775,6 +1767,7 @@ node_modules/npm/test/tap/test-run-ls.js(2,20): error TS2307: Cannot find module node_modules/npm/test/tap/test-run-ls.js(5,26): error TS2732: Cannot find module '../../package.json'. Consider using '--resolveJsonModule' to import module with '.json' extension node_modules/npm/test/tap/tree-style.js(3,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. node_modules/npm/test/tap/umask-lifecycle.js(6,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. +node_modules/npm/test/tap/umask-lifecycle.js(24,21): error TS2554: Expected 1 arguments, but got 0. node_modules/npm/test/tap/uninstall-in-reverse.js(2,20): error TS2307: Cannot find module 'tap' or its corresponding type declarations. node_modules/npm/test/tap/uninstall-in-reverse.js(3,29): error TS2307: Cannot find module 'require-inject' or its corresponding type declarations. node_modules/npm/test/tap/uninstall-in-reverse.js(28,14): error TS2555: Expected at least 4 arguments, but got 3. diff --git a/tests/baselines/reference/user/npmlog.log b/tests/baselines/reference/user/npmlog.log index 6847693c1095c..483c60b1940e0 100644 --- a/tests/baselines/reference/user/npmlog.log +++ b/tests/baselines/reference/user/npmlog.log @@ -4,14 +4,14 @@ node_modules/npmlog/log.js(83,12): error TS2551: Property '_pause' does not exis node_modules/npmlog/log.js(149,8): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? node_modules/npmlog/log.js(154,13): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? node_modules/npmlog/log.js(155,8): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? -node_modules/npmlog/log.js(194,37): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[any, ...any[]]'. - Property '0' is missing in type 'any[]' but required in type '[any, ...any[]]'. +node_modules/npmlog/log.js(194,37): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[format: any, ...param: any[]]'. + Property '0' is missing in type 'any[]' but required in type '[format: any, ...param: any[]]'. node_modules/npmlog/log.js(218,12): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? node_modules/npmlog/log.js(271,16): error TS2769: No overload matches this call. Overload 1 of 2, '(buffer: string | Uint8Array, cb?: ((err?: Error | undefined) => void) | undefined): boolean', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | Uint8Array'. Type 'undefined' is not assignable to type 'string | Uint8Array'. - Overload 2 of 2, '(str: string | Uint8Array, encoding?: string | undefined, cb?: ((err?: Error | undefined) => void) | undefined): boolean', gave the following error. + Overload 2 of 2, '(str: string | Uint8Array, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined, cb?: ((err?: Error | undefined) => void) | undefined): boolean', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | Uint8Array'. Type 'undefined' is not assignable to type 'string | Uint8Array'. diff --git a/tests/baselines/reference/user/uglify-js.log b/tests/baselines/reference/user/uglify-js.log index 29c4a205694d6..4b1f361767ff7 100644 --- a/tests/baselines/reference/user/uglify-js.log +++ b/tests/baselines/reference/user/uglify-js.log @@ -1,122 +1,129 @@ Exit Code: 1 Standard output: node_modules/uglify-js/lib/ast.js(97,35): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/ast.js(220,38): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/ast.js(349,22): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/ast.js(368,22): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/ast.js(899,5): error TS2322: Type '{ _visit: (node: any, descend: any) => any; parent: (n: any) => any; push: typeof push; pop: typeof pop; self: () => any; find_parent: (type: any) => any; has_directive: (type: any) => any; loopcontrol_target: (node: any) => any; in_boolean_context: () => boolean | undefined; }' is not assignable to type 'TreeWalker'. - Object literal may only specify known properties, but '_visit' does not exist in type 'TreeWalker'. Did you mean to write 'visit'? -node_modules/uglify-js/lib/ast.js(900,14): error TS2339: Property 'push' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/ast.js(907,14): error TS2339: Property 'pop' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/ast.js(962,25): error TS2339: Property 'self' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/ast.js(963,37): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/ast.js(981,31): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/ast.js(985,29): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/ast.js(276,38): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/ast.js(443,22): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/ast.js(462,22): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/ast.js(596,69): error TS2552: Cannot find name 'error'. Did you mean 'Error'? +node_modules/uglify-js/lib/ast.js(1151,5): error TS2322: Type '{ visit: (node: any, descend: any) => void; parent: (n: any) => any; push: typeof push; pop: typeof pop; self: () => any; find_parent: (type: any) => any; has_directive: (type: any) => any; loopcontrol_target: (node: any) => any; in_boolean_context: () => boolean | undefined; }' is not assignable to type 'TreeWalker'. + Object literal may only specify known properties, and 'visit' does not exist in type 'TreeWalker'. +node_modules/uglify-js/lib/ast.js(1152,14): error TS2339: Property 'push' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/ast.js(1155,14): error TS2339: Property 'pop' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/ast.js(1209,25): error TS2339: Property 'self' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/ast.js(1210,37): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/ast.js(1228,31): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/ast.js(1232,29): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. node_modules/uglify-js/lib/compress.js(163,24): error TS2554: Expected 2 arguments, but got 0. node_modules/uglify-js/lib/compress.js(188,42): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/compress.js(248,18): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(533,41): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(874,33): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(879,12): error TS2339: Property 'defun_ids' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(880,12): error TS2339: Property 'defun_visited' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(882,12): error TS2339: Property 'in_loop' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(883,12): error TS2339: Property 'loop_ids' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(888,12): error TS2339: Property 'safe_ids' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(1150,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1165,51): error TS2349: This expression is not callable. +node_modules/uglify-js/lib/compress.js(549,41): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(725,40): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(927,33): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(932,12): error TS2339: Property 'assigns' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(934,12): error TS2339: Property 'defun_ids' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(935,12): error TS2339: Property 'defun_visited' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(937,12): error TS2339: Property 'in_loop' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(938,12): error TS2339: Property 'loop_ids' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(943,12): error TS2339: Property 'safe_ids' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(1209,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1224,51): error TS2349: This expression is not callable. Not all constituents of type 'true | ((node: any, tw: any) => any)' are callable. Type 'true' has no call signatures. -node_modules/uglify-js/lib/compress.js(1239,53): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1260,53): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1305,112): error TS2454: Variable 'args' is used before being assigned. -node_modules/uglify-js/lib/compress.js(1306,29): error TS2532: Object is possibly 'undefined'. -node_modules/uglify-js/lib/compress.js(1331,33): error TS2322: Type 'boolean' is not assignable to type 'number'. -node_modules/uglify-js/lib/compress.js(1333,29): error TS2322: Type 'false' is not assignable to type 'never'. -node_modules/uglify-js/lib/compress.js(1481,53): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(1597,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1621,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1636,46): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1667,39): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1699,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1715,39): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(1815,42): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(1846,41): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(1970,49): error TS2345: Argument of type 'number[]' is not assignable to parameter of type '[number, number, ...never[]]'. - Type 'number[]' is missing the following properties from type '[number, number, ...never[]]': 0, 1 -node_modules/uglify-js/lib/compress.js(2301,59): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(2339,53): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[number, number, ...never[]]'. - Type 'any[]' is missing the following properties from type '[number, number, ...never[]]': 0, 1 -node_modules/uglify-js/lib/compress.js(2374,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'any'. -node_modules/uglify-js/lib/compress.js(2530,39): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(2552,34): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(2997,35): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(3341,55): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -node_modules/uglify-js/lib/compress.js(3342,25): error TS2531: Object is possibly 'null'. -node_modules/uglify-js/lib/compress.js(3342,55): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -node_modules/uglify-js/lib/compress.js(3342,56): error TS2531: Object is possibly 'null'. -node_modules/uglify-js/lib/compress.js(3383,42): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(3462,33): error TS2532: Object is possibly 'undefined'. -node_modules/uglify-js/lib/compress.js(3875,38): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(3901,29): error TS2322: Type '"f"' is not assignable to type 'boolean'. -node_modules/uglify-js/lib/compress.js(4082,33): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(4083,74): error TS2339: Property 'has_directive' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(4135,29): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(4155,29): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(4263,63): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(4319,52): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'never[]'. +node_modules/uglify-js/lib/compress.js(1299,53): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1320,53): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1366,112): error TS2454: Variable 'args' is used before being assigned. +node_modules/uglify-js/lib/compress.js(1367,29): error TS2532: Object is possibly 'undefined'. +node_modules/uglify-js/lib/compress.js(1392,33): error TS2322: Type 'boolean' is not assignable to type 'number'. +node_modules/uglify-js/lib/compress.js(1394,29): error TS2322: Type 'boolean' is not assignable to type 'never'. +node_modules/uglify-js/lib/compress.js(1542,53): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(1658,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1682,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1697,46): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1728,39): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1760,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1776,39): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(1854,45): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(1874,42): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(1903,41): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(2033,49): error TS2345: Argument of type 'number[]' is not assignable to parameter of type '[start: number, deleteCount: number, ...items: never[]]'. + Type 'number[]' is missing the following properties from type '[start: number, deleteCount: number, ...items: never[]]': 0, 1 +node_modules/uglify-js/lib/compress.js(2366,59): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(2404,53): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[start: number, deleteCount: number, ...items: never[]]'. + Type 'any[]' is missing the following properties from type '[start: number, deleteCount: number, ...items: never[]]': 0, 1 +node_modules/uglify-js/lib/compress.js(2439,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'any'. +node_modules/uglify-js/lib/compress.js(2595,39): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(2618,34): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(3063,35): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(3258,44): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(3443,55): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +node_modules/uglify-js/lib/compress.js(3444,25): error TS2531: Object is possibly 'null'. +node_modules/uglify-js/lib/compress.js(3444,55): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +node_modules/uglify-js/lib/compress.js(3444,56): error TS2531: Object is possibly 'null'. +node_modules/uglify-js/lib/compress.js(3485,42): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(3563,48): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(3581,33): error TS2532: Object is possibly 'undefined'. +node_modules/uglify-js/lib/compress.js(3997,38): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4023,29): error TS2322: Type '"f"' is not assignable to type 'boolean'. +node_modules/uglify-js/lib/compress.js(4206,33): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4207,74): error TS2339: Property 'has_directive' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(4258,29): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4278,29): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(4387,63): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4443,52): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'never[]'. Type 'any' is not assignable to type 'never'. -node_modules/uglify-js/lib/compress.js(4419,12): error TS2339: Property 'push' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(4524,38): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(4538,18): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(4545,24): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(4555,28): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. -node_modules/uglify-js/lib/compress.js(4640,32): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(4757,24): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(4818,24): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(4879,17): error TS2447: The '|=' operator is not allowed for boolean types. Consider using '||' instead. -node_modules/uglify-js/lib/compress.js(4993,23): error TS2454: Variable 'exprs' is used before being assigned. -node_modules/uglify-js/lib/compress.js(4994,20): error TS2454: Variable 'exprs' is used before being assigned. -node_modules/uglify-js/lib/compress.js(5085,33): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(5087,55): error TS2339: Property 'loopcontrol_target' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(5091,56): error TS2339: Property 'push' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(5092,12): error TS2339: Property 'push' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(5177,21): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. -node_modules/uglify-js/lib/compress.js(5192,21): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. -node_modules/uglify-js/lib/compress.js(5302,33): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(5304,33): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(5469,17): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. -node_modules/uglify-js/lib/compress.js(5612,37): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(5672,21): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. -node_modules/uglify-js/lib/compress.js(5868,57): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[string | RegExp, (string | undefined)?]'. - Property '0' is missing in type 'any[]' but required in type '[string | RegExp, (string | undefined)?]'. -node_modules/uglify-js/lib/compress.js(6026,32): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(6032,45): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(6039,25): error TS2403: Subsequent variable declarations must have the same type. Variable 'code' must be of type 'string', but here has type '{ get: () => string; toString: () => string; indent: (half: any) => void; indentation: () => number; current_width: () => number; should_break: () => boolean; has_parens: () => boolean; newline: () => void; print: (str: any) => void; ... 23 more ...; parent: (n: any) => any; }'. -node_modules/uglify-js/lib/compress.js(6043,36): error TS2532: Object is possibly 'undefined'. -node_modules/uglify-js/lib/compress.js(6048,41): error TS2339: Property 'get' does not exist on type 'string'. -node_modules/uglify-js/lib/compress.js(6085,59): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(6197,39): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(6201,21): error TS2322: Type 'null' is not assignable to type 'any[]'. -node_modules/uglify-js/lib/compress.js(6208,25): error TS2322: Type 'null' is not assignable to type 'any[]'. -node_modules/uglify-js/lib/compress.js(6217,25): error TS2322: Type 'null' is not assignable to type 'any[]'. -node_modules/uglify-js/lib/compress.js(6229,32): error TS2532: Object is possibly 'undefined'. -node_modules/uglify-js/lib/compress.js(6233,27): error TS2532: Object is possibly 'undefined'. -node_modules/uglify-js/lib/compress.js(6452,38): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(6723,18): error TS2454: Variable 'is_strict_comparison' is used before being assigned. -node_modules/uglify-js/lib/compress.js(7347,29): error TS2367: This condition will always return 'false' since the types 'boolean' and 'string' have no overlap. -node_modules/uglify-js/lib/compress.js(7389,47): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(7470,39): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(7542,39): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(7548,41): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/compress.js(7551,41): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. -node_modules/uglify-js/lib/compress.js(8114,43): error TS2454: Variable 'property' is used before being assigned. -node_modules/uglify-js/lib/compress.js(8129,25): error TS2403: Subsequent variable declarations must have the same type. Variable 'value' must be of type 'number', but here has type 'any'. -node_modules/uglify-js/lib/compress.js(8132,46): error TS2339: Property 'has_side_effects' does not exist on type 'number'. -node_modules/uglify-js/lib/compress.js(8138,25): error TS2403: Subsequent variable declarations must have the same type. Variable 'value' must be of type 'number', but here has type 'any'. -node_modules/uglify-js/lib/compress.js(8171,34): error TS2554: Expected 0 arguments, but got 1. -node_modules/uglify-js/lib/minify.js(185,42): error TS2554: Expected 2 arguments, but got 1. -node_modules/uglify-js/lib/minify.js(185,75): error TS2339: Property 'compress' does not exist on type 'Compressor'. -node_modules/uglify-js/lib/mozilla-ast.js(566,33): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4544,12): error TS2339: Property 'push' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(4682,38): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4696,18): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4703,24): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(4713,28): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. +node_modules/uglify-js/lib/compress.js(4798,32): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4915,24): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4976,24): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(5041,17): error TS2447: The '|=' operator is not allowed for boolean types. Consider using '||' instead. +node_modules/uglify-js/lib/compress.js(5159,23): error TS2454: Variable 'exprs' is used before being assigned. +node_modules/uglify-js/lib/compress.js(5160,20): error TS2454: Variable 'exprs' is used before being assigned. +node_modules/uglify-js/lib/compress.js(5251,33): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(5253,55): error TS2339: Property 'loopcontrol_target' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(5257,56): error TS2339: Property 'push' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(5258,12): error TS2339: Property 'push' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(5343,21): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. +node_modules/uglify-js/lib/compress.js(5358,21): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. +node_modules/uglify-js/lib/compress.js(5468,33): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(5470,33): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(5635,17): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. +node_modules/uglify-js/lib/compress.js(5778,37): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(5838,21): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. +node_modules/uglify-js/lib/compress.js(6034,57): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[pattern: string | RegExp, flags?: string | undefined]'. + Property '0' is missing in type 'any[]' but required in type '[pattern: string | RegExp, flags?: string | undefined]'. +node_modules/uglify-js/lib/compress.js(6192,32): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(6198,45): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(6205,25): error TS2403: Subsequent variable declarations must have the same type. Variable 'code' must be of type 'string', but here has type '{ get: () => string; toString: () => string; indent: (half: any) => void; indentation: () => number; current_width: () => number; should_break: () => boolean; has_parens: () => boolean; newline: () => void; print: (str: any) => void; ... 23 more ...; parent: (n: any) => any; }'. +node_modules/uglify-js/lib/compress.js(6209,36): error TS2532: Object is possibly 'undefined'. +node_modules/uglify-js/lib/compress.js(6214,41): error TS2339: Property 'get' does not exist on type 'string'. +node_modules/uglify-js/lib/compress.js(6251,59): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(6363,39): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(6367,21): error TS2322: Type 'null' is not assignable to type 'any[]'. +node_modules/uglify-js/lib/compress.js(6374,25): error TS2322: Type 'null' is not assignable to type 'any[]'. +node_modules/uglify-js/lib/compress.js(6383,25): error TS2322: Type 'null' is not assignable to type 'any[]'. +node_modules/uglify-js/lib/compress.js(6395,32): error TS2532: Object is possibly 'undefined'. +node_modules/uglify-js/lib/compress.js(6399,27): error TS2532: Object is possibly 'undefined'. +node_modules/uglify-js/lib/compress.js(6618,38): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(6889,18): error TS2454: Variable 'is_strict_comparison' is used before being assigned. +node_modules/uglify-js/lib/compress.js(7520,29): error TS2367: This condition will always return 'false' since the types 'boolean' and 'string' have no overlap. +node_modules/uglify-js/lib/compress.js(7564,47): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(7586,66): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(7656,39): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(7728,39): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(7734,41): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(7737,41): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. +node_modules/uglify-js/lib/compress.js(8310,43): error TS2454: Variable 'property' is used before being assigned. +node_modules/uglify-js/lib/compress.js(8325,25): error TS2403: Subsequent variable declarations must have the same type. Variable 'value' must be of type 'number', but here has type 'any'. +node_modules/uglify-js/lib/compress.js(8328,46): error TS2339: Property 'has_side_effects' does not exist on type 'number'. +node_modules/uglify-js/lib/compress.js(8334,25): error TS2403: Subsequent variable declarations must have the same type. Variable 'value' must be of type 'number', but here has type 'any'. +node_modules/uglify-js/lib/compress.js(8367,34): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/minify.js(187,42): error TS2554: Expected 2 arguments, but got 1. +node_modules/uglify-js/lib/minify.js(187,75): error TS2339: Property 'compress' does not exist on type 'Compressor'. +node_modules/uglify-js/lib/mozilla-ast.js(576,33): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/output.js(459,37): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/output.js(460,33): error TS2339: Property 'parent' does not exist on type 'TreeWalker'. node_modules/uglify-js/lib/output.js(475,16): error TS2339: Property 'push' does not exist on type 'TreeWalker'. @@ -168,7 +175,7 @@ node_modules/uglify-js/lib/scope.js(526,30): error TS2554: Expected 0 arguments, node_modules/uglify-js/lib/sourcemap.js(82,11): error TS2339: Property 'index' does not exist on type 'any[]'. node_modules/uglify-js/lib/sourcemap.js(178,31): error TS2339: Property 'index' does not exist on type 'any[]'. node_modules/uglify-js/lib/sourcemap.js(186,34): error TS2339: Property 'index' does not exist on type 'any[]'. -node_modules/uglify-js/tools/exit.js(10,37): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[(number | undefined)?]'. +node_modules/uglify-js/tools/exit.js(10,37): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[code?: number | undefined]'. Types of property 'length' are incompatible. Type 'number' is not assignable to type '0 | 1'. node_modules/uglify-js/tools/node.js(64,26): error TS2339: Property 'minify' does not exist on type 'typeof import("/uglify-js/node_modules/uglify-js/tools/node")'. diff --git a/tests/baselines/reference/user/url-search-params.log b/tests/baselines/reference/user/url-search-params.log index f3d6544ff8dc4..8c992c3809b33 100644 --- a/tests/baselines/reference/user/url-search-params.log +++ b/tests/baselines/reference/user/url-search-params.log @@ -1,7 +1,6 @@ Exit Code: 1 Standard output: node_modules/url-search-params/build/url-search-params.node.js(174,1): error TS2539: Cannot assign to 'URLSearchParams' because it is not a variable. -node_modules/url-search-params/build/url-search-params.node.js(174,44): error TS2339: Property 'URLSearchParams' does not exist on type 'Global'. diff --git a/tests/baselines/reference/user/webpack.log b/tests/baselines/reference/user/webpack.log deleted file mode 100644 index 5d41ba369c9c8..0000000000000 --- a/tests/baselines/reference/user/webpack.log +++ /dev/null @@ -1,28 +0,0 @@ -Exit Code: 1 -Standard output: -lib/AbstractMethodError.js(26,16): error TS2532: Object is possibly 'undefined'. -lib/ContextModule.js(333,29): error TS2345: Argument of type 'Error' is not assignable to parameter of type 'WebpackError'. - Type 'Error' is missing the following properties from type 'WebpackError': details, module, loc, hideStack, and 4 more. -lib/ExternalModule.js(305,28): error TS2554: Expected 1 arguments, but got 0. -lib/MainTemplate.js(40,29): error TS1016: A required parameter cannot follow an optional parameter. -lib/ModuleGraphConnection.js(23,3): error TS1016: A required parameter cannot follow an optional parameter. -lib/Stats.js(68,31): error TS2554: Expected 3 arguments, but got 2. -lib/config/normalization.js(27,30): error TS1016: A required parameter cannot follow an optional parameter. -lib/config/normalization.js(37,38): error TS1016: A required parameter cannot follow an optional parameter. -lib/config/normalization.js(47,29): error TS1016: A required parameter cannot follow an optional parameter. -lib/config/normalization.js(56,37): error TS1016: A required parameter cannot follow an optional parameter. -lib/library/SystemLibraryPlugin.js(127,35): error TS2554: Expected 1 arguments, but got 0. -lib/library/UmdLibraryPlugin.js(38,31): error TS1016: A required parameter cannot follow an optional parameter. -lib/optimize/ConcatenatedModule.js(205,32): error TS2554: Expected 1 arguments, but got 0. -lib/util/fs.js(57,23): error TS1016: A required parameter cannot follow an optional parameter. -lib/util/fs.js(78,19): error TS1016: A required parameter cannot follow an optional parameter. -lib/util/fs.js(98,22): error TS1016: A required parameter cannot follow an optional parameter. -lib/wasm-async/AsyncWebAssemblyModulesPlugin.js(36,15): error TS2304: Cannot find name 'Chunk'. -lib/wasm-async/AsyncWebAssemblyModulesPlugin.js(37,15): error TS2304: Cannot find name 'DependencyTemplates'. -lib/wasm-async/AsyncWebAssemblyModulesPlugin.js(38,15): error TS2304: Cannot find name 'RuntimeTemplate'. -lib/wasm-async/AsyncWebAssemblyModulesPlugin.js(39,15): error TS2304: Cannot find name 'ModuleGraph'. -lib/wasm-async/AsyncWebAssemblyModulesPlugin.js(40,15): error TS2304: Cannot find name 'ChunkGraph'. - - - -Standard error: diff --git a/tests/baselines/reference/user/zone.js.log b/tests/baselines/reference/user/zone.js.log new file mode 100644 index 0000000000000..f8582b0755bc7 --- /dev/null +++ b/tests/baselines/reference/user/zone.js.log @@ -0,0 +1,7 @@ +Exit Code: 1 +Standard output: +../../../../node_modules/@types/node/ts3.5/globals.global.d.ts(1,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'global' must be of type 'Global', but here has type 'Global & typeof globalThis'. + + + +Standard error: From 073fb308bf83375ace865a7b2703dfcba1938e9d Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 20 May 2020 15:47:42 -0400 Subject: [PATCH 43/48] Fix two tests * `docCommentTemplateInSingleLineComment`: Accidentally dropped space, fixes #38651 * `codeFixCorrectReturnValue13`: Bogus test code copied --- tests/cases/fourslash/codeFixCorrectReturnValue13.ts | 4 ---- .../cases/fourslash/docCommentTemplateInSingleLineComment.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/cases/fourslash/codeFixCorrectReturnValue13.ts b/tests/cases/fourslash/codeFixCorrectReturnValue13.ts index cdc7c51982a14..3c159151e1eea 100644 --- a/tests/cases/fourslash/codeFixCorrectReturnValue13.ts +++ b/tests/cases/fourslash/codeFixCorrectReturnValue13.ts @@ -12,7 +12,3 @@ verify.codeFixAvailable([ { description: ts.Diagnostics.Remove_braces_from_arrow_function_body.message }, { description: ts.Diagnostics.Remove_unused_label.message } ]); - -interface A { - bar: string -} diff --git a/tests/cases/fourslash/docCommentTemplateInSingleLineComment.ts b/tests/cases/fourslash/docCommentTemplateInSingleLineComment.ts index b60fff2d59022..8ff2f3452e538 100644 --- a/tests/cases/fourslash/docCommentTemplateInSingleLineComment.ts +++ b/tests/cases/fourslash/docCommentTemplateInSingleLineComment.ts @@ -3,7 +3,7 @@ // @Filename: justAComment.ts //// // We want to check off-by-one errors in assessing the end of the comment, so we check twice, //// // first with a trailing space and then without. -//// // /*0*/ +//// // /*0*/ //// // /*1*/ //// // We also want to check EOF handling at the end of a comment //// // /*2*/ From fdae7ee0eaa15947251e457d0ddd4ac732565a02 Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 4 Jun 2020 04:10:42 +0000 Subject: [PATCH 44/48] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 42 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 44 ++++++++++++++++++- 11 files changed, 463 insertions(+), 1 deletion(-) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 911a8ba9fd016..70699bd0a274c 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3459,6 +3459,12 @@ + + + + + + @@ -3594,6 +3600,18 @@ + + + + + + + + + + + + @@ -3612,6 +3630,12 @@ + + + + + + @@ -11988,6 +12012,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index 143e47d395d02..b384bfa71cba7 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3459,6 +3459,12 @@ + + + + + + @@ -3594,6 +3600,18 @@ + + + + + + + + + + + + @@ -3612,6 +3630,12 @@ + + + + + + @@ -11988,6 +12012,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 15bb26e6d67b0..bfd7adcec9f76 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3468,6 +3468,12 @@ + + + + + + @@ -3603,6 +3609,18 @@ + + + + + + + + + + + + @@ -3621,6 +3639,12 @@ + + + + + + @@ -11997,6 +12021,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index d937f6fc1084b..a5814e8f4b4ab 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3456,6 +3456,12 @@ + + + + + + @@ -3591,6 +3597,18 @@ + + + + + + + + + + + + @@ -3609,6 +3627,12 @@ + + + + + + @@ -11982,6 +12006,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 93926ffeeda22..65f7f7dee5a6a 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3471,6 +3471,12 @@ + + + + + + @@ -3606,6 +3612,18 @@ + + + + + + + + + + + + @@ -3624,6 +3642,12 @@ + + + + + + @@ -12000,6 +12024,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index ae90ff0107a1d..93722403e84ad 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3459,6 +3459,12 @@ + + + + + + @@ -3594,6 +3600,18 @@ + + + + + + + + + + + + @@ -3612,6 +3630,12 @@ + + + + + + @@ -11988,6 +12012,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 96b12537d672d..5ff41f6a398b7 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3459,6 +3459,12 @@ + + + + + + @@ -3594,6 +3600,18 @@ + + + + + + + + + + + + @@ -3612,6 +3630,12 @@ + + + + + + @@ -11988,6 +12012,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 414c7377cdf31..0672e2e524c92 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3459,6 +3459,12 @@ + + + + + + @@ -3594,6 +3600,18 @@ + + + + + + + + + + + + @@ -3612,6 +3630,12 @@ + + + + + + @@ -11988,6 +12012,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 687c81b165cf3..ceecd5f5fafc4 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3449,6 +3449,12 @@ + + + + + + @@ -3584,6 +3590,18 @@ + + + + + + + + + + + + @@ -3602,6 +3620,12 @@ + + + + + + @@ -11975,6 +11999,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 3d92ad9ffd2de..8389a75307fbd 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3452,6 +3452,12 @@ + + + + + + @@ -3587,6 +3593,18 @@ + + + + + + + + + + + + @@ -3605,6 +3623,12 @@ + + + + + + @@ -11978,6 +12002,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 666554fc88706..741ba74998ae1 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3458,6 +3458,12 @@ + + + + + + @@ -3593,6 +3599,18 @@ + + + + + + + + + + + + @@ -3611,6 +3629,12 @@ + + + + + + @@ -9846,7 +9870,7 @@ - + @@ -11987,6 +12011,24 @@ + + + + + + + + + + + + + + + + + + From 3a55473eb1054c7dc084932e54a6f5eff0c34b61 Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 4 Jun 2020 16:10:54 +0000 Subject: [PATCH 45/48] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 70699bd0a274c..24e771ff985ac 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3462,6 +3462,9 @@ + + + @@ -3603,6 +3606,9 @@ + + + From a4c14a2cdc67a329251d4d47b058a6b371ee66f5 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 4 Jun 2020 02:00:28 -0400 Subject: [PATCH 46/48] `getSymbolDisplayPartsDocumentationAndSymbolKind`: use actual `symbol.flags` for `getAliasedSymbol` Fixes #35347. --- src/services/symbolDisplay.ts | 3 ++- tests/cases/fourslash/quickInfoJSExport.ts | 24 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/quickInfoJSExport.ts diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index e6891bc12259d..d62be2649031a 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -379,7 +379,8 @@ namespace ts.SymbolDisplay { } } } - if (symbolFlags & SymbolFlags.Alias) { + // don't use symbolFlags since getAliasedSymbol requires the flag on the symbol itself + if (symbol.flags & SymbolFlags.Alias) { prefixNextMeaning(); if (!hasAddedSymbolInfo) { const resolvedSymbol = typeChecker.getAliasedSymbol(symbol); diff --git a/tests/cases/fourslash/quickInfoJSExport.ts b/tests/cases/fourslash/quickInfoJSExport.ts new file mode 100644 index 0000000000000..24a9bd00fa30b --- /dev/null +++ b/tests/cases/fourslash/quickInfoJSExport.ts @@ -0,0 +1,24 @@ +/// + +// GH #35347 + +// @Filename: a.js +// @allowJs: true +//// /** +//// * @enum {string} +//// */ +//// const testString = { +//// one: "1", +//// two: "2" +//// }; +//// +//// export { test/**/String }; + +verify.quickInfoAt("", +`type testString = string +(alias) type testString = any +(alias) const testString: { + one: string; + two: string; +} +export testString`); From 68315a0e2907fd510034b52f20ee3b6ae681eb7b Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 4 Jun 2020 22:10:50 +0000 Subject: [PATCH 47/48] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 24e771ff985ac..e9b3bfed30644 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3615,6 +3615,9 @@ + + + @@ -3639,6 +3642,9 @@ + + + From 4ee013d1a7ce7dec75ae18dc629189060109306d Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 4 Jun 2020 16:06:41 -0400 Subject: [PATCH 48/48] Fix merging of JS value & TS type decl Fixes #38383 --- src/compiler/checker.ts | 2 +- ...emberMergedWithModuleAugmentation3.symbols | 19 +++++++++++++++ ...tMemberMergedWithModuleAugmentation3.types | 23 +++++++++++++++++++ ...portMemberMergedWithModuleAugmentation3.ts | 10 ++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.symbols create mode 100644 tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.types create mode 100644 tests/cases/compiler/jsExportMemberMergedWithModuleAugmentation3.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d3ff399e9a5dd..2d19a147a29ba 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7870,7 +7870,7 @@ namespace ts { (resolvedSymbol || symbol).exports!.forEach((s, name) => { const exportedMember = members.get(name)!; if (exportedMember && exportedMember !== s) { - if (s.flags & SymbolFlags.Value) { + if (s.flags & SymbolFlags.Value && exportedMember.flags & SymbolFlags.Value) { // If the member has an additional value-like declaration, union the types from the two declarations, // but issue an error if they occurred in two different files. The purpose is to support a JS file with // a pattern like: diff --git a/tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.symbols b/tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.symbols new file mode 100644 index 0000000000000..c56d389851016 --- /dev/null +++ b/tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.symbols @@ -0,0 +1,19 @@ +=== /x.js === +module.exports.x = 1; +>module.exports.x : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) +>module.exports : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) +>module : Symbol(module, Decl(x.js, 0, 0)) +>exports : Symbol("/x", Decl(x.js, 0, 0)) +>x : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) + +module.exports = require("./y.js"); +>module.exports : Symbol("/x", Decl(x.js, 0, 0)) +>module : Symbol(export=, Decl(x.js, 0, 21)) +>exports : Symbol(export=, Decl(x.js, 0, 21)) +>require : Symbol(require) +>"./y.js" : Symbol("/y", Decl(y.d.ts, 0, 0)) + +=== /y.d.ts === +export declare type x = 1; +>x : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.types b/tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.types new file mode 100644 index 0000000000000..6c66c601ffccb --- /dev/null +++ b/tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.types @@ -0,0 +1,23 @@ +=== /x.js === +module.exports.x = 1; +>module.exports.x = 1 : 1 +>module.exports.x : number +>module.exports : typeof import("/y") +>module : { "\"/x\"": typeof import("/y"); } +>exports : typeof import("/y") +>x : number +>1 : 1 + +module.exports = require("./y.js"); +>module.exports = require("./y.js") : typeof import("/y") +>module.exports : typeof import("/y") +>module : { "\"/x\"": typeof import("/y"); } +>exports : typeof import("/y") +>require("./y.js") : typeof import("/y") +>require : any +>"./y.js" : "./y.js" + +=== /y.d.ts === +export declare type x = 1; +>x : 1 + diff --git a/tests/cases/compiler/jsExportMemberMergedWithModuleAugmentation3.ts b/tests/cases/compiler/jsExportMemberMergedWithModuleAugmentation3.ts new file mode 100644 index 0000000000000..526326610d88a --- /dev/null +++ b/tests/cases/compiler/jsExportMemberMergedWithModuleAugmentation3.ts @@ -0,0 +1,10 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @Filename: /x.js +module.exports.x = 1; +module.exports = require("./y.js"); + +// @Filename: /y.d.ts +export declare type x = 1;