diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 2b032f456f34a..acc9db3e629f8 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1827,7 +1827,23 @@ namespace ts { bindPotentiallyMissingNamespaces(file.symbol, declName.parent, isTopLevel, !!findAncestor(declName, d => isPropertyAccessExpression(d) && d.name.escapedText === "prototype"), /*containerIsClass*/ false); const oldContainer = container; - container = isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression; + switch (getAssignmentDeclarationPropertyAccessKind(declName.parent)) { + case AssignmentDeclarationKind.ExportsProperty: + case AssignmentDeclarationKind.ModuleExports: + container = file; + break; + case AssignmentDeclarationKind.ThisProperty: + container = declName.parent.expression; + break; + case AssignmentDeclarationKind.PrototypeProperty: + container = (declName.parent.expression as PropertyAccessExpression).name; + break; + case AssignmentDeclarationKind.Property: + container = isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression; + break; + case AssignmentDeclarationKind.None: + return Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration"); + } declareModuleMember(typeAlias, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes); container = oldContainer; } diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 7af7be17f5534..d80283ce3cf00 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -137,7 +137,7 @@ namespace ts { */ emittedBuildInfo?: boolean; /** - * Already seen affected files + * Already seen emitted files */ seenEmittedFiles: Map | undefined; /** @@ -329,7 +329,6 @@ namespace ts { handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash); return affectedFile; } - seenAffectedFiles.set(affectedFile.path, true); affectedFilesIndex++; } @@ -549,7 +548,7 @@ namespace ts { * This is called after completing operation on the next affected file. * The operations here are postponed to ensure that cancellation during the iteration is handled correctly */ - function doneWithAffectedFile(state: BuilderProgramState, affected: SourceFile | Program, isPendingEmit?: boolean, isBuildInfoEmit?: boolean) { + function doneWithAffectedFile(state: BuilderProgramState, affected: SourceFile | Program, isPendingEmit?: boolean, isBuildInfoEmit?: boolean, isEmitResult?: boolean) { if (isBuildInfoEmit) { state.emittedBuildInfo = true; } @@ -559,6 +558,9 @@ namespace ts { } else { state.seenAffectedFiles!.set((affected as SourceFile).path, true); + if (isEmitResult) { + (state.seenEmittedFiles || (state.seenEmittedFiles = createMap())).set((affected as SourceFile).path, true); + } if (isPendingEmit) { state.affectedFilesPendingEmitIndex!++; } @@ -576,6 +578,14 @@ namespace ts { return { result, affected }; } + /** + * Returns the result with affected file + */ + function toAffectedFileEmitResult(state: BuilderProgramState, result: EmitResult, affected: SourceFile | Program, isPendingEmit?: boolean, isBuildInfoEmit?: boolean): AffectedFileResult { + doneWithAffectedFile(state, affected, isPendingEmit, isBuildInfoEmit, /*isEmitResult*/ true); + return { result, affected }; + } + /** * Gets the semantic diagnostics either from cache if present, or otherwise from program and caches it * Note that it is assumed that the when asked about semantic diagnostics, the file has been taken out of affected files/changed file set @@ -849,7 +859,7 @@ namespace ts { } const affected = Debug.assertDefined(state.program); - return toAffectedFileResult( + return toAffectedFileEmitResult( state, // When whole program is affected, do emit only once (eg when --out or --outFile is specified) // Otherwise just affected file @@ -872,14 +882,14 @@ namespace ts { } } - return toAffectedFileResult( + return toAffectedFileEmitResult( state, // When whole program is affected, do emit only once (eg when --out or --outFile is specified) // Otherwise just affected file Debug.assertDefined(state.program).emit(affected === state.program ? undefined : affected as SourceFile, writeFile || maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers), affected, - isPendingEmitFile - ); + isPendingEmitFile, + ); } /** @@ -1036,7 +1046,7 @@ namespace ts { compilerOptions: convertFromReusableCompilerOptions(program.options, toAbsolutePath), referencedMap: getMapOfReferencedSet(program.referencedMap, toPath), exportedModulesMap: getMapOfReferencedSet(program.exportedModulesMap, toPath), - semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && arrayToMap(program.semanticDiagnosticsPerFile, value => isString(value) ? value : value[0], value => isString(value) ? emptyArray : value[1]), + semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && arrayToMap(program.semanticDiagnosticsPerFile, value => toPath(isString(value) ? value : value[0]), value => isString(value) ? emptyArray : value[1]), hasReusableDiagnostic: true }; return { diff --git a/src/compiler/builderState.ts b/src/compiler/builderState.ts index 953334321c252..9d2c55b5610a2 100644 --- a/src/compiler/builderState.ts +++ b/src/compiler/builderState.ts @@ -345,8 +345,13 @@ namespace ts.BuilderState { } else { const emitOutput = getFileEmitOutput(programOfThisState, sourceFile, /*emitOnlyDtsFiles*/ true, cancellationToken); - if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { - latestSignature = computeHash(emitOutput.outputFiles[0].text); + const firstDts = emitOutput.outputFiles && + programOfThisState.getCompilerOptions().declarationMap ? + emitOutput.outputFiles.length > 1 ? emitOutput.outputFiles[1] : undefined : + emitOutput.outputFiles.length > 0 ? emitOutput.outputFiles[0] : undefined; + if (firstDts) { + Debug.assert(fileExtensionIs(firstDts.name, Extension.Dts), "File extension for signature expected to be dts", () => `Found: ${getAnyExtensionFromPath(firstDts.name)} for ${firstDts.name}:: All output files: ${JSON.stringify(emitOutput.outputFiles.map(f => f.name))}`); + latestSignature = computeHash(firstDts.text); if (exportedModulesMapCache && latestSignature !== prevSignature) { updateExportedModules(sourceFile, emitOutput.exportedModulesFromDeclarationEmit, exportedModulesMapCache); } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cfad47b65336f..5d1739edb11bd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12885,7 +12885,7 @@ namespace ts { // and we need to handle "each" relations before "some" relations for the same kind of type. if (source.flags & TypeFlags.Union) { result = relation === comparableRelation ? - someTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive)) : + someTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive), isIntersectionConstituent) : eachTypeRelatedToType(source as UnionType, target, reportErrors && !(source.flags & TypeFlags.Primitive)); } else { @@ -12923,7 +12923,7 @@ namespace ts { // // - For a primitive type or type parameter (such as 'number = A & B') there is no point in // breaking the intersection apart. - result = someTypeRelatedToType(source, target, /*reportErrors*/ false); + result = someTypeRelatedToType(source, target, /*reportErrors*/ false, /*isIntersectionConstituent*/ true); } if (!result && (source.flags & TypeFlags.StructuredOrInstantiable || target.flags & TypeFlags.StructuredOrInstantiable)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent)) { @@ -13202,14 +13202,14 @@ namespace ts { return result; } - function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean): Ternary { + function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean, isIntersectionConstituent: boolean): Ternary { const sourceTypes = source.types; if (source.flags & TypeFlags.Union && containsType(sourceTypes, target)) { return Ternary.True; } const len = sourceTypes.length; for (let i = 0; i < len; i++) { - const related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1); + const related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1, /*headMessage*/ undefined, isIntersectionConstituent); if (related) { return related; } @@ -21578,13 +21578,13 @@ namespace ts { checkMode: CheckMode, reportErrors: boolean, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - ) { + ): ReadonlyArray | undefined { const errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } = { errors: undefined, skipLogging: true }; if (isJsxOpeningLikeElement(node)) { if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "jsx should have errors when reporting errors"); - return errorOutputContainer.errors || []; + return errorOutputContainer.errors || emptyArray; } return undefined; } @@ -21599,7 +21599,7 @@ namespace ts { const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "this parameter should have errors when reporting errors"); - return errorOutputContainer.errors || []; + return errorOutputContainer.errors || emptyArray; } } const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; @@ -21617,7 +21617,7 @@ namespace ts { if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "parameter should have errors when reporting errors"); maybeAddMissingAwaitInfo(arg, checkArgType, paramType); - return errorOutputContainer.errors || []; + return errorOutputContainer.errors || emptyArray; } } } @@ -21627,7 +21627,7 @@ namespace ts { if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, /*containingMessageChain*/ undefined, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); maybeAddMissingAwaitInfo(errorNode, spreadType, restType); - return errorOutputContainer.errors || []; + return errorOutputContainer.errors || emptyArray; } } return undefined; @@ -22018,7 +22018,7 @@ namespace ts { } } else { - const allDiagnostics: DiagnosticRelatedInformation[][] = []; + const allDiagnostics: (readonly DiagnosticRelatedInformation[])[] = []; let max = 0; let min = Number.MAX_VALUE; let minIndex = 0; diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 9ba03842cecfc..d5bd66258d9b8 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -147,6 +147,7 @@ namespace ts { type: "boolean", category: Diagnostics.Basic_Options, description: Diagnostics.Enable_incremental_compilation, + transpileOptionValue: undefined }, { name: "locale", @@ -262,7 +263,8 @@ namespace ts { affectsModuleResolution: true, showInSimplifiedHelpView: true, category: Diagnostics.Basic_Options, - description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation + description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation, + transpileOptionValue: undefined }, { name: "allowJs", @@ -299,6 +301,7 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Basic_Options, description: Diagnostics.Generates_corresponding_d_ts_file, + transpileOptionValue: undefined }, { name: "declarationMap", @@ -307,6 +310,7 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Basic_Options, description: Diagnostics.Generates_a_sourcemap_for_each_corresponding_d_ts_file, + transpileOptionValue: undefined }, { name: "emitDeclarationOnly", @@ -314,6 +318,7 @@ namespace ts { affectsEmit: true, category: Diagnostics.Advanced_Options, description: Diagnostics.Only_emit_d_ts_declaration_files, + transpileOptionValue: undefined }, { name: "sourceMap", @@ -332,6 +337,7 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Basic_Options, description: Diagnostics.Concatenate_and_emit_output_to_single_file, + transpileOptionValue: undefined }, { name: "outDir", @@ -359,6 +365,7 @@ namespace ts { isTSConfigOnly: true, category: Diagnostics.Basic_Options, description: Diagnostics.Enable_project_compilation, + transpileOptionValue: undefined }, { name: "tsBuildInfoFile", @@ -368,6 +375,7 @@ namespace ts { paramType: Diagnostics.FILE, category: Diagnostics.Basic_Options, description: Diagnostics.Specify_file_to_store_incremental_compilation_information, + transpileOptionValue: undefined }, { name: "removeComments", @@ -384,6 +392,7 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Basic_Options, description: Diagnostics.Do_not_emit_outputs, + transpileOptionValue: undefined }, { name: "importHelpers", @@ -403,7 +412,8 @@ namespace ts { name: "isolatedModules", type: "boolean", category: Diagnostics.Basic_Options, - description: Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + description: Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule, + transpileOptionValue: true }, // Strict Type Checks @@ -540,7 +550,8 @@ namespace ts { affectsModuleResolution: true, isTSConfigOnly: true, category: Diagnostics.Module_Resolution_Options, - description: Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + description: Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl, + transpileOptionValue: undefined }, { // this option can only be specified in tsconfig.json @@ -555,7 +566,8 @@ namespace ts { }, affectsModuleResolution: true, category: Diagnostics.Module_Resolution_Options, - description: Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + description: Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime, + transpileOptionValue: undefined }, { name: "typeRoots", @@ -579,7 +591,8 @@ namespace ts { affectsModuleResolution: true, showInSimplifiedHelpView: true, category: Diagnostics.Module_Resolution_Options, - description: Diagnostics.Type_declaration_files_to_be_included_in_compilation + description: Diagnostics.Type_declaration_files_to_be_included_in_compilation, + transpileOptionValue: undefined }, { name: "allowSyntheticDefaultImports", @@ -680,6 +693,7 @@ namespace ts { category: Diagnostics.Advanced_Options, paramType: Diagnostics.FILE, description: Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, + transpileOptionValue: undefined }, { name: "reactNamespace", @@ -729,14 +743,20 @@ namespace ts { type: "boolean", affectsModuleResolution: true, category: Diagnostics.Advanced_Options, - description: Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + description: Diagnostics.Do_not_include_the_default_library_file_lib_d_ts, + // We are not returning a sourceFile for lib file when asked by the program, + // so pass --noLib to avoid reporting a file not found error. + transpileOptionValue: true }, { name: "noResolve", type: "boolean", affectsModuleResolution: true, category: Diagnostics.Advanced_Options, - description: Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + description: Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files, + // We are not doing a full typecheck, we are not resolving the whole context, + // so pass --noResolve to avoid reporting missing file errors. + transpileOptionValue: true }, { name: "stripInternal", @@ -772,6 +792,7 @@ namespace ts { affectsEmit: true, category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + transpileOptionValue: undefined }, { name: "preserveConstEnums", @@ -787,7 +808,8 @@ namespace ts { isFilePath: true, paramType: Diagnostics.DIRECTORY, category: Diagnostics.Advanced_Options, - description: Diagnostics.Output_directory_for_generated_declaration_files + description: Diagnostics.Output_directory_for_generated_declaration_files, + transpileOptionValue: undefined }, { name: "skipLibCheck", @@ -880,6 +902,10 @@ namespace ts { export const sourceFileAffectingCompilerOptions: ReadonlyArray = optionDeclarations.filter(option => !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics); + /* @internal */ + export const transpileOptionValueCompilerOptions: ReadonlyArray = optionDeclarations.filter(option => + hasProperty(option, "transpileOptionValue")); + /* @internal */ export const buildOpts: CommandLineOption[] = [ ...commonOptionsWithBuild, diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 2bba50beb424c..57cc47cf0e12a 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -155,6 +155,7 @@ namespace ts { } function getOutputJSFileName(inputFileName: string, configFile: ParsedCommandLine, ignoreCase: boolean) { + if (configFile.options.emitDeclarationOnly) return undefined; const isJsonFile = fileExtensionIs(inputFileName, Extension.Json); const outputFileName = changeExtension( getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir), @@ -187,7 +188,7 @@ namespace ts { const js = getOutputJSFileName(inputFileName, configFile, ignoreCase); addOutput(js); if (fileExtensionIs(inputFileName, Extension.Json)) continue; - if (configFile.options.sourceMap) { + if (js && configFile.options.sourceMap) { addOutput(`${js}.map`); } if (getEmitDeclarations(configFile.options) && hasTSFileExtension(inputFileName)) { @@ -214,6 +215,10 @@ namespace ts { if (fileExtensionIs(inputFileName, Extension.Dts)) continue; const jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase); if (jsFilePath) return jsFilePath; + if (fileExtensionIs(inputFileName, Extension.Json)) continue; + if (getEmitDeclarations(configFile.options) && hasTSFileExtension(inputFileName)) { + return getOutputDeclarationFileName(inputFileName, configFile, ignoreCase); + } } const buildInfoPath = getOutputPathForBuildInfo(configFile.options); if (buildInfoPath) return buildInfoPath; diff --git a/src/compiler/perfLogger.ts b/src/compiler/perfLogger.ts index c3efaa75c4a8a..93ff0bf89dd1b 100644 --- a/src/compiler/perfLogger.ts +++ b/src/compiler/perfLogger.ts @@ -36,8 +36,8 @@ namespace ts { etwModule = undefined; } - /** Performance logger that will generate ETW events if possible */ - export const perfLogger: PerfLogger = etwModule ? etwModule : nullLogger; + /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ + export const perfLogger: PerfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; const args = typeof process === "undefined" ? [] : process.argv; perfLogger.logInfoEvent(`Starting TypeScript v${versionMajorMinor} with command line: ${JSON.stringify(args)}`); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2c8a882c1640a..999a922041201 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4930,6 +4930,7 @@ namespace ts { affectsBindDiagnostics?: true; // true if this affects binding (currently same effect as `affectsSourceFile`) affectsSemanticDiagnostics?: true; // true if option affects semantic diagnostics affectsEmit?: true; // true if the options affects emit + transpileOptionValue?: boolean | undefined; // If set this means that the option should be set to this value when transpiling } /* @internal */ diff --git a/src/compiler/visitor.ts b/src/compiler/visitor.ts index 53ccd81f7a6a3..45b43c1d761ff 100644 --- a/src/compiler/visitor.ts +++ b/src/compiler/visitor.ts @@ -141,11 +141,8 @@ namespace ts { export function visitLexicalEnvironment(statements: NodeArray, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean) { context.startLexicalEnvironment(); statements = visitNodes(statements, visitor, isStatement, start); - if (ensureUseStrict && !startsWithUseStrict(statements)) { - statements = setTextRange(createNodeArray([createExpressionStatement(createLiteral("use strict")), ...statements]), statements); - } - const declarations = context.endLexicalEnvironment(); - return setTextRange(createNodeArray(concatenate(declarations, statements)), statements); + if (ensureUseStrict) statements = ts.ensureUseStrict(statements); // tslint:disable-line no-unnecessary-qualifier + return mergeLexicalEnvironment(statements, context.endLexicalEnvironment()); } /** diff --git a/src/harness/fakes.ts b/src/harness/fakes.ts index 522cac95f306b..abcb54fc3203a 100644 --- a/src/harness/fakes.ts +++ b/src/harness/fakes.ts @@ -545,6 +545,10 @@ ${indentText}${text}`; super.writeFile(fileName, ts.getBuildInfoText(buildInfo), writeByteOrderMark); } + createHash(data: string) { + return `${ts.generateDjb2Hash(data)}-${data}`; + } + now() { return new Date(this.sys.vfs.time()); } @@ -571,6 +575,15 @@ Actual: ${JSON.stringify(actual, /*replacer*/ undefined, " ")} Expected: ${JSON.stringify(expected, /*replacer*/ undefined, " ")}`); } + assertErrors(...expectedDiagnostics: ExpectedErrorDiagnostic[]) { + const actual = this.diagnostics.filter(d => d.kind === DiagnosticKind.Error).map(diagnosticToText); + const expected = expectedDiagnostics.map(expectedDiagnosticToText); + assert.deepEqual(actual, expected, `Diagnostics arrays did not match: +Actual: ${JSON.stringify(actual, /*replacer*/ undefined, " ")} +Expected: ${JSON.stringify(expected, /*replacer*/ undefined, " ")} +Actual All:: ${JSON.stringify(this.diagnostics.slice().map(diagnosticToText), /*replacer*/ undefined, " ")}`); + } + printDiagnostics(header = "== Diagnostics ==") { const out = ts.createDiagnosticReporter(ts.sys); ts.sys.write(header + "\r\n"); diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 6720bf0c191f9..c7210cd103bca 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8197,7 +8197,7 @@ - + diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 7a8bfb5f5d509..05862e419b1e4 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -539,10 +539,14 @@ namespace ts.formatting { return true; case SyntaxKind.VariableDeclaration: case SyntaxKind.PropertyAssignment: + case SyntaxKind.BinaryExpression: if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === SyntaxKind.ObjectLiteralExpression) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child!); } - return true; + if (parent.kind !== SyntaxKind.BinaryExpression) { + return true; + } + break; case SyntaxKind.DoStatement: case SyntaxKind.WhileStatement: case SyntaxKind.ForInStatement: diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index 22d28efd2f4e0..cc15a8ace42d4 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -39,7 +39,7 @@ namespace ts.GoToDefinition { return [sigInfo]; } else { - const defs = getDefinitionFromSymbol(typeChecker, symbol, node) || emptyArray; + const defs = getDefinitionFromSymbol(typeChecker, symbol, node, calledDeclaration) || emptyArray; // For a 'super()' call, put the signature first, else put the variable first. return node.kind === SyntaxKind.SuperKeyword ? [sigInfo, ...defs] : [...defs, sigInfo]; } @@ -232,10 +232,11 @@ namespace ts.GoToDefinition { } } - function getDefinitionFromSymbol(typeChecker: TypeChecker, symbol: Symbol, node: Node): DefinitionInfo[] | undefined { + function getDefinitionFromSymbol(typeChecker: TypeChecker, symbol: Symbol, node: Node, declarationNode?: Node): DefinitionInfo[] | undefined { // There are cases when you extend a function by adding properties to it afterwards, - // we want to strip those extra properties - const filteredDeclarations = filter(symbol.declarations, d => !isAssignmentDeclaration(d) || d === symbol.valueDeclaration) || undefined; + // we want to strip those extra properties. + // For deduping purposes, we also want to exclude any declarationNodes if provided. + const filteredDeclarations = filter(symbol.declarations, d => d !== declarationNode && (!isAssignmentDeclaration(d) || d === symbol.valueDeclaration)) || undefined; return getConstructSignatureDefinition() || getCallSignatureDefinition() || map(filteredDeclarations, declaration => createDefinitionInfo(declaration, typeChecker, symbol, node)); function getConstructSignatureDefinition(): DefinitionInfo[] | undefined { @@ -258,8 +259,13 @@ namespace ts.GoToDefinition { return undefined; } const declarations = signatureDeclarations.filter(selectConstructors ? isConstructorDeclaration : isFunctionLike); + const declarationsWithBody = declarations.filter(d => !!(d).body); + + // declarations defined on the global scope can be defined on multiple files. Get all of them. return declarations.length - ? [createDefinitionInfo(find(declarations, d => !!(d).body) || last(declarations), typeChecker, symbol, node)] + ? declarationsWithBody.length !== 0 + ? declarationsWithBody.map(x => createDefinitionInfo(x, typeChecker, symbol, node)) + : [createDefinitionInfo(last(declarations), typeChecker, symbol, node)] : undefined; } } diff --git a/src/services/transpile.ts b/src/services/transpile.ts index 51d1582c564c9..c739c8394f2c3 100644 --- a/src/services/transpile.ts +++ b/src/services/transpile.ts @@ -36,7 +36,9 @@ namespace ts { } } - options.isolatedModules = true; + for (const option of transpileOptionValueCompilerOptions) { + options[option.name] = option.transpileOptionValue; + } // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths. options.suppressOutputPathCheck = true; @@ -44,27 +46,6 @@ namespace ts { // Filename can be non-ts file. options.allowNonTsExtensions = true; - // We are not returning a sourceFile for lib file when asked by the program, - // so pass --noLib to avoid reporting a file not found error. - options.noLib = true; - - // Clear out other settings that would not be used in transpiling this module - options.lib = undefined; - options.types = undefined; - options.noEmit = undefined; - options.noEmitOnError = undefined; - options.paths = undefined; - options.rootDirs = undefined; - options.declaration = undefined; - options.composite = undefined; - options.declarationDir = undefined; - options.out = undefined; - options.outFile = undefined; - - // We are not doing a full typecheck, we are not resolving the whole context, - // so pass --noResolve to avoid reporting missing file errors. - options.noResolve = true; - // if jsx is specified then treat file as .tsx const inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts"); const sourceFile = createSourceFile(inputFileName, input, options.target!); // TODO: GH#18217 diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index c395b05e154ce..db9e96e1ad2fc 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -94,6 +94,7 @@ "unittests/tsbuild/amdModulesWithOut.ts", "unittests/tsbuild/containerOnlyReferenced.ts", "unittests/tsbuild/demo.ts", + "unittests/tsbuild/emitDeclarationOnly.ts", "unittests/tsbuild/emptyFiles.ts", "unittests/tsbuild/graphOrdering.ts", "unittests/tsbuild/inferredTypeFromTransitiveModule.ts", diff --git a/src/testRunner/unittests/services/transpile.ts b/src/testRunner/unittests/services/transpile.ts index a86f4bdfc9e60..cd4cbe631373a 100644 --- a/src/testRunner/unittests/services/transpile.ts +++ b/src/testRunner/unittests/services/transpile.ts @@ -416,6 +416,18 @@ var x = 0;`, { options: { compilerOptions: { typeRoots: ["./folder"] }, fileName: "input.js", reportDiagnostics: true } }); + transpilesCorrectly("Supports setting 'incremental'", "x;", { + options: { compilerOptions: { incremental: true }, fileName: "input.js", reportDiagnostics: true } + }); + + transpilesCorrectly("Supports setting 'composite'", "x;", { + options: { compilerOptions: { composite: true }, fileName: "input.js", reportDiagnostics: true } + }); + + transpilesCorrectly("Supports setting 'tsbuildinfo'", "x;", { + options: { compilerOptions: { incremental: true, tsBuildInfoFile: "./folder/config.tsbuildinfo" }, fileName: "input.js", reportDiagnostics: true } + }); + transpilesCorrectly("Correctly serialize metadata when transpile with CommonJS option", `import * as ng from "angular2/core";` + `declare function foo(...args: any[]);` + diff --git a/src/testRunner/unittests/tsbuild/amdModulesWithOut.ts b/src/testRunner/unittests/tsbuild/amdModulesWithOut.ts index 3e1cab9b4a064..73e2af33fd9cc 100644 --- a/src/testRunner/unittests/tsbuild/amdModulesWithOut.ts +++ b/src/testRunner/unittests/tsbuild/amdModulesWithOut.ts @@ -77,7 +77,7 @@ namespace ts { [outputFiles[project.lib][ext.buildinfo], outputFiles[project.lib][ext.js], outputFiles[project.lib][ext.dts]], [outputFiles[project.app][ext.buildinfo], outputFiles[project.app][ext.js], outputFiles[project.app][ext.dts]] ], - lastProjectOutputJs: outputFiles[project.app][ext.js], + lastProjectOutput: outputFiles[project.app][ext.js], initialBuild: { modifyFs }, @@ -231,7 +231,7 @@ ${internal} export enum internalEnum { a, b, c }`); [libOutputFile[ext.buildinfo], libOutputFile[ext.js], libOutputFile[ext.dts]], [outputFiles[project.app][ext.buildinfo], outputFiles[project.app][ext.js], outputFiles[project.app][ext.dts]] ], - lastProjectOutputJs: outputFiles[project.app][ext.js], + lastProjectOutput: outputFiles[project.app][ext.js], initialBuild: { modifyFs, expectedDiagnostics: [ diff --git a/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts b/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts new file mode 100644 index 0000000000000..1999737a50fb8 --- /dev/null +++ b/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts @@ -0,0 +1,109 @@ +namespace ts { + describe("unittests:: tsbuild:: on project with emitDeclarationOnly set to true", () => { + let projFs: vfs.FileSystem; + const { time, tick } = getTime(); + before(() => { + projFs = loadProjectFromDisk("tests/projects/emitDeclarationOnly", time); + }); + after(() => { + projFs = undefined!; + }); + + function verifyEmitDeclarationOnly(disableMap?: true) { + verifyTsbuildOutput({ + scenario: `only dts output in circular import project with emitDeclarationOnly${disableMap ? "" : " and declarationMap"}`, + projFs: () => projFs, + time, + tick, + proj: "emitDeclarationOnly", + rootNames: ["/src"], + lastProjectOutput: `/src/lib/index.d.ts`, + outputFiles: [ + "/src/lib/a.d.ts", + "/src/lib/b.d.ts", + "/src/lib/c.d.ts", + "/src/lib/index.d.ts", + "/src/tsconfig.tsbuildinfo", + ...(disableMap ? emptyArray : [ + "/src/lib/a.d.ts.map", + "/src/lib/b.d.ts.map", + "/src/lib/c.d.ts.map", + "/src/lib/index.d.ts.map" + ]) + ], + initialBuild: { + modifyFs: disableMap ? + (fs => replaceText(fs, "/src/tsconfig.json", `"declarationMap": true,`, "")) : + noop, + expectedDiagnostics: [ + getExpectedDiagnosticForProjectsInBuild("src/tsconfig.json"), + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/tsconfig.json", "src/lib/a.d.ts"], + [Diagnostics.Building_project_0, "/src/tsconfig.json"] + ] + }, + incrementalDtsChangedBuild: { + modifyFs: fs => replaceText(fs, "/src/src/a.ts", "b: B;", "b: B; foo: any;"), + expectedDiagnostics: [ + getExpectedDiagnosticForProjectsInBuild("src/tsconfig.json"), + [Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, "src/tsconfig.json", "src/lib/a.d.ts", "src/src/a.ts"], + [Diagnostics.Building_project_0, "/src/tsconfig.json"] + ] + }, + baselineOnly: true, + verifyDiagnostics: true + }); + } + verifyEmitDeclarationOnly(); + verifyEmitDeclarationOnly(/*disableMap*/ true); + + verifyTsbuildOutput({ + scenario: `only dts output in non circular imports project with emitDeclarationOnly`, + projFs: () => projFs, + time, + tick, + proj: "emitDeclarationOnly", + rootNames: ["/src"], + lastProjectOutput: `/src/lib/a.d.ts`, + outputFiles: [ + "/src/lib/a.d.ts", + "/src/lib/b.d.ts", + "/src/lib/c.d.ts", + "/src/tsconfig.tsbuildinfo", + "/src/lib/a.d.ts.map", + "/src/lib/b.d.ts.map", + "/src/lib/c.d.ts.map", + ], + initialBuild: { + modifyFs: fs => { + fs.rimrafSync("/src/src/index.ts"); + replaceText(fs, "/src/src/a.ts", `import { B } from "./b";`, `export class B { prop = "hello"; }`); + }, + expectedDiagnostics: [ + getExpectedDiagnosticForProjectsInBuild("src/tsconfig.json"), + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/tsconfig.json", "src/lib/a.d.ts"], + [Diagnostics.Building_project_0, "/src/tsconfig.json"] + ] + }, + incrementalDtsChangedBuild: { + modifyFs: fs => replaceText(fs, "/src/src/a.ts", "b: B;", "b: B; foo: any;"), + expectedDiagnostics: [ + getExpectedDiagnosticForProjectsInBuild("src/tsconfig.json"), + [Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, "src/tsconfig.json", "src/lib/a.d.ts", "src/src/a.ts"], + [Diagnostics.Building_project_0, "/src/tsconfig.json"] + ] + }, + incrementalDtsUnchangedBuild: { + modifyFs: fs => replaceText(fs, "/src/src/a.ts", "export interface A {", `class C { } +export interface A {`), + expectedDiagnostics: [ + getExpectedDiagnosticForProjectsInBuild("src/tsconfig.json"), + [Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, "src/tsconfig.json", "src/lib/a.d.ts", "src/src/a.ts"], + [Diagnostics.Building_project_0, "/src/tsconfig.json"], + [Diagnostics.Updating_unchanged_output_timestamps_of_project_0, "/src/tsconfig.json"] + ] + }, + baselineOnly: true, + verifyDiagnostics: true + }); + }); +} diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index 165aab849168f..4542733d2e65d 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -102,7 +102,22 @@ namespace ts { interface ReadonlyArray {} declare const console: { log(msg: any): void; };`; - export function loadProjectFromDisk(root: string, time?: vfs.FileSystemOptions["time"]): vfs.FileSystem { + export const symbolLibContent = ` +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} +`; + + export function loadProjectFromDisk( + root: string, + time?: vfs.FileSystemOptions["time"], + libContentToAppend?: string + ): vfs.FileSystem { const resolver = vfs.createResolver(Harness.IO); const fs = new vfs.FileSystem(/*ignoreCase*/ true, { files: { @@ -112,10 +127,29 @@ declare const console: { log(msg: any): void; };`; meta: { defaultLibLocation: "/lib" }, time }); + addLibAndMakeReadonly(fs, libContentToAppend); + return fs; + } + + export function loadProjectFromFiles( + files: vfs.FileSet, + time?: vfs.FileSystemOptions["time"], + libContentToAppend?: string + ): vfs.FileSystem { + const fs = new vfs.FileSystem(/*ignoreCase*/ true, { + files, + cwd: "/", + meta: { defaultLibLocation: "/lib" }, + time + }); + addLibAndMakeReadonly(fs, libContentToAppend); + return fs; + } + + function addLibAndMakeReadonly(fs: vfs.FileSystem, libContentToAppend?: string) { fs.mkdirSync("/lib"); - fs.writeFileSync("/lib/lib.d.ts", libContent); + fs.writeFileSync("/lib/lib.d.ts", libContentToAppend ? `${libContent}${libContentToAppend}` : libContent); fs.makeReadonly(); - return fs; } export function verifyOutputsPresent(fs: vfs.FileSystem, outputs: readonly string[]) { @@ -199,7 +233,7 @@ declare const console: { log(msg: any): void; };`; fs: vfs.FileSystem; tick: () => void; rootNames: ReadonlyArray; - expectedMapFileNames: ReadonlyArray; + expectedMapFileNames?: ReadonlyArray; expectedBuildInfoFilesForSectionBaselines?: ReadonlyArray; modifyFs: (fs: vfs.FileSystem) => void; } @@ -221,7 +255,7 @@ declare const console: { log(msg: any): void; };`; return originalReadFile.call(host, path); }; builder.build(); - generateSourceMapBaselineFiles(fs, expectedMapFileNames); + if (expectedMapFileNames) generateSourceMapBaselineFiles(fs, expectedMapFileNames); generateBuildInfoSectionBaselineFiles(fs, expectedBuildInfoFilesForSectionBaselines || emptyArray); fs.makeReadonly(); return { fs, actualReadFileMap, host, builder }; @@ -268,9 +302,10 @@ Mismatch Actual(path, actual, expected): ${JSON.stringify(arrayFrom(mapDefinedIt tick: () => void; proj: string; rootNames: ReadonlyArray; - expectedMapFileNames: ReadonlyArray; + /** map file names to generate baseline of */ + expectedMapFileNames?: ReadonlyArray; expectedBuildInfoFilesForSectionBaselines?: ReadonlyArray; - lastProjectOutputJs: string; + lastProjectOutput: string; initialBuild: BuildState; outputFiles?: ReadonlyArray; incrementalDtsChangedBuild?: BuildState; @@ -282,7 +317,7 @@ Mismatch Actual(path, actual, expected): ${JSON.stringify(arrayFrom(mapDefinedIt export function verifyTsbuildOutput({ scenario, projFs, time, tick, proj, rootNames, outputFiles, baselineOnly, verifyDiagnostics, - expectedMapFileNames, expectedBuildInfoFilesForSectionBaselines, lastProjectOutputJs, + expectedMapFileNames, expectedBuildInfoFilesForSectionBaselines, lastProjectOutput, initialBuild, incrementalDtsChangedBuild, incrementalDtsUnchangedBuild, incrementalHeaderChangedBuild }: VerifyTsBuildInput) { describe(`tsc --b ${proj}:: ${scenario}`, () => { @@ -331,7 +366,7 @@ Mismatch Actual(path, actual, expected): ${JSON.stringify(arrayFrom(mapDefinedIt let beforeBuildTime: number; let afterBuildTime: number; before(() => { - beforeBuildTime = fs.statSync(lastProjectOutputJs).mtimeMs; + beforeBuildTime = fs.statSync(lastProjectOutput).mtimeMs; tick(); newFs = fs.shadow(); tick(); @@ -343,7 +378,7 @@ Mismatch Actual(path, actual, expected): ${JSON.stringify(arrayFrom(mapDefinedIt expectedBuildInfoFilesForSectionBaselines, modifyFs: incrementalModifyFs, })); - afterBuildTime = newFs.statSync(lastProjectOutputJs).mtimeMs; + afterBuildTime = newFs.statSync(lastProjectOutput).mtimeMs; }); after(() => { newFs = undefined!; @@ -359,6 +394,12 @@ Mismatch Actual(path, actual, expected): ${JSON.stringify(arrayFrom(mapDefinedIt host.assertDiagnosticMessages(...(incrementalExpectedDiagnostics || emptyArray)); }); } + else { + // Build should pass without errors if not verifying diagnostics + it(`verify no errors`, () => { + host.assertErrors(/*empty*/); + }); + } it(`Generates files matching the baseline`, () => { generateBaseline(newFs, proj, scenario, subScenario, fs); }); @@ -373,7 +414,6 @@ Mismatch Actual(path, actual, expected): ${JSON.stringify(arrayFrom(mapDefinedIt fs: newFs.shadow(), tick, rootNames, - expectedMapFileNames: emptyArray, modifyFs: fs => { // Delete output files for (const outputFile of expectedOutputFiles) { diff --git a/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts b/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts index 792fefb7ba7df..301f9894fde51 100644 --- a/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts +++ b/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts @@ -16,8 +16,7 @@ namespace ts { tick, proj: "inferredTypeFromTransitiveModule", rootNames: ["/src"], - expectedMapFileNames: emptyArray, - lastProjectOutputJs: `/src/obj/index.js`, + lastProjectOutput: `/src/obj/index.js`, outputFiles: [ "/src/obj/bar.js", "/src/obj/bar.d.ts", "/src/obj/bundling.js", "/src/obj/bundling.d.ts", diff --git a/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts b/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts index ff9f1fc7c7afc..781dd6938b9f1 100644 --- a/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts +++ b/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts @@ -16,8 +16,7 @@ namespace ts { tick, proj: "lateBoundSymbol", rootNames: ["/src/tsconfig.json"], - expectedMapFileNames: emptyArray, - lastProjectOutputJs: "/src/src/main.js", + lastProjectOutput: "/src/src/main.js", outputFiles: [ "/src/src/hkt.js", "/src/src/main.js", diff --git a/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts b/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts index ad0a229e876dd..c6737b9d2f7ec 100644 --- a/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts +++ b/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts @@ -1,8 +1,10 @@ namespace ts { // https://github.com/microsoft/TypeScript/issues/31696 - it("unittests:: tsbuild:: moduleSpecifiers:: synthesized module specifiers to referenced projects resolve correctly", () => { - const baseFs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ false, { - files: { + describe("unittests:: tsbuild:: moduleSpecifiers:: synthesized module specifiers to referenced projects resolve correctly", () => { + let projFs: vfs.FileSystem; + const { time, tick } = getTime(); + before(() => { + projFs = loadProjectFromFiles({ "/src/common/nominal.ts": utils.dedent` export declare type Nominal = T & { [Symbol.species]: Name; @@ -71,7 +73,6 @@ namespace ts { "skipLibCheck": true, "rootDir": "./", "outDir": "lib", - "lib": ["dom", "es2015", "es2015.symbol.wellknown"] } }`, "/tsconfig.json": utils.dedent`{ @@ -83,16 +84,23 @@ namespace ts { ], "include": [] }` + }, time, symbolLibContent); + }); + after(() => { + projFs = undefined!; + }); + verifyTsbuildOutput({ + scenario: `synthesized module specifiers resolve correctly`, + projFs: () => projFs, + time, + tick, + proj: "moduleSpecifiers", + rootNames: ["/"], + lastProjectOutput: `/src/lib/index.d.ts`, + initialBuild: { + modifyFs: noop, }, - cwd: "/" + baselineOnly: true }); - const fs = baseFs.makeReadonly().shadow(); - const sys = new fakes.System(fs, { executingFilePath: "/", newLine: "\n" }); - const host = new fakes.SolutionBuilderHost(sys); - const builder = createSolutionBuilder(host, ["/tsconfig.json"], { dry: false, force: false, verbose: false }); - builder.build(); - - // Prior to fixing GH31696 the import in `/lib/src/sub-project-2/index.d.ts` was `import("../../lib/src/common/nonterminal")`, which was invalid. - Harness.Baseline.runBaseline("tsbuild/moduleSpecifiers/initial-build/resolves-correctly.js", vfs.formatPatch(fs.diff(baseFs))); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/tsbuild/outFile.ts b/src/testRunner/unittests/tsbuild/outFile.ts index f562d4dc26b77..4b81160cc99e3 100644 --- a/src/testRunner/unittests/tsbuild/outFile.ts +++ b/src/testRunner/unittests/tsbuild/outFile.ts @@ -288,7 +288,7 @@ namespace ts { rootNames: ["/src/third"], expectedMapFileNames, expectedBuildInfoFilesForSectionBaselines: expectedBuildInfoFilesForSectionBaselines || expectedTsbuildInfoFileNames, - lastProjectOutputJs: outputFiles[project.third][ext.js], + lastProjectOutput: outputFiles[project.third][ext.js], initialBuild: { modifyFs, expectedDiagnostics: initialExpectedDiagnostics, diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index 8dcc69d06d9ed..91574c3a920b0 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -617,7 +617,7 @@ export class cNew {}`); "/src/core/index.d.ts.map", "/src/logic/index.js.map" ], - lastProjectOutputJs: "/src/tests/index.js", + lastProjectOutput: "/src/tests/index.js", initialBuild, incrementalDtsChangedBuild: { modifyFs: fs => appendText(fs, "/src/core/index.ts", ` @@ -727,7 +727,7 @@ class someClass { }`), "/src/core/index.d.ts.map", "/src/logic/index.js.map" ], - lastProjectOutputJs: "/src/tests/index.js", + lastProjectOutput: "/src/tests/index.js", initialBuild, incrementalDtsChangedBuild: { modifyFs: fs => replaceText(fs, "/src/logic/tsconfig.json", `"declaration": true,`, `"declaration": true, @@ -795,7 +795,7 @@ class someClass { }`), "/src/core/index.d.ts.map", "/src/logic/index.js.map" ], - lastProjectOutputJs: "/src/tests/index.js", + lastProjectOutput: "/src/tests/index.js", initialBuild: { modifyFs: fs => replaceText(fs, "/src/logic/tsconfig.json", `"composite": true,`, `"composite": true, "tsBuildInfoFile": "ownFile.tsbuildinfo",`), @@ -851,8 +851,7 @@ class someClass { }`), tick, proj: "sample1", rootNames: ["/src/core"], - expectedMapFileNames: emptyArray, - lastProjectOutputJs: "/src/core/index.js", + lastProjectOutput: "/src/core/index.js", initialBuild: { modifyFs: fs => fs.writeFileSync("/src/core/tsconfig.json", `{ "compilerOptions": { @@ -892,8 +891,7 @@ class someClass { }`), tick, proj: "sample1", rootNames: ["/src/core"], - expectedMapFileNames: emptyArray, - lastProjectOutputJs: "/src/core/index.js", + lastProjectOutput: "/src/core/index.js", initialBuild: { modifyFs: fs => { fs.writeFileSync("/lib/lib.esnext.full.d.ts", `/// @@ -942,8 +940,7 @@ class someClass { }`), tick, proj: "sample1", rootNames: ["/src/core"], - expectedMapFileNames: emptyArray, - lastProjectOutputJs: "/src/core/index.js", + lastProjectOutput: "/src/core/index.js", initialBuild: { modifyFs: fs => fs.writeFileSync("/src/core/tsconfig.json", `{ "compilerOptions": { @@ -981,8 +978,7 @@ class someClass { }`), tick, proj: "sample1", rootNames: ["/src/tests"], - expectedMapFileNames: emptyArray, - lastProjectOutputJs: "/src/tests/index.js", + lastProjectOutput: "/src/tests/index.js", initialBuild: { modifyFs: fs => fs.writeFileSync("/src/tests/tsconfig.json", `{ "references": [ diff --git a/src/testRunner/unittests/tscWatch/incremental.ts b/src/testRunner/unittests/tscWatch/incremental.ts index 6c72a4bfe9c71..e89c2fa534dcf 100644 --- a/src/testRunner/unittests/tscWatch/incremental.ts +++ b/src/testRunner/unittests/tscWatch/incremental.ts @@ -16,17 +16,17 @@ namespace ts.tscWatch { expectedIncrementalEmit?: ReadonlyArray; expectedIncrementalErrors?: ReadonlyArray; } - function verifyIncrementalWatchEmit(input: VerifyIncrementalWatchEmitInput) { + function verifyIncrementalWatchEmit(input: () => VerifyIncrementalWatchEmitInput) { it("with tsc --w", () => { verifyIncrementalWatchEmitWorker({ - input, + input: input(), emitAndReportErrors: createWatchOfConfigFile, verifyErrors: checkOutputErrorsInitial }); }); it("with tsc", () => { verifyIncrementalWatchEmitWorker({ - input, + input: input(), emitAndReportErrors: incrementalBuild, verifyErrors: checkNormalBuildErrors }); @@ -122,7 +122,7 @@ namespace ts.tscWatch { function checkFileEmit(actual: Map, expected: ReadonlyArray) { assert.equal(actual.size, expected.length, `Actual: ${JSON.stringify(arrayFrom(actual.entries()), /*replacer*/ undefined, " ")}\nExpected: ${JSON.stringify(expected, /*replacer*/ undefined, " ")}`); - expected.forEach(file => { + for (const file of expected) { let expectedContent = file.content; let actualContent = actual.get(file.path); if (isBuildInfoFile(file.path)) { @@ -130,7 +130,7 @@ namespace ts.tscWatch { expectedContent = sanitizeBuildInfo(expectedContent); } assert.equal(actualContent, expectedContent, `Emit for ${file.path}`); - }); + } } const libFileInfo: BuilderState.FileInfo = { @@ -170,7 +170,7 @@ namespace ts.tscWatch { describe("own file emit without errors", () => { function verify(optionsToExtend?: CompilerOptions, expectedBuildinfoOptions?: CompilerOptions) { const modifiedFile2Content = file2.content.replace("y", "z").replace("20", "10"); - verifyIncrementalWatchEmit({ + verifyIncrementalWatchEmit(() => ({ files: [libFile, file1, file2, configFile], optionsToExtend, expectedInitialEmit: [ @@ -226,7 +226,7 @@ namespace ts.tscWatch { } ], expectedIncrementalErrors: emptyArray, - }); + })); } verify(); describe("with commandline parameters that are not relative", () => { @@ -259,7 +259,7 @@ namespace ts.tscWatch { "file2.ts(1,7): error TS2322: Type '20' is not assignable to type 'string'.\n" ]; const modifiedFile1Content = file1.content.replace("x", "z"); - verifyIncrementalWatchEmit({ + verifyIncrementalWatchEmit(() => ({ files: [libFile, file1, fileModified, configFile], expectedInitialEmit: [ file1Js, @@ -320,7 +320,7 @@ namespace ts.tscWatch { } ], expectedIncrementalErrors: file2Errors, - }); + })); }); describe("with --out", () => { @@ -332,7 +332,7 @@ namespace ts.tscWatch { path: `${project}/out.js`, content: "var x = 10;\nvar y = 20;\n" }; - verifyIncrementalWatchEmit({ + verifyIncrementalWatchEmit(() => ({ files: [libFile, file1, file2, config], expectedInitialEmit: [ outFile, @@ -353,7 +353,7 @@ namespace ts.tscWatch { } ], expectedInitialErrors: emptyArray - }); + })); }); }); @@ -397,7 +397,7 @@ namespace ts.tscWatch { describe("own file emit without errors", () => { const modifiedFile2Content = file2.content.replace("y", "z").replace("20", "10"); - verifyIncrementalWatchEmit({ + verifyIncrementalWatchEmit(() => ({ files: [libFile, file1, file2, config], expectedInitialEmit: [ file1Js, @@ -451,7 +451,7 @@ namespace ts.tscWatch { } ], expectedIncrementalErrors: emptyArray, - }); + })); }); describe("own file emit with errors", () => { @@ -479,7 +479,7 @@ namespace ts.tscWatch { "file2.ts(1,14): error TS2322: Type '20' is not assignable to type 'string'.\n" ]; const modifiedFile1Content = file1.content.replace("x = 10", "z = 10"); - verifyIncrementalWatchEmit({ + verifyIncrementalWatchEmit(() => ({ files: [libFile, file1, fileModified, config], expectedInitialEmit: [ file1Js, @@ -541,6 +541,49 @@ namespace ts.tscWatch { } ], expectedIncrementalErrors: file2Errors, + })); + + it("verify that state is read correctly", () => { + const system = createWatchedSystem([libFile, file1, fileModified, config], { currentDirectory: project }); + incrementalBuild("tsconfig.json", system); + + const command = parseConfigFileWithSystem("tsconfig.json", {}, system, noop)!; + const builderProgram = createIncrementalProgram({ + rootNames: command.fileNames, + options: command.options, + projectReferences: command.projectReferences, + configFileParsingDiagnostics: getConfigFileParsingDiagnostics(command), + host: createIncrementalCompilerHost(command.options, system) + }); + + const state = builderProgram.getState(); + assert.equal(state.changedFilesSet!.size, 0, "changes"); + + assert.equal(state.fileInfos.size, 3, "FileInfo size"); + assert.deepEqual(state.fileInfos.get(libFile.path), libFileInfo); + assert.deepEqual(state.fileInfos.get(file1.path), getFileInfo(file1.content)); + assert.deepEqual(state.fileInfos.get(file2.path), file2FileInfo); + + assert.deepEqual(state.compilerOptions, { + incremental: true, + module: ModuleKind.AMD, + configFilePath: config.path + }); + + assert.equal(state.referencedMap!.size, 0); + assert.equal(state.exportedModulesMap!.size, 0); + + assert.equal(state.semanticDiagnosticsPerFile!.size, 3); + assert.deepEqual(state.semanticDiagnosticsPerFile!.get(libFile.path), emptyArray); + assert.deepEqual(state.semanticDiagnosticsPerFile!.get(file1.path), emptyArray); + const { file: _, relatedInformation: __, ...rest } = file2ReuasableError[1][0]; + assert.deepEqual(state.semanticDiagnosticsPerFile!.get(file2.path), [{ + ...rest, + file: state.program!.getSourceFileByPath(file2.path as Path)!, + relatedInformation: undefined, + reportsUnnecessary: undefined, + source: undefined + }]); }); }); @@ -561,7 +604,7 @@ namespace ts.tscWatch { }); `; } - verifyIncrementalWatchEmit({ + verifyIncrementalWatchEmit(() => ({ files: [libFile, file1, file2, config], expectedInitialEmit: [ outFile, @@ -582,7 +625,140 @@ namespace ts.tscWatch { } ], expectedInitialErrors: emptyArray - }); + })); + }); + }); + + describe("incremental with circular references", () => { + function getFileInfo(content: string): BuilderState.FileInfo { + const signature = Harness.mockHash(content); + return { version: signature, signature }; + } + const config: File = { + path: configFile.path, + content: JSON.stringify({ + compilerOptions: { + incremental: true, + target: "es5", + module: "commonjs", + declaration: true, + emitDeclarationOnly: true + } + }) + }; + const aTs: File = { + path: `${project}/a.ts`, + content: `import { B } from "./b"; +export interface A { + b: B; +} +` + }; + const bTs: File = { + path: `${project}/b.ts`, + content: `import { C } from "./c"; +export interface B { + b: C; +} +` + }; + const cTs: File = { + path: `${project}/c.ts`, + content: `import { A } from "./a"; +export interface C { + a: A; +} +` + }; + const indexTs: File = { + path: `${project}/index.ts`, + content: `export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; +` + }; + + verifyIncrementalWatchEmit(() => { + const referencedMap: MapLike = { + "./a.ts": ["./b.ts"], + "./b.ts": ["./c.ts"], + "./c.ts": ["./a.ts"], + "./index.ts": ["./a.ts", "./b.ts", "./c.ts"], + }; + const initialProgram: ProgramBuildInfo = { + fileInfos: { + [libFilePath]: libFileInfo, + "./c.ts": getFileInfo(cTs.content), + "./b.ts": getFileInfo(bTs.content), + "./a.ts": getFileInfo(aTs.content), + "./index.ts": getFileInfo(indexTs.content) + }, + options: { + incremental: true, + target: ScriptTarget.ES5, + module: ModuleKind.CommonJS, + declaration: true, + emitDeclarationOnly: true, + configFilePath: "./tsconfig.json" + }, + referencedMap, + exportedModulesMap: referencedMap, + semanticDiagnosticsPerFile: [ + libFilePath, + "./a.ts", + "./b.ts", + "./c.ts", + "./index.ts", + ] + }; + const { fileInfos, ...rest } = initialProgram; + const expectedADts: File = { path: `${project}/a.d.ts`, content: aTs.content }; + const expectedBDts: File = { path: `${project}/b.d.ts`, content: bTs.content }; + const expectedCDts: File = { path: `${project}/c.d.ts`, content: cTs.content }; + const expectedIndexDts: File = { path: `${project}/index.d.ts`, content: indexTs.content }; + const modifiedATsContent = aTs.content.replace("b: B;", `b: B; + foo: any;`); + return { + files: [libFile, aTs, bTs, cTs, indexTs, config], + expectedInitialEmit: [ + expectedADts, + expectedBDts, + expectedCDts, + expectedIndexDts, + { + path: `${project}/tsconfig.tsbuildinfo`, + content: getBuildInfoText({ + program: initialProgram, + version + }) + } + ], + expectedInitialErrors: emptyArray, + modifyFs: host => host.writeFile(aTs.path, modifiedATsContent), + expectedIncrementalEmit: [ + { path: expectedADts.path, content: modifiedATsContent }, + expectedBDts, + expectedCDts, + expectedIndexDts, + { + path: `${project}/tsconfig.tsbuildinfo`, + content: getBuildInfoText({ + program: { + fileInfos: { + [libFilePath]: libFileInfo, + "./c.ts": getFileInfo(cTs.content), + "./b.ts": getFileInfo(bTs.content), + "./a.ts": getFileInfo(modifiedATsContent), + "./index.ts": getFileInfo(indexTs.content) + }, + ...rest + }, + version + }) + } + ], + expectedIncrementalErrors: emptyArray + }; }); }); }); diff --git a/tests/baselines/reference/docker/azure-sdk.log b/tests/baselines/reference/docker/azure-sdk.log index 9ec9a2bf71e63..ce7e6e724ca18 100644 --- a/tests/baselines/reference/docker/azure-sdk.log +++ b/tests/baselines/reference/docker/azure-sdk.log @@ -2,47 +2,35 @@ Exit Code: 1 Standard output: Rush Multi-Project Build Tool 5.X.X - https://rushjs.io -Node.js version is 12.9.0 (pre-LTS) +Node.js version is 12.9.1 (pre-LTS) Starting "rush rebuild" Executing a maximum of ?simultaneous processes... XX of XX: [@azure/abort-controller] completed successfully in ? seconds XX of XX: [@azure/core-auth] completed successfully in ? seconds -npm ERR! code ELIFECYCLE -npm ERR! errno 2 -npm ERR! @azure/core-http@X.X.X-preview.3 build:tsc: `tsc -p tsconfig.es.json` -npm ERR! Exit status 2 -npm ERR! -npm ERR! Failed at the @azure/core-http@X.X.X-preview.3 build:tsc script. -npm ERR! This is probably not a problem with npm. There is likely additional logging output above. -npm ERR! A complete log of this run can be found in: -npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log -ERROR: "build:tsc" exited with 2. -npm ERR! code ELIFECYCLE -npm ERR! errno 1 -npm ERR! @azure/core-http@X.X.X-preview.3 build:lib: `run-s build:tsc build:rollup build:minify-browser` -npm ERR! Exit status 1 -npm ERR! -npm ERR! Failed at the @azure/core-http@X.X.X-preview.3 build:lib script. -npm ERR! This is probably not a problem with npm. There is likely additional logging output above. -npm ERR! A complete log of this run can be found in: -npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log -ERROR: "build:lib" exited with 1. -XX of XX: [@azure/event-processor-host] completed successfully in ? seconds +XX of XX: [@azure/core-tracing] completed successfully in ? seconds +XX of XX: [@azure/core-http] completed successfully in ? seconds +XX of XX: [@azure/core-arm] completed successfully in ? seconds +XX of XX: [@azure/core-paging] completed successfully in ? seconds +XX of XX: [@azure/identity] completed successfully in ? seconds XX of XX: [@azure/test-utils-recorder] completed successfully in ? seconds +XX of XX: [@azure/core-amqp] completed successfully in ? seconds +XX of XX: [@azure/event-processor-host] completed successfully in ? seconds +XX of XX: [@azure/keyvault-keys] completed successfully in ? seconds +XX of XX: [@azure/keyvault-secrets] completed successfully in ? seconds +XX of XX: [@azure/app-configuration] completed successfully in ? seconds XX of XX: [@azure/core-asynciterator-polyfill] completed successfully in ? seconds -XX of XX: [@azure/core-paging] completed successfully in ? seconds -XX of XX: [@azure/core-tracing] completed successfully in ? seconds Warning: You have changed the public API signature for this project. Updating review/cosmos.api.md dist-esm/index.js → dist/index.js... (!) Unresolved dependencies https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency -tslib (imported by dist-esm/queryIterator.js, dist-esm/auth.js, dist-esm/CosmosClient.js, dist-esm/plugins/Plugin.js, dist-esm/ClientContext.js, dist-esm/globalEndpointManager.js, dist-esm/client/Conflict/Conflict.js, dist-esm/client/Container/Container.js, dist-esm/client/Container/Containers.js, dist-esm/client/Database/Database.js, dist-esm/client/Database/Databases.js, dist-esm/client/Item/Item.js, dist-esm/client/Item/Items.js, dist-esm/client/Offer/Offer.js, dist-esm/client/Permission/Permission.js, dist-esm/client/Permission/Permissions.js, dist-esm/client/StoredProcedure/StoredProcedure.js, dist-esm/client/StoredProcedure/StoredProcedures.js, dist-esm/client/Trigger/Trigger.js, dist-esm/client/Trigger/Triggers.js, dist-esm/client/User/User.js, dist-esm/client/User/Users.js, dist-esm/client/UserDefinedFunction/UserDefinedFunction.js, dist-esm/client/UserDefinedFunction/UserDefinedFunctions.js, dist-esm/queryExecutionContext/defaultQueryExecutionContext.js, dist-esm/queryExecutionContext/documentProducer.js, dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/queryExecutionContext/pipelinedQueryExecutionContext.js, dist-esm/request/request.js, dist-esm/request/RequestHandler.js, dist-esm/ChangeFeedIterator.js, dist-esm/routing/smartRoutingMapProvider.js, dist-esm/queryExecutionContext/EndpointComponent/AggregateEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js, dist-esm/retry/retryUtility.js, dist-esm/routing/partitionKeyRangeCache.js, dist-esm/retry/defaultRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/retry/resourceThrottleRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js) +tslib (imported by dist-esm/auth.js, dist-esm/queryIterator.js, dist-esm/CosmosClient.js, dist-esm/plugins/Plugin.js, dist-esm/ClientContext.js, dist-esm/globalEndpointManager.js, dist-esm/client/Conflict/Conflict.js, dist-esm/client/Container/Container.js, dist-esm/client/Container/Containers.js, dist-esm/client/Database/Database.js, dist-esm/client/Database/Databases.js, dist-esm/client/Item/Item.js, dist-esm/client/Item/Items.js, dist-esm/client/Offer/Offer.js, dist-esm/client/Permission/Permission.js, dist-esm/client/Permission/Permissions.js, dist-esm/client/StoredProcedure/StoredProcedure.js, dist-esm/client/StoredProcedure/StoredProcedures.js, dist-esm/client/Trigger/Trigger.js, dist-esm/client/Trigger/Triggers.js, dist-esm/client/User/User.js, dist-esm/client/User/Users.js, dist-esm/client/UserDefinedFunction/UserDefinedFunctions.js, dist-esm/client/UserDefinedFunction/UserDefinedFunction.js, dist-esm/queryExecutionContext/documentProducer.js, dist-esm/queryExecutionContext/defaultQueryExecutionContext.js, dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/queryExecutionContext/pipelinedQueryExecutionContext.js, dist-esm/request/request.js, dist-esm/request/RequestHandler.js, dist-esm/ChangeFeedIterator.js, dist-esm/routing/smartRoutingMapProvider.js, dist-esm/queryExecutionContext/EndpointComponent/AggregateEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js, dist-esm/retry/retryUtility.js, dist-esm/routing/partitionKeyRangeCache.js, dist-esm/retry/defaultRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/retry/resourceThrottleRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js) @azure/cosmos-sign (imported by dist-esm/auth.js) universal-user-agent (imported by dist-esm/common/platform.js) -uuid/v4 (imported by dist-esm/client/Item/Items.js) +uuid/v4 (imported by dist-esm/ClientContext.js, dist-esm/client/Item/Items.js) binary-search-bounds (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/routing/inMemoryCollectionRoutingMap.js) priorityqueuejs (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js) semaphore (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js) +debug (imported by dist-esm/common/logger.js) node-abort-controller (imported by dist-esm/request/RequestHandler.js) node-fetch (imported by dist-esm/request/RequestHandler.js) atob (imported by dist-esm/session/sessionContainer.js) @@ -53,6 +41,7 @@ Use output.globals to specify browser global variable names corresponding to ext universal-user-agent (guessing 'userAgent') tslib (guessing 'tslib') @azure/cosmos-sign (guessing 'cosmosSign') +debug (guessing 'debugLib') binary-search-bounds (guessing 'bs') priorityqueuejs (guessing 'PriorityQueue') semaphore (guessing 'semaphore') @@ -66,39 +55,52 @@ atob (guessing 'atob') (!) Circular dependency: dist-esm/index.js -> dist-esm/CosmosClient.js -> dist-esm/client/Database/index.js -> dist-esm/client/Database/Database.js -> dist-esm/client/Container/index.js -> dist-esm/client/Container/Container.js -> dist-esm/client/Script/Scripts.js -> dist-esm/index.js (!) Circular dependency: dist-esm/request/RequestHandler.js -> dist-esm/retry/retryUtility.js -> dist-esm/request/RequestHandler.js created dist/index.js in ?s +Warning: You have changed the public API signature for this project. Updating review/event-hubs.api.md +XX of XX: [@azure/keyvault-certificates] completed successfully in ? seconds Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md XX of XX: [@azure/storage-blob] completed successfully in ? seconds XX of XX: [@azure/storage-file] completed successfully in ? seconds XX of XX: [@azure/storage-queue] completed successfully in ? seconds +XX of XX: [@azure/template] completed successfully in ? seconds XX of XX: [testhub] completed successfully in ? seconds -SUCCESS (11) +SUCCESS (20) ================================ @azure/abort-controller (? seconds) @azure/core-auth (? seconds) -@azure/event-processor-host (? seconds) +@azure/core-tracing (? seconds) +@azure/core-http (? seconds) +@azure/core-arm (? seconds) +@azure/core-paging (? seconds) +@azure/identity (? seconds) @azure/test-utils-recorder (? seconds) +@azure/core-amqp (? seconds) +@azure/event-processor-host (? seconds) +@azure/keyvault-keys (? seconds) +@azure/keyvault-secrets (? seconds) +@azure/app-configuration (? seconds) @azure/core-asynciterator-polyfill (? seconds) -@azure/core-paging (? seconds) -@azure/core-tracing (? seconds) +@azure/keyvault-certificates (? seconds) @azure/storage-blob (? seconds) @azure/storage-file (? seconds) @azure/storage-queue (? seconds) +@azure/template (? seconds) testhub (? seconds) ================================ -SUCCESS WITH WARNINGS (2) +SUCCESS WITH WARNINGS (3) ================================ @azure/cosmos (? seconds) Warning: You have changed the public API signature for this project. Updating review/cosmos.api.md dist-esm/index.js → dist/index.js... (!) Unresolved dependencies https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency -tslib (imported by dist-esm/queryIterator.js, dist-esm/auth.js, dist-esm/CosmosClient.js, dist-esm/plugins/Plugin.js, dist-esm/ClientContext.js, dist-esm/globalEndpointManager.js, dist-esm/client/Conflict/Conflict.js, dist-esm/client/Container/Container.js, dist-esm/client/Container/Containers.js, dist-esm/client/Database/Database.js, dist-esm/client/Database/Databases.js, dist-esm/client/Item/Item.js, dist-esm/client/Item/Items.js, dist-esm/client/Offer/Offer.js, dist-esm/client/Permission/Permission.js, dist-esm/client/Permission/Permissions.js, dist-esm/client/StoredProcedure/StoredProcedure.js, dist-esm/client/StoredProcedure/StoredProcedures.js, dist-esm/client/Trigger/Trigger.js, dist-esm/client/Trigger/Triggers.js, dist-esm/client/User/User.js, dist-esm/client/User/Users.js, dist-esm/client/UserDefinedFunction/UserDefinedFunction.js, dist-esm/client/UserDefinedFunction/UserDefinedFunctions.js, dist-esm/queryExecutionContext/defaultQueryExecutionContext.js, dist-esm/queryExecutionContext/documentProducer.js, dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/queryExecutionContext/pipelinedQueryExecutionContext.js, dist-esm/request/request.js, dist-esm/request/RequestHandler.js, dist-esm/ChangeFeedIterator.js, dist-esm/routing/smartRoutingMapProvider.js, dist-esm/queryExecutionContext/EndpointComponent/AggregateEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js, dist-esm/retry/retryUtility.js, dist-esm/routing/partitionKeyRangeCache.js, dist-esm/retry/defaultRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/retry/resourceThrottleRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js) +tslib (imported by dist-esm/auth.js, dist-esm/queryIterator.js, dist-esm/CosmosClient.js, dist-esm/plugins/Plugin.js, dist-esm/ClientContext.js, dist-esm/globalEndpointManager.js, dist-esm/client/Conflict/Conflict.js, dist-esm/client/Container/Container.js, dist-esm/client/Container/Containers.js, dist-esm/client/Database/Database.js, dist-esm/client/Database/Databases.js, dist-esm/client/Item/Item.js, dist-esm/client/Item/Items.js, dist-esm/client/Offer/Offer.js, dist-esm/client/Permission/Permission.js, dist-esm/client/Permission/Permissions.js, dist-esm/client/StoredProcedure/StoredProcedure.js, dist-esm/client/StoredProcedure/StoredProcedures.js, dist-esm/client/Trigger/Trigger.js, dist-esm/client/Trigger/Triggers.js, dist-esm/client/User/User.js, dist-esm/client/User/Users.js, dist-esm/client/UserDefinedFunction/UserDefinedFunctions.js, dist-esm/client/UserDefinedFunction/UserDefinedFunction.js, dist-esm/queryExecutionContext/documentProducer.js, dist-esm/queryExecutionContext/defaultQueryExecutionContext.js, dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/queryExecutionContext/pipelinedQueryExecutionContext.js, dist-esm/request/request.js, dist-esm/request/RequestHandler.js, dist-esm/ChangeFeedIterator.js, dist-esm/routing/smartRoutingMapProvider.js, dist-esm/queryExecutionContext/EndpointComponent/AggregateEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js, dist-esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js, dist-esm/retry/retryUtility.js, dist-esm/routing/partitionKeyRangeCache.js, dist-esm/retry/defaultRetryPolicy.js, dist-esm/retry/endpointDiscoveryRetryPolicy.js, dist-esm/retry/resourceThrottleRetryPolicy.js, dist-esm/retry/sessionRetryPolicy.js) @azure/cosmos-sign (imported by dist-esm/auth.js) universal-user-agent (imported by dist-esm/common/platform.js) -uuid/v4 (imported by dist-esm/client/Item/Items.js) +uuid/v4 (imported by dist-esm/ClientContext.js, dist-esm/client/Item/Items.js) binary-search-bounds (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js, dist-esm/routing/inMemoryCollectionRoutingMap.js) priorityqueuejs (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js) semaphore (imported by dist-esm/queryExecutionContext/parallelQueryExecutionContextBase.js) +debug (imported by dist-esm/common/logger.js) node-abort-controller (imported by dist-esm/request/RequestHandler.js) node-fetch (imported by dist-esm/request/RequestHandler.js) atob (imported by dist-esm/session/sessionContainer.js) @@ -109,6 +111,7 @@ Use output.globals to specify browser global variable names corresponding to ext universal-user-agent (guessing 'userAgent') tslib (guessing 'tslib') @azure/cosmos-sign (guessing 'cosmosSign') +debug (guessing 'debugLib') binary-search-bounds (guessing 'bs') priorityqueuejs (guessing 'PriorityQueue') semaphore (guessing 'semaphore') @@ -122,60 +125,17 @@ atob (guessing 'atob') (!) Circular dependency: dist-esm/index.js -> dist-esm/CosmosClient.js -> dist-esm/client/Database/index.js -> dist-esm/client/Database/Database.js -> dist-esm/client/Container/index.js -> dist-esm/client/Container/Container.js -> dist-esm/client/Script/Scripts.js -> dist-esm/index.js (!) Circular dependency: dist-esm/request/RequestHandler.js -> dist-esm/retry/retryUtility.js -> dist-esm/request/RequestHandler.js created dist/index.js in ?s +@azure/event-hubs (? seconds) +Warning: You have changed the public API signature for this project. Updating review/event-hubs.api.md @azure/service-bus (? seconds) Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md ================================ -BLOCKED (8) -================================ -@azure/identity -@azure/core-amqp -@azure/core-arm -@azure/event-hubs -@azure/keyvault-certificates -@azure/keyvault-keys -@azure/keyvault-secrets -@azure/template -================================ -FAILURE (1) -================================ -@azure/core-http ( ? seconds) -npm ERR! code ELIFECYCLE -npm ERR! errno 2 -npm ERR! @azure/core-http@X.X.X-preview.3 build:tsc: `tsc -p tsconfig.es.json` -npm ERR! Exit status 2 -npm ERR! -npm ERR! Failed at the @azure/core-http@X.X.X-preview.3 build:tsc script. -npm ERR! This is probably not a problem with npm. There is likely additional logging output above. -npm ERR! A complete log of this run can be found in: -npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log -ERROR: "build:tsc" exited with 2. -npm ERR! code ELIFECYCLE -npm ERR! errno 1 -npm ERR! @azure/core-http@X.X.X-preview.3 build:lib: `run-s build:tsc build:rollup build:minify-browser` -npm ERR! Exit status 1 -npm ERR! -npm ERR! Failed at the @azure/core-http@X.X.X-preview.3 build:lib script. -npm ERR! This is probably not a problem with npm. There is likely additional logging output above. -npm ERR! A complete log of this run can be found in: -npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log -ERROR: "build:lib" exited with 1. -================================ -Error: Project(s) failed to build -rush rebuild - Errors! ( ? seconds) +rush rebuild ( ? seconds) Standard error: - -XX of XX: [@azure/core-http] failed to build! -XX of XX: [@azure/core-arm] blocked by [@azure/core-http]! -XX of XX: [@azure/keyvault-certificates] blocked by [@azure/core-http]! -XX of XX: [@azure/keyvault-keys] blocked by [@azure/core-http]! -XX of XX: [@azure/keyvault-secrets] blocked by [@azure/core-http]! -XX of XX: [@azure/identity] blocked by [@azure/core-http]! -XX of XX: [@azure/core-amqp] blocked by [@azure/core-http]! -XX of XX: [@azure/event-hubs] blocked by [@azure/core-http]! -XX of XX: [@azure/template] blocked by [@azure/core-http]! XX of XX: [@azure/cosmos] completed with warnings in ? seconds +XX of XX: [@azure/event-hubs] completed with warnings in ? seconds XX of XX: [@azure/service-bus] completed with warnings in ? seconds -[@azure/core-http] Returned error code: 1 +Project(s) succeeded with warnings diff --git a/tests/baselines/reference/docker/office-ui-fabric.log b/tests/baselines/reference/docker/office-ui-fabric.log index fbdb089dd032d..01858ab7d2aba 100644 --- a/tests/baselines/reference/docker/office-ui-fabric.log +++ b/tests/baselines/reference/docker/office-ui-fabric.log @@ -3,16 +3,31 @@ Standard output: @uifabric/codepen-loader: yarn run vX.X.X @uifabric/codepen-loader: $ just-scripts build --production --lint @uifabric/codepen-loader: [XX:XX:XX XM] ■ Removing [lib, temp, dist, coverage, lib-commonjs] -@uifabric/codepen-loader: [XX:XX:XX XM] ■ Copying [../office-ui-fabric-react/src/utilities/exampleData.ts, ../office-ui-fabric-react/src/components/ExtendedPicker/examples/PeopleExampleData.ts, ../office-ui-fabric-react/src/common/TestImages.ts] to 'lib' @uifabric/codepen-loader: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/codepen-loader/tsconfig.json @uifabric/codepen-loader: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --module commonjs --outDir "./lib" --project "/office-ui-fabric-react/packages/codepen-loader/tsconfig.json" @uifabric/codepen-loader: [XX:XX:XX XM] ■ Running Jest -@uifabric/codepen-loader: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/codepen-loader/jest.config.js" --passWithNoTests --colors +@uifabric/codepen-loader: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/codepen-loader/jest.config.js" --passWithNoTests --colors --forceExit @uifabric/codepen-loader: PASS src/__tests__/codepenTransform.test.ts @uifabric/codepen-loader: Done in ?s. @uifabric/build: yarn run vX.X.X @uifabric/build: $ node ./just-scripts.js no-op --production --lint @uifabric/build: Done in ?s. +@uifabric/example-data: yarn run vX.X.X +@uifabric/example-data: $ just-scripts build --production --lint +@uifabric/example-data: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts] +@uifabric/example-data: [XX:XX:XX XM] ■ Running tslint +@uifabric/example-data: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/tslint/lib/tslintCli.js" --project "/office-ui-fabric-react/packages/example-data/tsconfig.json" -t stylish -r /office-ui-fabric-react/node_modules/tslint-microsoft-contrib +@uifabric/example-data: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/example-data/tsconfig.json +@uifabric/example-data: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/example-data/tsconfig.json" +@uifabric/example-data: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/example-data/tsconfig.json +@uifabric/example-data: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/example-data/tsconfig.json" +@uifabric/example-data: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/example-data/tsconfig.json +@uifabric/example-data: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/example-data/tsconfig.json" +@uifabric/example-data: [XX:XX:XX XM] ■ Running Webpack +@uifabric/example-data: [XX:XX:XX XM] ■ Webpack Config Path: /office-ui-fabric-react/packages/example-data/webpack.config.js +@uifabric/example-data: Webpack version: 4.29.5 +@uifabric/example-data: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/example-data/lib/index.d.ts' +@uifabric/example-data: Done in ?s. @uifabric/migration: yarn run vX.X.X @uifabric/migration: $ just-scripts build --production --lint @uifabric/migration: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts] @@ -54,7 +69,7 @@ Standard output: @uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json @uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json" @uifabric/merge-styles: [XX:XX:XX XM] ■ Running Jest -@uifabric/merge-styles: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/merge-styles/jest.config.js" --passWithNoTests --colors +@uifabric/merge-styles: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/merge-styles/jest.config.js" --passWithNoTests --colors --forceExit @uifabric/merge-styles: [XX:XX:XX XM] ■ Running Webpack @uifabric/merge-styles: [XX:XX:XX XM] ■ Webpack Config Path: /office-ui-fabric-react/packages/merge-styles/webpack.config.js @uifabric/merge-styles: Webpack version: 4.29.5 @@ -70,7 +85,6 @@ Standard output: @uifabric/merge-styles: PASS src/extractStyleParts.test.ts @uifabric/merge-styles: PASS src/server.test.ts @uifabric/merge-styles: PASS src/fontFace.test.ts -@uifabric/merge-styles: PASS src/transforms/kebabRules.test.ts @uifabric/merge-styles: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/merge-styles/lib/index.d.ts' @uifabric/merge-styles: Done in ?s. @uifabric/jest-serializer-merge-styles: yarn run vX.X.X @@ -82,7 +96,7 @@ Standard output: @uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json @uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json" @uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running Jest -@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/jest-serializer-merge-styles/jest.config.js" --passWithNoTests --colors +@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/jest-serializer-merge-styles/jest.config.js" --passWithNoTests --colors --forceExit @uifabric/jest-serializer-merge-styles: PASS src/index.test.tsx @uifabric/jest-serializer-merge-styles: Done in ?s. @uifabric/test-utilities: yarn run vX.X.X @@ -107,7 +121,7 @@ Standard output: @uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json @uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/utilities/tsconfig.json" @uifabric/utilities: [XX:XX:XX XM] ■ Running Jest -@uifabric/utilities: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/utilities/jest.config.js" --passWithNoTests --colors +@uifabric/utilities: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/utilities/jest.config.js" --passWithNoTests --colors --forceExit @uifabric/utilities: [XX:XX:XX XM] ■ Running Webpack @uifabric/utilities: [XX:XX:XX XM] ■ Webpack Config Path: null @uifabric/utilities: [XX:XX:XX XM] ■ webpack.config.js not found, skipping webpack @@ -145,7 +159,6 @@ Standard output: @uifabric/utilities: PASS src/initializeComponentRef.test.tsx @uifabric/utilities: PASS src/BaseComponent.test.tsx @uifabric/utilities: PASS src/keyboard.test.ts -@uifabric/utilities: PASS src/css.test.ts @uifabric/utilities: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/utilities/lib/index.d.ts' @uifabric/utilities: Done in ?s. @uifabric/styling: yarn run vX.X.X @@ -160,15 +173,13 @@ Standard output: @uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json @uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/styling/tsconfig.json" @uifabric/styling: [XX:XX:XX XM] ■ Running Jest -@uifabric/styling: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/styling/jest.config.js" --passWithNoTests --colors +@uifabric/styling: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/styling/jest.config.js" --passWithNoTests --colors --forceExit @uifabric/styling: [XX:XX:XX XM] ■ Running Webpack @uifabric/styling: [XX:XX:XX XM] ■ Webpack Config Path: null @uifabric/styling: [XX:XX:XX XM] ■ webpack.config.js not found, skipping webpack @uifabric/styling: PASS src/styles/theme.test.ts @uifabric/styling: PASS src/styles/scheme.test.ts @uifabric/styling: PASS src/styles/getGlobalClassNames.test.ts -@uifabric/styling: PASS src/utilities/icons.test.ts -@uifabric/styling: PASS src/styles/fonts.test.ts @uifabric/styling: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/styling/lib/index.d.ts' @uifabric/styling: Done in ?s. @uifabric/file-type-icons: yarn run vX.X.X @@ -198,12 +209,11 @@ Standard output: @uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json @uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/foundation/tsconfig.json" @uifabric/foundation: [XX:XX:XX XM] ■ Running Jest -@uifabric/foundation: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/foundation/jest.config.js" --passWithNoTests --colors +@uifabric/foundation: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/foundation/jest.config.js" --passWithNoTests --colors --forceExit @uifabric/foundation: [XX:XX:XX XM] ■ Running Webpack @uifabric/foundation: [XX:XX:XX XM] ■ Webpack Config Path: /office-ui-fabric-react/packages/foundation/webpack.config.js @uifabric/foundation: Webpack version: 4.29.5 @uifabric/foundation: FAIL src/slots.test.tsx -@uifabric/foundation: PASS src/hooks/controlled.test.tsx @uifabric/foundation: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. @@ -211,16 +221,32 @@ Standard output: Standard error: info cli using local version of lerna lerna notice cli vX.X.X -lerna info Executing command in 40 packages: "yarn run build --production --lint" +lerna info Executing command in 41 packages: "yarn run build --production --lint" @uifabric/codepen-loader: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +@uifabric/codepen-loader: Force exiting Jest +@uifabric/codepen-loader: +@uifabric/codepen-loader: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished? +@uifabric/example-data: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect @uifabric/set-version: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect @uifabric/merge-styles: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect @uifabric/merge-styles: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +@uifabric/merge-styles: Force exiting Jest +@uifabric/merge-styles: +@uifabric/merge-styles: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished? @uifabric/jest-serializer-merge-styles: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +@uifabric/jest-serializer-merge-styles: Force exiting Jest +@uifabric/jest-serializer-merge-styles: +@uifabric/jest-serializer-merge-styles: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished? @uifabric/utilities: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect @uifabric/utilities: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +@uifabric/utilities: Force exiting Jest +@uifabric/utilities: +@uifabric/utilities: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished? @uifabric/styling: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect @uifabric/styling: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. +@uifabric/styling: Force exiting Jest +@uifabric/styling: +@uifabric/styling: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished? @uifabric/file-type-icons: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect @uifabric/foundation: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect @uifabric/foundation: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions. @@ -421,10 +447,13 @@ lerna info Executing command in 40 packages: "yarn run build --production --lint @uifabric/foundation: at _renderSlot (src/slots.tsx:221:100) @uifabric/foundation: at Object.slot [as testSlot1] (src/slots.tsx:142:16) @uifabric/foundation: at Object. (src/slots.test.tsx:399:24) +@uifabric/foundation: Force exiting Jest +@uifabric/foundation: +@uifabric/foundation: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished? @uifabric/foundation: [XX:XX:XX XM] x Error detected while running 'jest' @uifabric/foundation: [XX:XX:XX XM] x ------------------------------------ -@uifabric/foundation: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors -@uifabric/foundation: at ChildProcess. (/office-ui-fabric-react/node_modules/just-scripts-utils/lib/exec.js:70:31) +@uifabric/foundation: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors --forceExit +@uifabric/foundation: at ChildProcess. (/office-ui-fabric-react/node_modules/just-scripts/node_modules/just-scripts-utils/lib/exec.js:70:31) @uifabric/foundation: at ChildProcess.emit (events.js:209:13) @uifabric/foundation: at ChildProcess.EventEmitter.emit (domain.js:499:23) @uifabric/foundation: at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) diff --git a/tests/baselines/reference/docker/vscode.log b/tests/baselines/reference/docker/vscode.log index 4775203f50ee8..8bc85ffef1263 100644 --- a/tests/baselines/reference/docker/vscode.log +++ b/tests/baselines/reference/docker/vscode.log @@ -1,11 +1,10 @@ -Exit Code: 1 +Exit Code: 0 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 -[XX:XX:XX] Error: /vscode/node_modules/@types/node/index.d.ts(179,11): Duplicate identifier 'IteratorResult'. -info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +Done in ?s. @@ -13,15 +12,3 @@ Standard error: {"type":"warning","data":"package.json: No license field"} {"type":"warning","data":"../package.json: No license field"} {"type":"warning","data":"vscode-web@X.X.X: No license field"} -[XX:XX:XX] 'compile' errored after ?s -[XX:XX:XX] Error: Found 1 errors - at Stream. (/vscode/build/lib/reporter.js:74:29) - at _end (/vscode/node_modules/through/index.js:65:9) - at Stream.stream.end (/vscode/node_modules/through/index.js:74:5) - at StreamFilter.onend (/vscode/node_modules/readable-stream/lib/_stream_readable.js:570:10) - at Object.onceWrapper (events.js:286:20) - at StreamFilter.emit (events.js:203:15) - at StreamFilter.EventEmitter.emit (domain.js:466:23) - at endReadableNT (/vscode/node_modules/readable-stream/lib/_stream_readable.js:992:12) - at process._tickCallback (internal/process/next_tick.js:63:19) -error Command failed with exit code 1. diff --git a/tests/baselines/reference/enumTagOnExports.symbols b/tests/baselines/reference/enumTagOnExports.symbols new file mode 100644 index 0000000000000..89257c00d49e0 --- /dev/null +++ b/tests/baselines/reference/enumTagOnExports.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/jsdoc/enumTagOnExports.js === +/** @enum {number} */ +exports.a = {}; +>exports.a : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4)) +>exports : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4)) +>a : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4)) + +/** @enum {string} */ +module.exports.b = {}; +>module.exports.b : Symbol(b, Decl(enumTagOnExports.js, 1, 15), Decl(enumTagOnExports.js, 4, 15), Decl(enumTagOnExports.js, 3, 4)) +>module.exports : Symbol(b, Decl(enumTagOnExports.js, 1, 15), Decl(enumTagOnExports.js, 4, 15), Decl(enumTagOnExports.js, 3, 4)) +>module : Symbol(module, Decl(enumTagOnExports.js, 1, 15)) +>exports : Symbol("tests/cases/conformance/jsdoc/enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) +>b : Symbol(b, Decl(enumTagOnExports.js, 1, 15), Decl(enumTagOnExports.js, 4, 15), Decl(enumTagOnExports.js, 3, 4)) + diff --git a/tests/baselines/reference/enumTagOnExports.types b/tests/baselines/reference/enumTagOnExports.types new file mode 100644 index 0000000000000..853e5ec090474 --- /dev/null +++ b/tests/baselines/reference/enumTagOnExports.types @@ -0,0 +1,19 @@ +=== tests/cases/conformance/jsdoc/enumTagOnExports.js === +/** @enum {number} */ +exports.a = {}; +>exports.a = {} : {} +>exports.a : typeof a +>exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports") +>a : typeof a +>{} : {} + +/** @enum {string} */ +module.exports.b = {}; +>module.exports.b = {} : {} +>module.exports.b : typeof b +>module.exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports") +>module : { "tests/cases/conformance/jsdoc/enumTagOnExports": typeof import("tests/cases/conformance/jsdoc/enumTagOnExports"); } +>exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports") +>b : typeof b +>{} : {} + diff --git a/tests/baselines/reference/enumTagOnExports2.symbols b/tests/baselines/reference/enumTagOnExports2.symbols new file mode 100644 index 0000000000000..9bca24fe024a0 --- /dev/null +++ b/tests/baselines/reference/enumTagOnExports2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/jsdoc/enumTagOnExports.js === +/** @enum {string} */ +module.exports = {}; +>module.exports : Symbol("tests/cases/conformance/jsdoc/enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) +>module : Symbol(module, Decl(enumTagOnExports.js, 0, 0)) +>exports : Symbol("tests/cases/conformance/jsdoc/enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) + diff --git a/tests/baselines/reference/enumTagOnExports2.types b/tests/baselines/reference/enumTagOnExports2.types new file mode 100644 index 0000000000000..9177307dde776 --- /dev/null +++ b/tests/baselines/reference/enumTagOnExports2.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/jsdoc/enumTagOnExports.js === +/** @enum {string} */ +module.exports = {}; +>module.exports = {} : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports") +>module.exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports") +>module : { "tests/cases/conformance/jsdoc/enumTagOnExports": typeof import("tests/cases/conformance/jsdoc/enumTagOnExports"); } +>exports : typeof import("tests/cases/conformance/jsdoc/enumTagOnExports") +>{} : {} + diff --git a/tests/baselines/reference/instanceMemberWithComputedPropertyName.js b/tests/baselines/reference/instanceMemberWithComputedPropertyName.js index eba55c9899e64..98b2960192cd7 100644 --- a/tests/baselines/reference/instanceMemberWithComputedPropertyName.js +++ b/tests/baselines/reference/instanceMemberWithComputedPropertyName.js @@ -1,5 +1,6 @@ //// [instanceMemberWithComputedPropertyName.ts] // https://github.com/microsoft/TypeScript/issues/30953 +"use strict"; const x = 1; class C { [x] = true; @@ -9,8 +10,9 @@ class C { } //// [instanceMemberWithComputedPropertyName.js] -var _a; // https://github.com/microsoft/TypeScript/issues/30953 +"use strict"; +var _a; var x = 1; var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/instanceMemberWithComputedPropertyName.symbols b/tests/baselines/reference/instanceMemberWithComputedPropertyName.symbols index 3d405c89cc87a..3c151df85c3e4 100644 --- a/tests/baselines/reference/instanceMemberWithComputedPropertyName.symbols +++ b/tests/baselines/reference/instanceMemberWithComputedPropertyName.symbols @@ -1,20 +1,21 @@ === tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberWithComputedPropertyName.ts === // https://github.com/microsoft/TypeScript/issues/30953 +"use strict"; const x = 1; ->x : Symbol(x, Decl(instanceMemberWithComputedPropertyName.ts, 1, 5)) +>x : Symbol(x, Decl(instanceMemberWithComputedPropertyName.ts, 2, 5)) class C { ->C : Symbol(C, Decl(instanceMemberWithComputedPropertyName.ts, 1, 12)) +>C : Symbol(C, Decl(instanceMemberWithComputedPropertyName.ts, 2, 12)) [x] = true; ->[x] : Symbol(C[x], Decl(instanceMemberWithComputedPropertyName.ts, 2, 9)) ->x : Symbol(x, Decl(instanceMemberWithComputedPropertyName.ts, 1, 5)) +>[x] : Symbol(C[x], Decl(instanceMemberWithComputedPropertyName.ts, 3, 9)) +>x : Symbol(x, Decl(instanceMemberWithComputedPropertyName.ts, 2, 5)) constructor() { const { a, b } = { a: 1, b: 2 }; ->a : Symbol(a, Decl(instanceMemberWithComputedPropertyName.ts, 5, 15)) ->b : Symbol(b, Decl(instanceMemberWithComputedPropertyName.ts, 5, 18)) ->a : Symbol(a, Decl(instanceMemberWithComputedPropertyName.ts, 5, 26)) ->b : Symbol(b, Decl(instanceMemberWithComputedPropertyName.ts, 5, 32)) +>a : Symbol(a, Decl(instanceMemberWithComputedPropertyName.ts, 6, 15)) +>b : Symbol(b, Decl(instanceMemberWithComputedPropertyName.ts, 6, 18)) +>a : Symbol(a, Decl(instanceMemberWithComputedPropertyName.ts, 6, 26)) +>b : Symbol(b, Decl(instanceMemberWithComputedPropertyName.ts, 6, 32)) } } diff --git a/tests/baselines/reference/instanceMemberWithComputedPropertyName.types b/tests/baselines/reference/instanceMemberWithComputedPropertyName.types index f98cc7bb80a84..412d795206eb4 100644 --- a/tests/baselines/reference/instanceMemberWithComputedPropertyName.types +++ b/tests/baselines/reference/instanceMemberWithComputedPropertyName.types @@ -1,5 +1,8 @@ === tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberWithComputedPropertyName.ts === // https://github.com/microsoft/TypeScript/issues/30953 +"use strict"; +>"use strict" : "use strict" + const x = 1; >x : 1 >1 : 1 diff --git a/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.errors.txt b/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.errors.txt new file mode 100644 index 0000000000000..09dd54b1b9873 --- /dev/null +++ b/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.errors.txt @@ -0,0 +1,20 @@ +tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx(10,21): error TS2304: Cannot find name 'React'. + + +==== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx (1 errors) ==== + interface F

{ + (props: P & { children?: boolean }): void; + propTypes: { [K in keyof P]: null extends P ? K : K }; + } + declare function g(C: F): string; + export function wu(CC: F) { + class WU { + m() { + g(CC) + return ; + ~~ +!!! error TS2304: Cannot find name 'React'. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.js b/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.js new file mode 100644 index 0000000000000..b6e6cd8a1d0d3 --- /dev/null +++ b/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.js @@ -0,0 +1,42 @@ +//// [quickIntersectionCheckCorrectlyCachesErrors.tsx] +interface F

{ + (props: P & { children?: boolean }): void; + propTypes: { [K in keyof P]: null extends P ? K : K }; +} +declare function g(C: F): string; +export function wu(CC: F) { + class WU { + m() { + g(CC) + return ; + } + } +} + + +//// [quickIntersectionCheckCorrectlyCachesErrors.js] +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +exports.__esModule = true; +function wu(CC) { + var WU = /** @class */ (function () { + function WU() { + } + WU.prototype.m = function () { + g(CC); + return React.createElement(CC, __assign({}, null)); + }; + return WU; + }()); +} +exports.wu = wu; diff --git a/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.symbols b/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.symbols new file mode 100644 index 0000000000000..d712254288488 --- /dev/null +++ b/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx === +interface F

{ +>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0)) +>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12)) + + (props: P & { children?: boolean }): void; +>props : Symbol(props, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 5)) +>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12)) +>children : Symbol(children, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 17)) + + propTypes: { [K in keyof P]: null extends P ? K : K }; +>propTypes : Symbol(F.propTypes, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 46)) +>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18)) +>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12)) +>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12)) +>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18)) +>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18)) +} +declare function g(C: F): string; +>g : Symbol(g, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 3, 1)) +>C : Symbol(C, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 4, 19)) +>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0)) + +export function wu(CC: F) { +>wu : Symbol(wu, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 4, 42)) +>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19)) +>o : Symbol(o, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 31)) +>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45)) +>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0)) +>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19)) + + class WU { +>WU : Symbol(WU, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 57)) + + m() { +>m : Symbol(WU.m, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 6, 14)) + + g(CC) +>g : Symbol(g, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 3, 1)) +>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45)) + + return ; +>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45)) +>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19)) + } + } +} + diff --git a/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.types b/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.types new file mode 100644 index 0000000000000..04153e6e1df8e --- /dev/null +++ b/tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx === +interface F

{ + (props: P & { children?: boolean }): void; +>props : P & { children?: boolean; } +>children : boolean + + propTypes: { [K in keyof P]: null extends P ? K : K }; +>propTypes : { [K in keyof P]: null extends P ? K : K; } +>null : null +} +declare function g(C: F): string; +>g : (C: F) => string +>C : F + +export function wu(CC: F) { +>wu : (CC: F) => void +>o : object +>CC : F + + class WU { +>WU : WU + + m() { +>m : () => any + + g(CC) +>g(CC) : string +>g : (C: F) => string +>CC : F + + return ; +> : any +>CC : F +>(null as unknown as CP) : CP +>null as unknown as CP : CP +>null as unknown : unknown +>null : null + } + } +} + diff --git a/tests/baselines/reference/transpile/Supports setting composite.js b/tests/baselines/reference/transpile/Supports setting composite.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting composite.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting composite.oldTranspile.js b/tests/baselines/reference/transpile/Supports setting composite.oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting composite.oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting incremental.js b/tests/baselines/reference/transpile/Supports setting incremental.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting incremental.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting incremental.oldTranspile.js b/tests/baselines/reference/transpile/Supports setting incremental.oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting incremental.oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting tsbuildinfo.js b/tests/baselines/reference/transpile/Supports setting tsbuildinfo.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting tsbuildinfo.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting tsbuildinfo.oldTranspile.js b/tests/baselines/reference/transpile/Supports setting tsbuildinfo.oldTranspile.js new file mode 100644 index 0000000000000..8394371f9081a --- /dev/null +++ b/tests/baselines/reference/transpile/Supports setting tsbuildinfo.oldTranspile.js @@ -0,0 +1,2 @@ +x; +//# sourceMappingURL=input.js.map \ No newline at end of file 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 new file mode 100644 index 0000000000000..9a793388ac0ad --- /dev/null +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -0,0 +1,103 @@ +//// [/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/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; };" + }, + "./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" + }, + "./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" + }, + "./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" + }, + "./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" + } + }, + "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 new file mode 100644 index 0000000000000..a86656dbed577 --- /dev/null +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -0,0 +1,99 @@ +//// [/src/lib/a.d.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} + + +//// [/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; };" + }, + "./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" + }, + "./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" + }, + "./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" + }, + "./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" + } + }, + "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 new file mode 100644 index 0000000000000..8a70278d3159b --- /dev/null +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -0,0 +1,84 @@ +//// [/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/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; };" + }, + "./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" + }, + "./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" + }, + "./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" + } + }, + "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 new file mode 100644 index 0000000000000..7facc60eef507 --- /dev/null +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -0,0 +1,75 @@ +//// [/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; };" + }, + "./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" + }, + "./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" + }, + "./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" + } + }, + "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 new file mode 100644 index 0000000000000..838bf28950f66 --- /dev/null +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-Build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -0,0 +1,123 @@ +//// [/src/lib/a.d.ts] +import { B } from "./b"; +export interface A { + b: B; +} +//# 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;CACN"} + +//// [/src/lib/b.d.ts] +import { C } from "./c"; +export interface B { + b: C; +} +//# sourceMappingURL=b.d.ts.map + +//// [/src/lib/b.d.ts.map] +{"version":3,"file":"b.d.ts","sourceRoot":"","sources":["../src/b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} + +//// [/src/lib/c.d.ts] +import { A } from "./a"; +export interface C { + a: A; +} +//# sourceMappingURL=c.d.ts.map + +//// [/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/lib/index.d.ts] +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; +//# sourceMappingURL=index.d.ts.map + +//// [/src/lib/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"} + +//// [/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; };" + }, + "./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" + }, + "./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" + }, + "./src/a.ts": { + "version": "-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n", + "signature": "-4935617457-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n}\r\n//# sourceMappingURL=a.d.ts.map" + }, + "./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" + } + }, + "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 new file mode 100644 index 0000000000000..d07b0914c3251 --- /dev/null +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-Build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -0,0 +1,132 @@ +//// [/src/lib/a.d.ts] +import { B } from "./b"; +export interface A { + b: B; +} + + +//// [/src/lib/b.d.ts] +import { C } from "./c"; +export interface B { + b: C; +} + + +//// [/src/lib/c.d.ts] +import { A } from "./a"; +export interface C { + a: A; +} + + +//// [/src/lib/index.d.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 + } +} + + +//// [/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; };" + }, + "./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" + }, + "./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" + }, + "./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" + }, + "./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" + } + }, + "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/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 new file mode 100644 index 0000000000000..86f7dc6e8bc8b --- /dev/null +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-Build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -0,0 +1,104 @@ +//// [/src/lib/a.d.ts] +export declare class B { + prop: string; +} +export interface A { + b: B; +} +//# 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;CACN"} + +//// [/src/lib/b.d.ts] +import { C } from "./c"; +export interface B { + b: C; +} +//# sourceMappingURL=b.d.ts.map + +//// [/src/lib/b.d.ts.map] +{"version":3,"file":"b.d.ts","sourceRoot":"","sources":["../src/b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} + +//// [/src/lib/c.d.ts] +import { A } from "./a"; +export interface C { + a: A; +} +//# sourceMappingURL=c.d.ts.map + +//// [/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/src/a.ts] +export class B { prop = "hello"; } + +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; };" + }, + "./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" + }, + "./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" + }, + "./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" + } + }, + "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/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 index 0c32ba7c1671d..727875a5d40d8 100644 --- 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 @@ -31,28 +31,28 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../bar.ts": { - "version": "747071916", - "signature": "-9232740537" + "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" }, "../bundling.ts": { - "version": "-21659820217", - "signature": "-40032907372" + "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" }, "../global.d.ts": { - "version": "-9780226215", - "signature": "-9780226215" + "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}" }, "../lazyindex.ts": { - "version": "-6956449754", - "signature": "-6224542381" + "version": "-6956449754-export { default as bar } from './bar';\n", + "signature": "-6224542381-export { default as bar } from './bar';\r\n" }, "../index.ts": { - "version": "-11602502901", - "signature": "6256067474" + "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" } }, "options": { 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 2a6aee9c8db47..a04669bd97159 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 @@ -69,28 +69,28 @@ exports.bar = bar_1.default; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../bar.ts": { - "version": "5936740878", - "signature": "11191036521" + "version": "5936740878-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(param: string): void {\r\n});", + "signature": "11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n" }, "../bundling.ts": { - "version": "-21659820217", - "signature": "-40032907372" + "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" }, "../global.d.ts": { - "version": "-9780226215", - "signature": "-9780226215" + "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}" }, "../lazyindex.ts": { - "version": "-6956449754", - "signature": "-6224542381" + "version": "-6956449754-export { default as bar } from './bar';\n", + "signature": "-6224542381-export { default as bar } from './bar';\r\n" }, "../index.ts": { - "version": "-11602502901", - "signature": "18468008756" + "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": "18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { 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 index 84fe88219b1fb..bdd697399683f 100644 --- 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 @@ -22,20 +22,20 @@ type A = HKT[typeof sym]; "program": { "fileInfos": { "../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./src/globals.d.ts": { - "version": "-1994196675", - "signature": "-1994196675" + "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;" }, "./src/hkt.ts": { - "version": "675797797", - "signature": "2373810515" + "version": "675797797-export interface HKT { }", + "signature": "2373810515-export interface HKT {\r\n}\r\n" }, "./src/main.ts": { - "version": "-27494779858", - "signature": "-7779857705" + "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" } }, "options": { 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 afb887c35f873..949eb773431c5 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 @@ -15,20 +15,20 @@ var x = 10; "program": { "fileInfos": { "../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./src/globals.d.ts": { - "version": "-1994196675", - "signature": "-1994196675" + "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;" }, "./src/hkt.ts": { - "version": "675797797", - "signature": "2373810515" + "version": "675797797-export interface HKT { }", + "signature": "2373810515-export interface HKT {\r\n}\r\n" }, "./src/main.ts": { - "version": "-28387946490", - "signature": "-7779857705" + "version": "-28387946490-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\nconst x = 10;\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" } }, "options": { 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 new file mode 100644 index 0000000000000..cd12638d637c9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-Build/synthesized-module-specifiers-resolve-correctly.js @@ -0,0 +1,168 @@ +//// [/lib/src/common/nominal.d.ts] +export declare type Nominal = T & { + [Symbol.species]: Name; +}; + + +//// [/lib/src/common/nominal.js] +"use strict"; +exports.__esModule = true; + + +//// [/lib/src/common/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib.d.ts": { + "version": "-32082413277-/// \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; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n", + "signature": "-32082413277-/// \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; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n" + }, + "../../../src/common/nominal.ts": { + "version": "-24498031910-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n", + "signature": "-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n" + } + }, + "options": { + "skipLibCheck": true, + "rootDir": "../../..", + "outDir": "../..", + "composite": true, + "configFilePath": "../../../src/common/tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../src/common/nominal.ts", + "../../lib.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/lib/src/sub-project/index.d.ts] +import { Nominal } from '../common/nominal'; +export declare type MyNominal = Nominal; + + +//// [/lib/src/sub-project/index.js] +"use strict"; +exports.__esModule = true; + + +//// [/lib/src/sub-project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib.d.ts": { + "version": "-32082413277-/// \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; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n", + "signature": "-32082413277-/// \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; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n" + }, + "../../../src/common/nominal.ts": { + "version": "-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n", + "signature": "-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n" + }, + "../../../src/sub-project/index.ts": { + "version": "-22894055505-import { Nominal } from '../common/nominal';\n\nexport type MyNominal = Nominal;\n", + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n" + } + }, + "options": { + "skipLibCheck": true, + "rootDir": "../../..", + "outDir": "../..", + "composite": true, + "configFilePath": "../../../src/sub-project/tsconfig.json" + }, + "referencedMap": { + "../../../src/sub-project/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "exportedModulesMap": { + "../../../src/sub-project/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../src/common/nominal.ts", + "../../../src/sub-project/index.ts", + "../../lib.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/lib/src/sub-project-2/index.d.ts] +declare const variable: { + key: import("../common/nominal").Nominal; +}; +export declare function getVar(): keyof typeof variable; +export {}; + + +//// [/lib/src/sub-project-2/index.js] +"use strict"; +exports.__esModule = true; +var variable = { + key: 'value' +}; +function getVar() { + return 'key'; +} +exports.getVar = getVar; + + +//// [/lib/src/sub-project-2/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib.d.ts": { + "version": "-32082413277-/// \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; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n", + "signature": "-32082413277-/// \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; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n" + }, + "../../../src/common/nominal.ts": { + "version": "-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n", + "signature": "-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n" + }, + "../../../src/sub-project/index.ts": { + "version": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n", + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n" + }, + "../../../src/sub-project-2/index.ts": { + "version": "-13939373533-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: 'value' as MyNominal,\n};\n\nexport function getVar(): keyof typeof variable {\n return 'key';\n}\n", + "signature": "-17233212183-declare const variable: {\r\n key: import(\"../common/nominal\").Nominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n" + } + }, + "options": { + "skipLibCheck": true, + "rootDir": "../../..", + "outDir": "../..", + "composite": true, + "configFilePath": "../../../src/sub-project-2/tsconfig.json" + }, + "referencedMap": { + "../../../src/sub-project-2/index.ts": [ + "../sub-project/index.d.ts" + ], + "../../../src/sub-project/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "exportedModulesMap": { + "../../../src/sub-project-2/index.ts": [ + "../common/nominal.d.ts" + ], + "../../../src/sub-project/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../src/common/nominal.ts", + "../../../src/sub-project-2/index.ts", + "../../../src/sub-project/index.ts", + "../../lib.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/resolves-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/resolves-correctly.js deleted file mode 100644 index 2ba8fa808170b..0000000000000 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/resolves-correctly.js +++ /dev/null @@ -1,348 +0,0 @@ -//// [/lib/src/common/nominal.d.ts] -export declare type Nominal = T & { - [Symbol.species]: Name; -}; - - -//// [/lib/src/common/nominal.js] -"use strict"; -exports.__esModule = true; - - -//// [/lib/src/common/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../../.ts/lib.es5.d.ts": { - "version": "406734842058", - "signature": "406734842058" - }, - "../../../.ts/lib.es2015.d.ts": { - "version": "57263133672", - "signature": "57263133672" - }, - "../../../.ts/lib.dom.d.ts": { - "version": "-1041975536091", - "signature": "-1041975536091" - }, - "../../../.ts/lib.es2015.core.d.ts": { - "version": "370321249768", - "signature": "370321249768" - }, - "../../../.ts/lib.es2015.collection.d.ts": { - "version": "-95997535017", - "signature": "-95997535017" - }, - "../../../.ts/lib.es2015.generator.d.ts": { - "version": "10837180865", - "signature": "10837180865" - }, - "../../../.ts/lib.es2015.iterable.d.ts": { - "version": "232404497324", - "signature": "232404497324" - }, - "../../../.ts/lib.es2015.promise.d.ts": { - "version": "235321148269", - "signature": "235321148269" - }, - "../../../.ts/lib.es2015.proxy.d.ts": { - "version": "55479865087", - "signature": "55479865087" - }, - "../../../.ts/lib.es2015.reflect.d.ts": { - "version": "30748787093", - "signature": "30748787093" - }, - "../../../.ts/lib.es2015.symbol.d.ts": { - "version": "9409688441", - "signature": "9409688441" - }, - "../../../.ts/lib.es2015.symbol.wellknown.d.ts": { - "version": "-67261006573", - "signature": "-67261006573" - }, - "../../../src/common/nominal.ts": { - "version": "-24498031910", - "signature": "-24498031910" - } - }, - "options": { - "skipLibCheck": true, - "rootDir": "../../..", - "outDir": "../..", - "lib": [ - "lib.dom.d.ts", - "lib.es2015.d.ts", - "lib.es2015.symbol.wellknown.d.ts" - ], - "composite": true, - "configFilePath": "../../../src/common/tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../../.ts/lib.dom.d.ts", - "../../../.ts/lib.es2015.collection.d.ts", - "../../../.ts/lib.es2015.core.d.ts", - "../../../.ts/lib.es2015.d.ts", - "../../../.ts/lib.es2015.generator.d.ts", - "../../../.ts/lib.es2015.iterable.d.ts", - "../../../.ts/lib.es2015.promise.d.ts", - "../../../.ts/lib.es2015.proxy.d.ts", - "../../../.ts/lib.es2015.reflect.d.ts", - "../../../.ts/lib.es2015.symbol.d.ts", - "../../../.ts/lib.es2015.symbol.wellknown.d.ts", - "../../../.ts/lib.es5.d.ts", - "../../../src/common/nominal.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/lib/src/sub-project/index.d.ts] -import { Nominal } from '../common/nominal'; -export declare type MyNominal = Nominal; - - -//// [/lib/src/sub-project/index.js] -"use strict"; -exports.__esModule = true; - - -//// [/lib/src/sub-project/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../../.ts/lib.es5.d.ts": { - "version": "406734842058", - "signature": "406734842058" - }, - "../../../.ts/lib.es2015.d.ts": { - "version": "57263133672", - "signature": "57263133672" - }, - "../../../.ts/lib.dom.d.ts": { - "version": "-1041975536091", - "signature": "-1041975536091" - }, - "../../../.ts/lib.es2015.core.d.ts": { - "version": "370321249768", - "signature": "370321249768" - }, - "../../../.ts/lib.es2015.collection.d.ts": { - "version": "-95997535017", - "signature": "-95997535017" - }, - "../../../.ts/lib.es2015.generator.d.ts": { - "version": "10837180865", - "signature": "10837180865" - }, - "../../../.ts/lib.es2015.iterable.d.ts": { - "version": "232404497324", - "signature": "232404497324" - }, - "../../../.ts/lib.es2015.promise.d.ts": { - "version": "235321148269", - "signature": "235321148269" - }, - "../../../.ts/lib.es2015.proxy.d.ts": { - "version": "55479865087", - "signature": "55479865087" - }, - "../../../.ts/lib.es2015.reflect.d.ts": { - "version": "30748787093", - "signature": "30748787093" - }, - "../../../.ts/lib.es2015.symbol.d.ts": { - "version": "9409688441", - "signature": "9409688441" - }, - "../../../.ts/lib.es2015.symbol.wellknown.d.ts": { - "version": "-67261006573", - "signature": "-67261006573" - }, - "../../../src/common/nominal.ts": { - "version": "-24498031910", - "signature": "-24498031910" - }, - "../../../src/sub-project/index.ts": { - "version": "-22894055505", - "signature": "-18559108619" - } - }, - "options": { - "skipLibCheck": true, - "rootDir": "../../..", - "outDir": "../..", - "lib": [ - "lib.dom.d.ts", - "lib.es2015.d.ts", - "lib.es2015.symbol.wellknown.d.ts" - ], - "composite": true, - "configFilePath": "../../../src/sub-project/tsconfig.json" - }, - "referencedMap": { - "../../../src/sub-project/index.ts": [ - "../common/nominal.d.ts" - ] - }, - "exportedModulesMap": { - "../../../src/sub-project/index.ts": [ - "../common/nominal.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../.ts/lib.dom.d.ts", - "../../../.ts/lib.es2015.collection.d.ts", - "../../../.ts/lib.es2015.core.d.ts", - "../../../.ts/lib.es2015.d.ts", - "../../../.ts/lib.es2015.generator.d.ts", - "../../../.ts/lib.es2015.iterable.d.ts", - "../../../.ts/lib.es2015.promise.d.ts", - "../../../.ts/lib.es2015.proxy.d.ts", - "../../../.ts/lib.es2015.reflect.d.ts", - "../../../.ts/lib.es2015.symbol.d.ts", - "../../../.ts/lib.es2015.symbol.wellknown.d.ts", - "../../../.ts/lib.es5.d.ts", - "../../../src/common/nominal.ts", - "../../../src/sub-project/index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/lib/src/sub-project-2/index.d.ts] -declare const variable: { - key: import("../common/nominal").Nominal; -}; -export declare function getVar(): keyof typeof variable; -export {}; - - -//// [/lib/src/sub-project-2/index.js] -"use strict"; -exports.__esModule = true; -var variable = { - key: 'value' -}; -function getVar() { - return 'key'; -} -exports.getVar = getVar; - - -//// [/lib/src/sub-project-2/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../../.ts/lib.es5.d.ts": { - "version": "406734842058", - "signature": "406734842058" - }, - "../../../.ts/lib.es2015.d.ts": { - "version": "57263133672", - "signature": "57263133672" - }, - "../../../.ts/lib.dom.d.ts": { - "version": "-1041975536091", - "signature": "-1041975536091" - }, - "../../../.ts/lib.es2015.core.d.ts": { - "version": "370321249768", - "signature": "370321249768" - }, - "../../../.ts/lib.es2015.collection.d.ts": { - "version": "-95997535017", - "signature": "-95997535017" - }, - "../../../.ts/lib.es2015.generator.d.ts": { - "version": "10837180865", - "signature": "10837180865" - }, - "../../../.ts/lib.es2015.iterable.d.ts": { - "version": "232404497324", - "signature": "232404497324" - }, - "../../../.ts/lib.es2015.promise.d.ts": { - "version": "235321148269", - "signature": "235321148269" - }, - "../../../.ts/lib.es2015.proxy.d.ts": { - "version": "55479865087", - "signature": "55479865087" - }, - "../../../.ts/lib.es2015.reflect.d.ts": { - "version": "30748787093", - "signature": "30748787093" - }, - "../../../.ts/lib.es2015.symbol.d.ts": { - "version": "9409688441", - "signature": "9409688441" - }, - "../../../.ts/lib.es2015.symbol.wellknown.d.ts": { - "version": "-67261006573", - "signature": "-67261006573" - }, - "../../../src/common/nominal.ts": { - "version": "-24498031910", - "signature": "-24498031910" - }, - "../../../src/sub-project/index.ts": { - "version": "-18559108619", - "signature": "-18559108619" - }, - "../../../src/sub-project-2/index.ts": { - "version": "-13939373533", - "signature": "-33844181688" - } - }, - "options": { - "skipLibCheck": true, - "rootDir": "../../..", - "outDir": "../..", - "lib": [ - "lib.dom.d.ts", - "lib.es2015.d.ts", - "lib.es2015.symbol.wellknown.d.ts" - ], - "composite": true, - "configFilePath": "../../../src/sub-project-2/tsconfig.json" - }, - "referencedMap": { - "../../../src/sub-project-2/index.ts": [ - "../sub-project/index.d.ts" - ], - "../../../src/sub-project/index.ts": [ - "../common/nominal.d.ts" - ] - }, - "exportedModulesMap": { - "../../../src/sub-project-2/index.ts": [ - "../common/nominal.d.ts" - ], - "../../../src/sub-project/index.ts": [ - "../common/nominal.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../.ts/lib.dom.d.ts", - "../../../.ts/lib.es2015.collection.d.ts", - "../../../.ts/lib.es2015.core.d.ts", - "../../../.ts/lib.es2015.d.ts", - "../../../.ts/lib.es2015.generator.d.ts", - "../../../.ts/lib.es2015.iterable.d.ts", - "../../../.ts/lib.es2015.promise.d.ts", - "../../../.ts/lib.es2015.proxy.d.ts", - "../../../.ts/lib.es2015.reflect.d.ts", - "../../../.ts/lib.es2015.symbol.d.ts", - "../../../.ts/lib.es2015.symbol.wellknown.d.ts", - "../../../.ts/lib.es5.d.ts", - "../../../src/common/nominal.ts", - "../../../src/sub-project-2/index.ts", - "../../../src/sub-project/index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js index be4e09ba5b5b8..f1124ae44eb79 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js @@ -172,20 +172,20 @@ export class someClass { } "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" }, "./index.ts": { - "version": "-13387000654", - "signature": "12514354613" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { @@ -212,20 +212,20 @@ export class someClass { } "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-2069755619", - "signature": "-2069755619" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "./index.ts": { - "version": "-5786964698", - "signature": "-6548680073" + "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" } }, "options": { @@ -262,24 +262,24 @@ export class someClass { } "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-2069755619", - "signature": "-2069755619" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "../logic/index.ts": { - "version": "-6548680073", - "signature": "-6548680073" + "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" }, "./index.ts": { - "version": "12336236525", - "signature": "-9209611" + "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" } }, "options": { 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 index bf28ddcc38613..8a87cafe69ea0 100644 --- 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 @@ -21,20 +21,20 @@ export declare function multiply(a: number, b: number): number; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "-8396256275" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { - "version": "-18749805970", - "signature": "1874987148" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { 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 index e93ed540970e4..ce9044faa05ca 100644 --- 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 @@ -37,24 +37,24 @@ exports.m = mod; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "../logic/index.ts": { - "version": "-6548680073", - "signature": "-6548680073" + "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" }, "./index.ts": { - "version": "12336236525", - "signature": "-9209611" + "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" } }, "options": { 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 index 13204cdf5662c..13d6ef5c3ba1e 100644 --- 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 @@ -25,20 +25,20 @@ export declare const m: typeof mod; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "./index.ts": { - "version": "-5786964698", - "signature": "-6548680073" + "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" } }, "options": { @@ -76,24 +76,24 @@ export declare const m: typeof mod; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "../logic/index.ts": { - "version": "-6548680073", - "signature": "-6548680073" + "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" }, "./index.ts": { - "version": "12336236525", - "signature": "-9209611" + "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" } }, "options": { 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 index bda1af5741cf0..d6c6fb4d8770c 100644 --- 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 @@ -31,20 +31,20 @@ define(["require", "exports"], function (require, exports) { "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "-8396256275" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { - "version": "-18749805970", - "signature": "1874987148" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { 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 index 99721cc54b960..0dc8156158d07 100644 --- 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 @@ -29,24 +29,24 @@ exports.multiply = multiply; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "8926001564", - "signature": "8926001564" + "version": "8926001564-/// \n/// ", + "signature": "8926001564-/// \n/// " }, "../../lib/lib.esnext.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "-8396256275" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { - "version": "-18749805970", - "signature": "1874987148" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { 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 index 2b4b56abbf808..82e64bc933046 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js @@ -25,20 +25,20 @@ class someClass { } "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" }, "./index.ts": { - "version": "-16698397488", - "signature": "11051732871" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-Build/sample.js b/tests/baselines/reference/tsbuild/sample1/initial-Build/sample.js index 829dbe1718f89..7a9f9a2ea9572 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-Build/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-Build/sample.js @@ -185,20 +185,20 @@ exports.multiply = multiply; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" }, "./index.ts": { - "version": "-18749805970", - "signature": "11051732871" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { @@ -370,20 +370,20 @@ sourceFile:index.ts "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "./index.ts": { - "version": "-5786964698", - "signature": "-6548680073" + "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" } }, "options": { @@ -436,24 +436,24 @@ exports.m = mod; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "../logic/index.ts": { - "version": "-6548680073", - "signature": "-6548680073" + "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" }, "./index.ts": { - "version": "12336236525", - "signature": "-9209611" + "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" } }, "options": { 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 7c05255bfd12c..61e87a815aa89 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 @@ -27,20 +27,20 @@ exports.multiply = multiply; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "-8396256275" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { - "version": "-18749805970", - "signature": "1874987148" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { 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 998c09d47107b..e24ade14d9d15 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 @@ -35,20 +35,20 @@ exports.multiply = multiply; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" }, "./index.ts": { - "version": "-18749805970", - "signature": "11051732871" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { @@ -96,20 +96,20 @@ exports.m = mod; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "./index.ts": { - "version": "-5786964698", - "signature": "-6548680073" + "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" } }, "options": { @@ -178,24 +178,24 @@ exports.m = mod; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "../logic/index.ts": { - "version": "-6548680073", - "signature": "-6548680073" + "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" }, "./index.ts": { - "version": "12336236525", - "signature": "-9209611" + "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" } }, "options": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-Build/when-logic-config-changes-declaration-dir.js b/tests/baselines/reference/tsbuild/sample1/initial-Build/when-logic-config-changes-declaration-dir.js index 829dbe1718f89..7a9f9a2ea9572 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-Build/when-logic-config-changes-declaration-dir.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-Build/when-logic-config-changes-declaration-dir.js @@ -185,20 +185,20 @@ exports.multiply = multiply; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" }, "./index.ts": { - "version": "-18749805970", - "signature": "11051732871" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { @@ -370,20 +370,20 @@ sourceFile:index.ts "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "./index.ts": { - "version": "-5786964698", - "signature": "-6548680073" + "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" } }, "options": { @@ -436,24 +436,24 @@ exports.m = mod; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "../logic/index.ts": { - "version": "-6548680073", - "signature": "-6548680073" + "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" }, "./index.ts": { - "version": "12336236525", - "signature": "-9209611" + "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" } }, "options": { 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 5dab84c64acf2..b7623e1af5670 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 @@ -185,20 +185,20 @@ exports.multiply = multiply; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" }, "./index.ts": { - "version": "-18749805970", - "signature": "11051732871" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { @@ -370,20 +370,20 @@ sourceFile:index.ts "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "./index.ts": { - "version": "-5786964698", - "signature": "-6548680073" + "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" } }, "options": { @@ -453,24 +453,24 @@ exports.m = mod; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" + "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" }, "../core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "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" }, "../logic/index.ts": { - "version": "-6548680073", - "signature": "-6548680073" + "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" }, "./index.ts": { - "version": "12336236525", - "signature": "-9209611" + "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" } }, "options": { 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 abc90d83d0995..ad19329a2e08e 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 @@ -27,20 +27,20 @@ exports.multiply = multiply; "program": { "fileInfos": { "../../lib/lib.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "-8396256275" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { - "version": "-18749805970", - "signature": "1874987148" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { 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 74efec1e633e5..c8fc2b1fbdebe 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 @@ -46,24 +46,24 @@ export function multiply(a, b) { return a * b; } "program": { "fileInfos": { "../../lib/lib.esnext.d.ts": { - "version": "3858781397", - "signature": "3858781397" + "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; };" }, "../../lib/lib.esnext.full.d.ts": { - "version": "8926001564", - "signature": "8926001564" + "version": "8926001564-/// \n/// ", + "signature": "8926001564-/// \n/// " }, "./anothermodule.ts": { - "version": "-2676574883", - "signature": "-8396256275" + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { - "version": "-18749805970", - "signature": "1874987148" + "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" }, "./some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n" } }, "options": { diff --git a/tests/baselines/reference/user/follow-redirects.log b/tests/baselines/reference/user/follow-redirects.log index a5a924432271e..34010feffeb43 100644 --- a/tests/baselines/reference/user/follow-redirects.log +++ b/tests/baselines/reference/user/follow-redirects.log @@ -1,17 +1,18 @@ Exit Code: 1 Standard output: -node_modules/follow-redirects/index.js(105,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(106,10): error TS2339: Property 'abort' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(153,10): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(156,12): error TS2339: Property 'socket' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(166,8): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(167,8): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(206,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(245,16): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(292,12): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(326,35): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. +node_modules/follow-redirects/index.js(82,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(83,10): error TS2339: Property 'abort' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(130,10): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(133,12): error TS2339: Property 'socket' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(143,8): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(144,8): error TS2339: Property 'once' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(214,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(253,16): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(303,12): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(337,35): 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/follow-redirects/index.js(339,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(345,14): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(357,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. diff --git a/tests/baselines/reference/user/prettier.log b/tests/baselines/reference/user/prettier.log index 908defe0972f2..65a671bd378e9 100644 --- a/tests/baselines/reference/user/prettier.log +++ b/tests/baselines/reference/user/prettier.log @@ -184,7 +184,7 @@ src/language-js/index.js(66,26): error TS2307: Cannot find module 'linguist-lang src/language-js/index.js(76,26): error TS2307: Cannot find module 'linguist-languages/data/json5'. src/language-js/index.js(76,60): error TS2345: Argument of type '{ override: { since: string; parsers: string[]; vscodeLanguageIds: string[]; }; }' is not assignable to parameter of type '{ extend: any; override: any; }'. Property 'extend' is missing in type '{ override: { since: string; parsers: string[]; vscodeLanguageIds: string[]; }; }' but required in type '{ extend: any; override: any; }'. -src/language-js/needs-parens.js(890,14): error TS2769: No overload matches this call. +src/language-js/needs-parens.js(871,14): error TS2769: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray<(childPath: any) => any>[]): ((childPath: any) => any)[]', gave the following error. Argument of type '(string | number)[]' is not assignable to parameter of type 'ConcatArray<(childPath: any) => any>'. Types of property 'slice' are incompatible. @@ -206,47 +206,47 @@ src/language-js/printer-estree.js(400,9): error TS2769: No overload matches this Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. Argument of type '{ type: string; parts: any; } | { type: string; contents: any; n: any; }' is not assignable to parameter of type 'ConcatArray'. Type '{ type: string; parts: any; }' is not assignable to type 'ConcatArray'. -src/language-js/printer-estree.js(1472,28): error TS2769: No overload matches this call. +src/language-js/printer-estree.js(1473,28): error TS2769: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray[]): (string | { type: string; id: any; contents: any; break: boolean; expandedStates: any; })[]', gave the following error. Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. Type '{ type: string; parts: any; }' is missing the following properties from type 'ConcatArray': length, join, slice Overload 2 of 2, '(...items: (string | { type: string; id: any; contents: any; break: boolean; expandedStates: any; } | ConcatArray)[]): (string | { ...; })[]', gave the following error. Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'string | { type: string; id: any; contents: any; break: boolean; expandedStates: any; } | ConcatArray'. Type '{ type: string; parts: any; }' is missing the following properties from type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }': id, contents, break, expandedStates -src/language-js/printer-estree.js(1905,20): error TS2345: Argument of type '" "' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. -src/language-js/printer-estree.js(1907,20): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. -src/language-js/printer-estree.js(1909,18): error TS2345: Argument of type '"while ("' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. -src/language-js/printer-estree.js(1918,9): error TS2345: Argument of type '")"' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. -src/language-js/printer-estree.js(3464,11): error TS2769: No overload matches this call. +src/language-js/printer-estree.js(1906,20): error TS2345: Argument of type '" "' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. +src/language-js/printer-estree.js(1908,20): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. +src/language-js/printer-estree.js(1910,18): error TS2345: Argument of type '"while ("' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. +src/language-js/printer-estree.js(1919,9): error TS2345: Argument of type '")"' is not assignable to parameter of type '{ type: string; id: any; contents: any; break: boolean; expandedStates: any; }'. +src/language-js/printer-estree.js(3465,11): error TS2769: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. Argument of type 'never[] | { type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. Type '{ type: string; parts: any; }' is not assignable to type 'ConcatArray'. Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. Argument of type 'never[] | { type: string; parts: any; }' is not assignable to parameter of type 'ConcatArray'. Type '{ type: string; parts: any; }' is not assignable to type 'ConcatArray'. -src/language-js/printer-estree.js(3893,22): error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. -src/language-js/printer-estree.js(3960,14): error TS2339: Property 'comments' does not exist on type 'Expression'. +src/language-js/printer-estree.js(3894,22): error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. +src/language-js/printer-estree.js(3961,14): error TS2339: Property 'comments' does not exist on type 'Expression'. Property 'comments' does not exist on type 'Identifier'. -src/language-js/printer-estree.js(3972,9): error TS2367: This condition will always return 'false' since the types '"FunctionExpression" | "ClassExpression" | "ObjectExpression" | "TaggedTemplateExpression" | "CallExpression" | "ConditionalExpression" | "UpdateExpression" | "SequenceExpression" | ... 11 more ... | "MetaProperty"' and '"OptionalMemberExpression"' have no overlap. -src/language-js/printer-estree.js(3973,13): error TS2339: Property 'property' does not exist on type 'SimpleLiteral | RegExpLiteral | FunctionExpression | ArrowFunctionExpression | ArrayExpression | ObjectExpression | YieldExpression | UnaryExpression | UpdateExpression | ... 12 more ... | AwaitExpression'. +src/language-js/printer-estree.js(3973,9): error TS2367: This condition will always return 'false' since the types '"FunctionExpression" | "ClassExpression" | "ObjectExpression" | "TaggedTemplateExpression" | "CallExpression" | "ConditionalExpression" | "UpdateExpression" | "SequenceExpression" | ... 11 more ... | "MetaProperty"' and '"OptionalMemberExpression"' have no overlap. +src/language-js/printer-estree.js(3974,13): error TS2339: Property 'property' does not exist on type 'SimpleLiteral | RegExpLiteral | FunctionExpression | ArrowFunctionExpression | ArrayExpression | ObjectExpression | YieldExpression | UnaryExpression | UpdateExpression | ... 12 more ... | AwaitExpression'. Property 'property' does not exist on type 'SimpleLiteral'. -src/language-js/printer-estree.js(3973,52): error TS2339: Property 'property' does not exist on type 'SimpleLiteral | RegExpLiteral | FunctionExpression | ArrowFunctionExpression | ArrayExpression | ObjectExpression | YieldExpression | UnaryExpression | UpdateExpression | ... 12 more ... | AwaitExpression'. +src/language-js/printer-estree.js(3974,52): error TS2339: Property 'property' does not exist on type 'SimpleLiteral | RegExpLiteral | FunctionExpression | ArrowFunctionExpression | ArrayExpression | ObjectExpression | YieldExpression | UnaryExpression | UpdateExpression | ... 12 more ... | AwaitExpression'. Property 'property' does not exist on type 'SimpleLiteral'. -src/language-js/printer-estree.js(3978,9): error TS2367: This condition will always return 'false' since the types '"FunctionExpression" | "ClassExpression" | "ObjectExpression" | "TaggedTemplateExpression" | "CallExpression" | "ConditionalExpression" | "UpdateExpression" | "SequenceExpression" | ... 11 more ... | "MetaProperty"' and '"OptionalMemberExpression"' have no overlap. -src/language-js/printer-estree.js(3980,29): error TS2339: Property 'object' does not exist on type 'SimpleLiteral | RegExpLiteral | FunctionExpression | ArrowFunctionExpression | ArrayExpression | ObjectExpression | YieldExpression | UnaryExpression | UpdateExpression | ... 12 more ... | AwaitExpression'. +src/language-js/printer-estree.js(3979,9): error TS2367: This condition will always return 'false' since the types '"FunctionExpression" | "ClassExpression" | "ObjectExpression" | "TaggedTemplateExpression" | "CallExpression" | "ConditionalExpression" | "UpdateExpression" | "SequenceExpression" | ... 11 more ... | "MetaProperty"' and '"OptionalMemberExpression"' have no overlap. +src/language-js/printer-estree.js(3981,29): error TS2339: Property 'object' does not exist on type 'SimpleLiteral | RegExpLiteral | FunctionExpression | ArrowFunctionExpression | ArrayExpression | ObjectExpression | YieldExpression | UnaryExpression | UpdateExpression | ... 12 more ... | AwaitExpression'. Property 'object' does not exist on type 'SimpleLiteral'. -src/language-js/printer-estree.js(3981,22): error TS2339: Property 'comments' does not exist on type 'SimpleLiteral | RegExpLiteral | FunctionExpression | ArrowFunctionExpression | ArrayExpression | ObjectExpression | YieldExpression | UnaryExpression | UpdateExpression | ... 12 more ... | AwaitExpression'. +src/language-js/printer-estree.js(3982,22): error TS2339: Property 'comments' does not exist on type 'SimpleLiteral | RegExpLiteral | FunctionExpression | ArrowFunctionExpression | ArrayExpression | ObjectExpression | YieldExpression | UnaryExpression | UpdateExpression | ... 12 more ... | AwaitExpression'. Property 'comments' does not exist on type 'SimpleLiteral'. -src/language-js/printer-estree.js(3987,9): error TS2367: This condition will always return 'false' since the types '"FunctionExpression" | "ClassExpression" | "ObjectExpression" | "TaggedTemplateExpression" | "CallExpression" | "ConditionalExpression" | "UpdateExpression" | "SequenceExpression" | ... 11 more ... | "MetaProperty"' and '"Identifier"' have no overlap. -src/language-js/printer-estree.js(3988,9): error TS2367: This condition will always return 'false' since the types '"FunctionExpression" | "ClassExpression" | "ObjectExpression" | "TaggedTemplateExpression" | "CallExpression" | "ConditionalExpression" | "UpdateExpression" | "SequenceExpression" | ... 11 more ... | "MetaProperty"' and '"ThisExpression"' have no overlap. -src/language-js/printer-estree.js(4192,23): error TS2532: Object is possibly 'undefined'. -src/language-js/printer-estree.js(4193,24): error TS2532: Object is possibly 'undefined'. -src/language-js/printer-estree.js(4546,5): error TS2345: Argument of type '"" | { type: string; parts: any; } | { type: string; contents: any; }' is not assignable to parameter of type 'string'. +src/language-js/printer-estree.js(3988,9): error TS2367: This condition will always return 'false' since the types '"FunctionExpression" | "ClassExpression" | "ObjectExpression" | "TaggedTemplateExpression" | "CallExpression" | "ConditionalExpression" | "UpdateExpression" | "SequenceExpression" | ... 11 more ... | "MetaProperty"' and '"Identifier"' have no overlap. +src/language-js/printer-estree.js(3989,9): error TS2367: This condition will always return 'false' since the types '"FunctionExpression" | "ClassExpression" | "ObjectExpression" | "TaggedTemplateExpression" | "CallExpression" | "ConditionalExpression" | "UpdateExpression" | "SequenceExpression" | ... 11 more ... | "MetaProperty"' and '"ThisExpression"' have no overlap. +src/language-js/printer-estree.js(4193,23): error TS2532: Object is possibly 'undefined'. +src/language-js/printer-estree.js(4194,24): error TS2532: Object is possibly 'undefined'. +src/language-js/printer-estree.js(4550,5): error TS2345: Argument of type '"" | { type: string; parts: any; } | { type: string; contents: any; }' is not assignable to parameter of type 'string'. Type '{ type: string; parts: any; }' is not assignable to type 'string'. -src/language-js/printer-estree.js(4550,16): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'string'. -src/language-js/printer-estree.js(4592,9): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'string'. -src/language-js/printer-estree.js(4894,9): error TS2554: Expected 0-2 arguments, but got 3. -src/language-js/printer-estree.js(6101,7): error TS2769: No overload matches this call. +src/language-js/printer-estree.js(4554,16): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'string'. +src/language-js/printer-estree.js(4596,9): error TS2345: Argument of type '{ type: string; parts: any; }' is not assignable to parameter of type 'string'. +src/language-js/printer-estree.js(4898,9): error TS2554: Expected 0-2 arguments, but got 3. +src/language-js/printer-estree.js(6105,7): error TS2769: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray<(childPath: any) => any>[]): ((childPath: any) => any)[]', gave the following error. Argument of type '(string | number)[]' is not assignable to parameter of type 'ConcatArray<(childPath: any) => any>'. Types of property 'slice' are incompatible. diff --git a/tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.ts b/tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.ts new file mode 100644 index 0000000000000..3dbc6ec9ec3f7 --- /dev/null +++ b/tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.ts @@ -0,0 +1,15 @@ +// @jsx: react +// @filename: quickIntersectionCheckCorrectlyCachesErrors.tsx +interface F

{ + (props: P & { children?: boolean }): void; + propTypes: { [K in keyof P]: null extends P ? K : K }; +} +declare function g(C: F): string; +export function wu(CC: F) { + class WU { + m() { + g(CC) + return ; + } + } +} diff --git a/tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberWithComputedPropertyName.ts b/tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberWithComputedPropertyName.ts index 31aec681445a5..07287f1f600b0 100644 --- a/tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberWithComputedPropertyName.ts +++ b/tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberWithComputedPropertyName.ts @@ -1,4 +1,5 @@ // https://github.com/microsoft/TypeScript/issues/30953 +"use strict"; const x = 1; class C { [x] = true; diff --git a/tests/cases/conformance/jsdoc/enumTagOnExports.ts b/tests/cases/conformance/jsdoc/enumTagOnExports.ts new file mode 100644 index 0000000000000..ce8bd0b1237d3 --- /dev/null +++ b/tests/cases/conformance/jsdoc/enumTagOnExports.ts @@ -0,0 +1,10 @@ +// @filename: enumTagOnExports.js +// @allowjs: true +// @checkjs: true +// @noemit: true + +/** @enum {number} */ +exports.a = {}; + +/** @enum {string} */ +module.exports.b = {}; diff --git a/tests/cases/conformance/jsdoc/enumTagOnExports2.ts b/tests/cases/conformance/jsdoc/enumTagOnExports2.ts new file mode 100644 index 0000000000000..3a4633138375d --- /dev/null +++ b/tests/cases/conformance/jsdoc/enumTagOnExports2.ts @@ -0,0 +1,7 @@ +// @filename: enumTagOnExports.js +// @allowjs: true +// @checkjs: true +// @noemit: true + +/** @enum {string} */ +module.exports = {}; diff --git a/tests/cases/fourslash/formattingObjectLiteralOpenCurlyNewlineAssignment.ts b/tests/cases/fourslash/formattingObjectLiteralOpenCurlyNewlineAssignment.ts new file mode 100644 index 0000000000000..3693b49075e15 --- /dev/null +++ b/tests/cases/fourslash/formattingObjectLiteralOpenCurlyNewlineAssignment.ts @@ -0,0 +1,47 @@ +/// + +//// +//// var obj = {}; +//// obj = +//// { +//// prop: 3 +//// }; +//// +//// var obj2 = obj || +//// { +//// prop: 0 +//// } +//// + +format.document(); +verify.currentFileContentIs( +` +var obj = {}; +obj = +{ + prop: 3 +}; + +var obj2 = obj || +{ + prop: 0 +} +` +); + +format.setOption("indentMultiLineObjectLiteralBeginningOnBlankLine", true); +format.document(); +verify.currentFileContentIs( +` +var obj = {}; +obj = + { + prop: 3 + }; + +var obj2 = obj || + { + prop: 0 + } +` +); \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionAcrossMultipleProjects.ts b/tests/cases/fourslash/goToDefinitionAcrossMultipleProjects.ts index 5447609c02785..4f33d589c1dba 100644 --- a/tests/cases/fourslash/goToDefinitionAcrossMultipleProjects.ts +++ b/tests/cases/fourslash/goToDefinitionAcrossMultipleProjects.ts @@ -7,8 +7,16 @@ ////var /*def2*/x: number; //@Filename: c.ts +////var /*def3*/x: number; + +//@Filename: d.ts +////var /*def4*/x: number; + +//@Filename: e.ts /////// /////// +/////// +/////// ////[|/*use*/x|]++; -verify.goToDefinition("use", ["def1", "def2"]); +verify.goToDefinition("use", ["def1", "def2", "def3", "def4"]); diff --git a/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter b/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter index 1bf5836cae524..722ebf8053d2b 160000 --- a/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter +++ b/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter @@ -1 +1 @@ -Subproject commit 1bf5836cae5246b89bbf7063c3e84e110222fcdf +Subproject commit 722ebf8053d2bf82bb66134b21c7e291ccae35c4 diff --git a/tests/cases/user/create-react-app/create-react-app b/tests/cases/user/create-react-app/create-react-app index 6560858398ddc..6dec056de3c64 160000 --- a/tests/cases/user/create-react-app/create-react-app +++ b/tests/cases/user/create-react-app/create-react-app @@ -1 +1 @@ -Subproject commit 6560858398ddc8d1c5b8d7f51929fcb3d9c3055c +Subproject commit 6dec056de3c646fa1bce41acadc31641237863a0 diff --git a/tests/cases/user/prettier/prettier b/tests/cases/user/prettier/prettier index 2f40dba3177c6..223443c057e64 160000 --- a/tests/cases/user/prettier/prettier +++ b/tests/cases/user/prettier/prettier @@ -1 +1 @@ -Subproject commit 2f40dba3177c6edd3ceb88b26cdf4718e892a3e5 +Subproject commit 223443c057e64ca04cda5c0f37f5d15daaf69337 diff --git a/tests/cases/user/webpack/webpack b/tests/cases/user/webpack/webpack index b16ca509d12fa..b2b5b278ddfa4 160000 --- a/tests/cases/user/webpack/webpack +++ b/tests/cases/user/webpack/webpack @@ -1 +1 @@ -Subproject commit b16ca509d12faf36573b65fffcbae50c5b3e7ee3 +Subproject commit b2b5b278ddfa49cea5a2a74b42917633e2d58237 diff --git a/tests/projects/emitDeclarationOnly/src/a.ts b/tests/projects/emitDeclarationOnly/src/a.ts new file mode 100644 index 0000000000000..330b4fb38d474 --- /dev/null +++ b/tests/projects/emitDeclarationOnly/src/a.ts @@ -0,0 +1,5 @@ +import { B } from "./b"; + +export interface A { + b: B; +} diff --git a/tests/projects/emitDeclarationOnly/src/b.ts b/tests/projects/emitDeclarationOnly/src/b.ts new file mode 100644 index 0000000000000..80f920a0e9d1c --- /dev/null +++ b/tests/projects/emitDeclarationOnly/src/b.ts @@ -0,0 +1,5 @@ +import { C } from "./c"; + +export interface B { + b: C; +} diff --git a/tests/projects/emitDeclarationOnly/src/c.ts b/tests/projects/emitDeclarationOnly/src/c.ts new file mode 100644 index 0000000000000..b6b6e67dadad1 --- /dev/null +++ b/tests/projects/emitDeclarationOnly/src/c.ts @@ -0,0 +1,5 @@ +import { A } from "./a"; + +export interface C { + a: A; +} diff --git a/tests/projects/emitDeclarationOnly/src/index.ts b/tests/projects/emitDeclarationOnly/src/index.ts new file mode 100644 index 0000000000000..c6a5229cdb99d --- /dev/null +++ b/tests/projects/emitDeclarationOnly/src/index.ts @@ -0,0 +1,3 @@ +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; diff --git a/tests/projects/emitDeclarationOnly/tsconfig.json b/tests/projects/emitDeclarationOnly/tsconfig.json new file mode 100644 index 0000000000000..334d67116d971 --- /dev/null +++ b/tests/projects/emitDeclarationOnly/tsconfig.json @@ -0,0 +1,19 @@ +{ + "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 + } +}