diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index ee120c5bfae..13ca7bd9585 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -331,6 +331,13 @@ namespace ts { category: Diagnostics.Basic_Options, description: Diagnostics.Enable_project_compilation, }, + { + name: "incremental", + type: "boolean", + isTSConfigOnly: true, + category: Diagnostics.Basic_Options, + description: Diagnostics.Enable_incremental_compilation, + }, { name: "removeComments", type: "boolean", diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 0d758b84a3a..04fff1bf8a2 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4020,10 +4020,14 @@ "category": "Message", "code": 6376 }, - "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' of referenced project '{1}'": { + "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'": { "category": "Error", "code": 6377 }, + "Enable incremental compilation": { + "category": "Message", + "code": 6378 + }, "The expected type comes from property '{0}' which is declared here on type '{1}'": { "category": "Message", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 284f927aaa7..354a1449914 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1,12 +1,10 @@ namespace ts { - /*@internal*/ - export const infoFile = ".tsbuildinfo"; const brackets = createBracketsMap(); const syntheticParent: TextRange = { pos: -1, end: -1 }; /*@internal*/ export function isBuildInfoFile(file: string) { - return endsWith(file, `/${infoFile}`); + return fileExtensionIs(file, Extension.TsBuildInfo); } /*@internal*/ @@ -47,29 +45,41 @@ namespace ts { } } if (includeBuildInfo) { - const buildInfoPath = getOutputPathForBuildInfo(host.getCompilerOptions(), host.getProjectReferences()); + const buildInfoPath = getOutputPathForBuildInfo(host.getCompilerOptions()); if (buildInfoPath) return action({ buildInfoPath }, /*sourceFileOrBundle*/ undefined); } } } /*@internal*/ - export function getOutputPathForBuildInfo(options: CompilerOptions, projectReferences: ReadonlyArray | undefined) { - if (!options.composite && !length(projectReferences)) return undefined; + export function getOutputPathForBuildInfo(options: CompilerOptions) { + const configFile = options.configFilePath; + if (!configFile || !options.incremental && !options.composite) return undefined; + // TODO:: Add outFile like tsBuildInfoFile option const outPath = options.outFile || options.out; - if (outPath) return combinePaths(getDirectoryPath(outPath), infoFile); - if (options.outDir) return combinePaths(options.outDir, infoFile); - return options.configFilePath && combinePaths(getDirectoryPath(options.configFilePath), infoFile); + let buildInfoExtensionLess: string; + if (outPath) { + buildInfoExtensionLess = removeFileExtension(outPath); + } + else { + const configFileExtensionLess = removeFileExtension(configFile); + buildInfoExtensionLess = options.outDir ? + options.rootDir ? + resolvePath(options.outDir, getRelativePathFromDirectory(options.rootDir, configFileExtensionLess, /*ignoreCase*/ true)) : + combinePaths(options.outDir, getBaseFileName(configFileExtensionLess)) : + configFileExtensionLess; + } + return buildInfoExtensionLess + Extension.TsBuildInfo; } /*@internal*/ - export function getOutputPathsForBundle(options: CompilerOptions, forceDtsPaths: boolean, projectReferences: ReadonlyArray | undefined): EmitFileNames { + export function getOutputPathsForBundle(options: CompilerOptions, forceDtsPaths: boolean): EmitFileNames { const outPath = options.outFile || options.out!; const jsFilePath = options.emitDeclarationOnly ? undefined : outPath; const sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); const declarationFilePath = (forceDtsPaths || getEmitDeclarations(options)) ? removeFileExtension(outPath) + Extension.Dts : undefined; const declarationMapPath = declarationFilePath && getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined; - const buildInfoPath = getOutputPathForBuildInfo(options, projectReferences); + const buildInfoPath = getOutputPathForBuildInfo(options); return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath }; } @@ -77,7 +87,7 @@ namespace ts { export function getOutputPathsFor(sourceFile: SourceFile | Bundle, host: EmitHost, forceDtsPaths: boolean): EmitFileNames { const options = host.getCompilerOptions(); if (sourceFile.kind === SyntaxKind.Bundle) { - return getOutputPathsForBundle(options, forceDtsPaths, host.getProjectReferences()); + return getOutputPathsForBundle(options, forceDtsPaths); } else { const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile, options)); @@ -535,7 +545,7 @@ namespace ts { /*@internal*/ export function emitUsingBuildInfo(config: ParsedCommandLine, host: EmitUsingBuildInfoHost, getCommandLine: (ref: ProjectReference) => ParsedCommandLine | undefined): EmitUsingBuildInfoResult { - const { buildInfoPath, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath } = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false, config.projectReferences); + const { buildInfoPath, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath } = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false); const buildInfoText = host.readFile(Debug.assertDefined(buildInfoPath)); if (!buildInfoText) return buildInfoPath!; const jsFileText = host.readFile(Debug.assertDefined(jsFilePath)); @@ -570,7 +580,6 @@ namespace ts { const sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle); const emitHost: EmitHost = { getPrependNodes: memoize(() => [...prependNodes, ownPrependInput]), - getProjectReferences: () => config.projectReferences, getCanonicalFileName: host.getCanonicalFileName, getCommonSourceDirectory: () => buildInfo.bundle!.commonSourceDirectory, getCompilerOptions: () => config.options, diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index f5bac45f6ab..59bb74a22c1 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -437,6 +437,8 @@ namespace ts.moduleSpecifiers { case Extension.Jsx: case Extension.Json: return ext; + case Extension.TsBuildInfo: + return Debug.fail(`Extension ${Extension.TsBuildInfo} is unsupported:: FileName:: ${fileName}`); default: return Debug.assertNever(ext); } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index f7abfdd29c0..e19e35a0ddf 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1410,7 +1410,6 @@ namespace ts { function getEmitHost(writeFileCallback?: WriteFileCallback): EmitHost { return { getPrependNodes, - getProjectReferences, getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, @@ -2942,7 +2941,7 @@ namespace ts { } function verifyProjectReferences() { - const buildInfoPath = !options.noEmit && !options.suppressOutputPathCheck ? getOutputPathForBuildInfo(options, projectReferences) : undefined; + const buildInfoPath = !options.noEmit && !options.suppressOutputPathCheck ? getOutputPathForBuildInfo(options) : undefined; forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, index, parent) => { const ref = (parent ? parent.commandLine.projectReferences : projectReferences)![index]; const parentFile = parent && parent.sourceFile as JsonSourceFile; @@ -2969,9 +2968,8 @@ namespace ts { createDiagnosticForReference(parentFile, index, Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set, ref.path); } } - const refBuildInfoPath = getOutputPathForBuildInfo(options, resolvedRef.commandLine.projectReferences); - if (refBuildInfoPath && refBuildInfoPath === buildInfoPath) { - createDiagnosticForReference(parentFile, index, Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_of_referenced_project_1, buildInfoPath, ref.path); + if (!parent && buildInfoPath && buildInfoPath === getOutputPathForBuildInfo(options)) { + createDiagnosticForReference(parentFile, index, Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoPath, ref.path); hasEmitBlockingDiagnostics.set(toPath(buildInfoPath), true); } }); @@ -3168,7 +3166,7 @@ namespace ts { // Upstream project didn't have outFile set -- skip (error will have been issued earlier) if (!out) continue; - const { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath } = getOutputPathsForBundle(resolvedRefOpts.options, /*forceDtsPaths*/ true, resolvedRefOpts.projectReferences); + const { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath } = getOutputPathsForBundle(resolvedRefOpts.options, /*forceDtsPaths*/ true); const node = createInputFiles(readFile, jsFilePath!, sourceMapFilePath, declarationFilePath!, declarationMapPath, buildInfoPath); (nodes || (nodes = [])).push(node); } diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 5d169c1e95a..2adf55061f5 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -307,7 +307,7 @@ namespace ts { function getOutFileOutputs(project: ParsedCommandLine, ignoreBuildInfo?: boolean): ReadonlyArray { Debug.assert(!!project.options.outFile || !!project.options.out, "outFile must be set"); - const { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath } = getOutputPathsForBundle(project.options, /*forceDtsPaths*/ false, project.projectReferences); + const { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath } = getOutputPathsForBundle(project.options, /*forceDtsPaths*/ false); let outputs: string[] | undefined = []; const addOutput = (path: string | undefined) => path && (outputs || (outputs = [])).push(path); @@ -1217,7 +1217,7 @@ namespace ts { function getOldProgram(proj: ResolvedConfigFileName, parsed: ParsedCommandLine) { const value = builderPrograms.getValue(proj); if (value) return value; - const buildInfoPath = getOutputPathForBuildInfo(parsed.options, parsed.projectReferences); + const buildInfoPath = getOutputPathForBuildInfo(parsed.options); if (!buildInfoPath) return undefined; const content = readFileWithCache(buildInfoPath); if (!content) return undefined; @@ -1488,7 +1488,7 @@ namespace ts { outputs.push(...getOutputFileNames(inputFile, project)); } if (!ignoreBuildInfo) { - const buildInfoPath = getOutputPathForBuildInfo(project.options, project.projectReferences); + const buildInfoPath = getOutputPathForBuildInfo(project.options); if (buildInfoPath) outputs.push(buildInfoPath); } return outputs; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index a3d78a89a2e..ce933d23f20 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4646,6 +4646,7 @@ namespace ts { reactNamespace?: string; jsxFactory?: string; composite?: boolean; + incremental?: boolean; removeComments?: boolean; rootDir?: string; rootDirs?: string[]; @@ -5056,7 +5057,8 @@ namespace ts { Dts = ".d.ts", Js = ".js", Jsx = ".jsx", - Json = ".json" + Json = ".json", + TsBuildInfo = ".tsbuildinfo" } export interface ResolvedModuleWithFailedLookupLocations { @@ -5345,7 +5347,6 @@ namespace ts { isEmitBlocked(emitFileName: string): boolean; getPrependNodes(): ReadonlyArray; - getProjectReferences(): ReadonlyArray | undefined; writeFile: WriteFileCallback; getProgramBuildInfo(): ProgramBuildInfo | undefined; diff --git a/src/services/stringCompletions.ts b/src/services/stringCompletions.ts index 9548397a22d..aafe9076056 100644 --- a/src/services/stringCompletions.ts +++ b/src/services/stringCompletions.ts @@ -71,6 +71,7 @@ namespace ts.Completions.StringCompletions { case Extension.Jsx: return ScriptElementKindModifier.jsxModifier; case Extension.Ts: return ScriptElementKindModifier.tsModifier; case Extension.Tsx: return ScriptElementKindModifier.tsxModifier; + case Extension.TsBuildInfo: return Debug.fail(`Extension ${Extension.TsBuildInfo} is unsupported.`); case undefined: return ScriptElementKindModifier.none; default: return Debug.assertNever(extension); diff --git a/src/testRunner/unittests/tsbuild/outFile.ts b/src/testRunner/unittests/tsbuild/outFile.ts index bdbd2dea29a..ffc408d8bdc 100644 --- a/src/testRunner/unittests/tsbuild/outFile.ts +++ b/src/testRunner/unittests/tsbuild/outFile.ts @@ -12,21 +12,21 @@ namespace ts { "/src/first/bin/first-output.js.map", "/src/first/bin/first-output.d.ts", "/src/first/bin/first-output.d.ts.map", - "/src/first/bin/.tsbuildinfo" + "/src/first/bin/first-output.tsbuildinfo" ], [ "/src/2/second-output.js", "/src/2/second-output.js.map", "/src/2/second-output.d.ts", "/src/2/second-output.d.ts.map", - "/src/2/.tsbuildinfo" + "/src/2/second-output.tsbuildinfo" ], [ "/src/third/thirdjs/output/third-output.js", "/src/third/thirdjs/output/third-output.js.map", "/src/third/thirdjs/output/third-output.d.ts", "/src/third/thirdjs/output/third-output.d.ts.map", - "/src/third/thirdjs/output/.tsbuildinfo" + "/src/third/thirdjs/output/third-output.tsbuildinfo" ] ]; const relOutputFiles = outputFiles.map(v => v.map(relName)) as [OutputFile, OutputFile, OutputFile]; @@ -435,15 +435,7 @@ namespace ts { const host = new fakes.SolutionBuilderHost(fs); const builder = createSolutionBuilder(host); builder.buildAllProjects(); - host.assertDiagnosticMessages( - getExpectedDiagnosticForProjectsInBuild(relSources[project.first][source.config], relSources[project.second][source.config], relSources[project.third][source.config]), - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.first][source.config], relOutputFiles[project.first][ext.js]], - [Diagnostics.Building_project_0, sources[project.first][source.config]], - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.second][source.config], relOutputFiles[project.second][ext.js]], - [Diagnostics.Building_project_0, sources[project.second][source.config]], - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.third][source.config], relOutputFiles[project.third][ext.js]], - [Diagnostics.Building_project_0, sources[project.third][source.config]] - ); + host.assertDiagnosticMessages(...initialExpectedDiagnostics); // Verify they exist for (const output of expectedOutputs) { assert(fs.existsSync(output), `Expect file ${output} to exist`); @@ -469,15 +461,7 @@ namespace ts { const host = new fakes.SolutionBuilderHost(fs); const builder = createSolutionBuilder(host); builder.buildAllProjects(); - host.assertDiagnosticMessages( - getExpectedDiagnosticForProjectsInBuild(relSources[project.first][source.config], relSources[project.second][source.config], relSources[project.third][source.config]), - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.first][source.config], relOutputFiles[project.first][ext.js]], - [Diagnostics.Building_project_0, sources[project.first][source.config]], - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.second][source.config], relOutputFiles[project.second][ext.js]], - [Diagnostics.Building_project_0, sources[project.second][source.config]], - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.third][source.config], relOutputFiles[project.third][ext.js]], - [Diagnostics.Building_project_0, sources[project.third][source.config]] - ); + host.assertDiagnosticMessages(...initialExpectedDiagnostics); // Verify they exist for (const output of expectedOutputs) { assert(fs.existsSync(output), `Expect file ${output} to exist`); @@ -495,275 +479,264 @@ namespace ts { ); }); - it("verify that if multiple projects write tsbuildinfo to same location, reports error", () => { + it("verify that if incremental is set to false, tsbuildinfo is not generated", () => { const fs = outFileFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); - replaceText(fs, sources[project.first][source.config], "./bin/first-output.js", "../bin/first-output.js"); - replaceText(fs, sources[project.second][source.config], "../2/second-output.js", "../bin/second-output.js"); - replaceText(fs, sources[project.third][source.config], "./thirdjs/output/third-output.js", "../bin/third-output.js"); + replaceText(fs, sources[project.third][source.config], `"composite": true,`, ""); const builder = createSolutionBuilder(host); builder.buildAllProjects(); - host.assertDiagnosticMessages( - getExpectedDiagnosticForProjectsInBuild(relSources[project.first][source.config], relSources[project.second][source.config], relSources[project.third][source.config]), - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.first][source.config], "src/bin/first-output.js"], - [Diagnostics.Building_project_0, sources[project.first][source.config]], - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.second][source.config], "src/bin/second-output.js"], - [Diagnostics.Building_project_0, sources[project.second][source.config]], - [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relSources[project.third][source.config], "src/bin/third-output.js"], - [Diagnostics.Building_project_0, sources[project.third][source.config]], - [Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_of_referenced_project_1, "/src/bin/.tsbuildinfo", "/src/first"], - [Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_of_referenced_project_1, "/src/bin/.tsbuildinfo", "/src/second"] - ); - // Verify they exist - for (const output of ["/src/bin/first-output.js", "/src/bin/second-output.js"]) { + host.assertDiagnosticMessages(...initialExpectedDiagnostics); + // Verify they exist - without tsbuildinfo for third project + for (const output of expectedOutputFiles.slice(0, expectedOutputFiles.length - 2)) { assert(fs.existsSync(output), `Expect file ${output} to exist`); } - assert.isFalse(fs.existsSync("/src/bin/third-output.js"), `Expect file "/src/bin/third-output.js" to not exist`); + assert.isFalse(fs.existsSync(outputFiles[project.third][ext.buildinfo]), `Expect file ${outputFiles[project.third][ext.buildinfo]} to not exist`); }); - // Prologues - function enableStrict(fs: vfs.FileSystem, path: string) { - replaceText(fs, path, `"strict": false`, `"strict": true`); - } + describe("Prepend output with .tsbuildinfo", () => { + // Prologues + function enableStrict(fs: vfs.FileSystem, path: string) { + replaceText(fs, path, `"strict": false`, `"strict": true`); + } - // Verify initial + incremental edits - verifyOutFileScenario({ - scenario: "strict in all projects", - modifyFs: fs => { - enableStrict(fs, sources[project.first][source.config]); - enableStrict(fs, sources[project.second][source.config]); - enableStrict(fs, sources[project.third][source.config]); - }, - modifyAgainFs: fs => addPrologue(fs, relSources[project.first][source.ts][part.one], `"myPrologue"`) - }); + // Verify initial + incremental edits + verifyOutFileScenario({ + scenario: "strict in all projects", + modifyFs: fs => { + enableStrict(fs, sources[project.first][source.config]); + enableStrict(fs, sources[project.second][source.config]); + enableStrict(fs, sources[project.third][source.config]); + }, + modifyAgainFs: fs => addPrologue(fs, relSources[project.first][source.ts][part.one], `"myPrologue"`) + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "strict in one dependency", - modifyFs: fs => enableStrict(fs, sources[project.second][source.config]), - modifyAgainFs: fs => addPrologue(fs, "src/first/first_PART1.ts", `"myPrologue"`), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "strict in one dependency", + modifyFs: fs => enableStrict(fs, sources[project.second][source.config]), + modifyAgainFs: fs => addPrologue(fs, "src/first/first_PART1.ts", `"myPrologue"`), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - function addPrologue(fs: vfs.FileSystem, path: string, prologue: string) { - prependText(fs, path, `${prologue} + function addPrologue(fs: vfs.FileSystem, path: string, prologue: string) { + prependText(fs, path, `${prologue} `); - } + } - // Verify initial + incremental edits - sourcemap verification - verifyOutFileScenario({ - scenario: "multiple prologues in all projects", - modifyFs: fs => { - enableStrict(fs, sources[project.first][source.config]); - addPrologue(fs, sources[project.first][source.ts][part.one], `"myPrologue"`); - enableStrict(fs, sources[project.second][source.config]); - addPrologue(fs, sources[project.second][source.ts][part.one], `"myPrologue"`); - addPrologue(fs, sources[project.second][source.ts][part.two], `"myPrologue2";`); - enableStrict(fs, sources[project.third][source.config]); - addPrologue(fs, sources[project.third][source.ts][part.one], `"myPrologue";`); - addPrologue(fs, sources[project.third][source.ts][part.one], `"myPrologue3";`); - }, - modifyAgainFs: fs => addPrologue(fs, relSources[project.first][source.ts][part.one], `"myPrologue5"`) - }); + // Verify initial + incremental edits - sourcemap verification + verifyOutFileScenario({ + scenario: "multiple prologues in all projects", + modifyFs: fs => { + enableStrict(fs, sources[project.first][source.config]); + addPrologue(fs, sources[project.first][source.ts][part.one], `"myPrologue"`); + enableStrict(fs, sources[project.second][source.config]); + addPrologue(fs, sources[project.second][source.ts][part.one], `"myPrologue"`); + addPrologue(fs, sources[project.second][source.ts][part.two], `"myPrologue2";`); + enableStrict(fs, sources[project.third][source.config]); + addPrologue(fs, sources[project.third][source.ts][part.one], `"myPrologue";`); + addPrologue(fs, sources[project.third][source.ts][part.one], `"myPrologue3";`); + }, + modifyAgainFs: fs => addPrologue(fs, relSources[project.first][source.ts][part.one], `"myPrologue5"`) + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "multiple prologues in different projects", - modifyFs: fs => { - enableStrict(fs, sources[project.first][source.config]); - addPrologue(fs, sources[project.second][source.ts][part.one], `"myPrologue"`); - addPrologue(fs, sources[project.second][source.ts][part.two], `"myPrologue2";`); - enableStrict(fs, sources[project.third][source.config]); - }, - modifyAgainFs: fs => addPrologue(fs, sources[project.first][source.ts][part.one], `"myPrologue5"`), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "multiple prologues in different projects", + modifyFs: fs => { + enableStrict(fs, sources[project.first][source.config]); + addPrologue(fs, sources[project.second][source.ts][part.one], `"myPrologue"`); + addPrologue(fs, sources[project.second][source.ts][part.two], `"myPrologue2";`); + enableStrict(fs, sources[project.third][source.config]); + }, + modifyAgainFs: fs => addPrologue(fs, sources[project.first][source.ts][part.one], `"myPrologue5"`), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // Shebang - function addShebang(fs: vfs.FileSystem, project: string, file: string) { - prependText(fs, `src/${project}/${file}.ts`, `#!someshebang ${project} ${file} + // Shebang + function addShebang(fs: vfs.FileSystem, project: string, file: string) { + prependText(fs, `src/${project}/${file}.ts`, `#!someshebang ${project} ${file} `); - } + } - // changes declaration because its emitted in .d.ts file - // Verify initial + incremental edits - verifyOutFileScenario({ - scenario: "shebang in all projects", - modifyFs: fs => { - addShebang(fs, "first", "first_PART1"); - addShebang(fs, "first", "first_part2"); - addShebang(fs, "second", "second_part1"); - addShebang(fs, "third", "third_part1"); - }, - }); + // changes declaration because its emitted in .d.ts file + // Verify initial + incremental edits + verifyOutFileScenario({ + scenario: "shebang in all projects", + modifyFs: fs => { + addShebang(fs, "first", "first_PART1"); + addShebang(fs, "first", "first_part2"); + addShebang(fs, "second", "second_part1"); + addShebang(fs, "third", "third_part1"); + }, + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "shebang in only one dependency project", - modifyFs: fs => addShebang(fs, "second", "second_part1"), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "shebang in only one dependency project", + modifyFs: fs => addShebang(fs, "second", "second_part1"), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // emitHelpers - function restContent(project: string, file: string) { - return `function for${project}${file}Rest() { + // emitHelpers + function restContent(project: string, file: string) { + return `function for${project}${file}Rest() { const { b, ...rest } = { a: 10, b: 30, yy: 30 }; }`; - } + } - function nonrestContent(project: string, file: string) { - return `function for${project}${file}Rest() { }`; - } + function nonrestContent(project: string, file: string) { + return `function for${project}${file}Rest() { }`; + } - function addRest(fs: vfs.FileSystem, project: string, file: string) { - appendText(fs, `src/${project}/${file}.ts`, restContent(project, file)); - } + function addRest(fs: vfs.FileSystem, project: string, file: string) { + appendText(fs, `src/${project}/${file}.ts`, restContent(project, file)); + } - function removeRest(fs: vfs.FileSystem, project: string, file: string) { - replaceText(fs, `src/${project}/${file}.ts`, restContent(project, file), nonrestContent(project, file)); - } + function removeRest(fs: vfs.FileSystem, project: string, file: string) { + replaceText(fs, `src/${project}/${file}.ts`, restContent(project, file), nonrestContent(project, file)); + } - function addStubFoo(fs: vfs.FileSystem, project: string, file: string) { - appendText(fs, `src/${project}/${file}.ts`, nonrestContent(project, file)); - } + function addStubFoo(fs: vfs.FileSystem, project: string, file: string) { + appendText(fs, `src/${project}/${file}.ts`, nonrestContent(project, file)); + } - function changeStubToRest(fs: vfs.FileSystem, project: string, file: string) { - replaceText(fs, `src/${project}/${file}.ts`, nonrestContent(project, file), restContent(project, file)); - } + function changeStubToRest(fs: vfs.FileSystem, project: string, file: string) { + replaceText(fs, `src/${project}/${file}.ts`, nonrestContent(project, file), restContent(project, file)); + } - // Verify initial + incremental edits - verifyOutFileScenario({ - scenario: "emitHelpers in all projects", - modifyFs: fs => { - addRest(fs, "first", "first_PART1"); - addRest(fs, "second", "second_part1"); - addRest(fs, "third", "third_part1"); - }, - modifyAgainFs: fs => removeRest(fs, "first", "first_PART1") - }); + // Verify initial + incremental edits + verifyOutFileScenario({ + scenario: "emitHelpers in all projects", + modifyFs: fs => { + addRest(fs, "first", "first_PART1"); + addRest(fs, "second", "second_part1"); + addRest(fs, "third", "third_part1"); + }, + modifyAgainFs: fs => removeRest(fs, "first", "first_PART1") + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "emitHelpers in only one dependency project", - modifyFs: fs => { - addStubFoo(fs, "first", "first_PART1"); - addRest(fs, "second", "second_part1"); - }, - modifyAgainFs: fs => changeStubToRest(fs, "first", "first_PART1"), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "emitHelpers in only one dependency project", + modifyFs: fs => { + addStubFoo(fs, "first", "first_PART1"); + addRest(fs, "second", "second_part1"); + }, + modifyAgainFs: fs => changeStubToRest(fs, "first", "first_PART1"), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - function addSpread(fs: vfs.FileSystem, project: string, file: string) { - const path = `src/${project}/${file}.ts`; - const content = fs.readFileSync(path, "utf8"); - fs.writeFileSync(path, `${content} + function addSpread(fs: vfs.FileSystem, project: string, file: string) { + const path = `src/${project}/${file}.ts`; + const content = fs.readFileSync(path, "utf8"); + fs.writeFileSync(path, `${content} function ${project}${file}Spread(...b: number[]) { } ${project}${file}Spread(...[10, 20, 30]);`); - replaceText(fs, `src/${project}/tsconfig.json`, `"strict": false,`, `"strict": false, + replaceText(fs, `src/${project}/tsconfig.json`, `"strict": false,`, `"strict": false, "downlevelIteration": true,`); - } + } - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "multiple emitHelpers in all projects", - modifyFs: fs => { - addRest(fs, "first", "first_PART1"); - addSpread(fs, "first", "first_part3"); - addRest(fs, "second", "second_part1"); - addSpread(fs, "second", "second_part2"); - addRest(fs, "third", "third_part1"); - addSpread(fs, "third", "third_part1"); - }, - modifyAgainFs: fs => removeRest(fs, "first", "first_PART1"), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "multiple emitHelpers in all projects", + modifyFs: fs => { + addRest(fs, "first", "first_PART1"); + addSpread(fs, "first", "first_part3"); + addRest(fs, "second", "second_part1"); + addSpread(fs, "second", "second_part2"); + addRest(fs, "third", "third_part1"); + addSpread(fs, "third", "third_part1"); + }, + modifyAgainFs: fs => removeRest(fs, "first", "first_PART1"), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "multiple emitHelpers in different projects", - modifyFs: fs => { - addRest(fs, "first", "first_PART1"); - addSpread(fs, "second", "second_part1"); - addRest(fs, "third", "third_part1"); - }, - modifyAgainFs: fs => removeRest(fs, "first", "first_PART1"), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "multiple emitHelpers in different projects", + modifyFs: fs => { + addRest(fs, "first", "first_PART1"); + addSpread(fs, "second", "second_part1"); + addRest(fs, "third", "third_part1"); + }, + modifyAgainFs: fs => removeRest(fs, "first", "first_PART1"), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // triple slash refs - // changes declaration because its emitted in .d.ts file - function getTripleSlashRef(project: string) { - return `/src/${project}/tripleRef.d.ts`; - } + // triple slash refs + // changes declaration because its emitted in .d.ts file + function getTripleSlashRef(project: string) { + return `/src/${project}/tripleRef.d.ts`; + } - function addTripleSlashRef(fs: vfs.FileSystem, project: string, file: string) { - fs.writeFileSync(getTripleSlashRef(project), `declare class ${project}${file} { }`); - prependText(fs, `src/${project}/${file}.ts`, `/// + function addTripleSlashRef(fs: vfs.FileSystem, project: string, file: string) { + fs.writeFileSync(getTripleSlashRef(project), `declare class ${project}${file} { }`); + prependText(fs, `src/${project}/${file}.ts`, `/// const ${file}Const = new ${project}${file}(); `); - } - - // Verify initial + incremental edits - verifyOutFileScenario({ - scenario: "triple slash refs in all projects", - modifyFs: fs => { - addTripleSlashRef(fs, "first", "first_part2"); - addTripleSlashRef(fs, "second", "second_part1"); - addTripleSlashRef(fs, "third", "third_part1"); - }, - additionalSourceFiles: [ - getTripleSlashRef("first"), getTripleSlashRef("second"), getTripleSlashRef("third") - ] - }); - - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "triple slash refs in one project", - modifyFs: fs => addTripleSlashRef(fs, "second", "second_part1"), - additionalSourceFiles: [ - getTripleSlashRef("second") - ], - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); - - function disableRemoveComments(fs: vfs.FileSystem, file: string) { - replaceText(fs, file, `"removeComments": true`, `"removeComments": false`); - } - - function diableRemoveCommentsInAll(fs: vfs.FileSystem) { - disableRemoveComments(fs, sources[project.first][source.config]); - disableRemoveComments(fs, sources[project.second][source.config]); - disableRemoveComments(fs, sources[project.third][source.config]); - } - - function stripInternalOfThird(fs: vfs.FileSystem) { - replaceText(fs, sources[project.third][source.config], `"declaration": true,`, `"declaration": true, -"stripInternal": true`); - } - - function stripInternalScenario(fs: vfs.FileSystem, removeCommentsDisabled?: boolean, jsDocStyle?: boolean) { - const internal = jsDocStyle ? `/**@internal*/` : `/*@internal*/`; - if (removeCommentsDisabled) { - diableRemoveCommentsInAll(fs); } - stripInternalOfThird(fs); - replaceText(fs, sources[project.first][source.ts][part.one], "interface", `${internal} interface`); - appendText(fs, sources[project.second][source.ts][part.one], ` + + // Verify initial + incremental edits + verifyOutFileScenario({ + scenario: "triple slash refs in all projects", + modifyFs: fs => { + addTripleSlashRef(fs, "first", "first_part2"); + addTripleSlashRef(fs, "second", "second_part1"); + addTripleSlashRef(fs, "third", "third_part1"); + }, + additionalSourceFiles: [ + getTripleSlashRef("first"), getTripleSlashRef("second"), getTripleSlashRef("third") + ] + }); + + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "triple slash refs in one project", + modifyFs: fs => addTripleSlashRef(fs, "second", "second_part1"), + additionalSourceFiles: [ + getTripleSlashRef("second") + ], + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); + + function disableRemoveComments(fs: vfs.FileSystem, file: string) { + replaceText(fs, file, `"removeComments": true`, `"removeComments": false`); + } + + function diableRemoveCommentsInAll(fs: vfs.FileSystem) { + disableRemoveComments(fs, sources[project.first][source.config]); + disableRemoveComments(fs, sources[project.second][source.config]); + disableRemoveComments(fs, sources[project.third][source.config]); + } + + function stripInternalOfThird(fs: vfs.FileSystem) { + replaceText(fs, sources[project.third][source.config], `"declaration": true,`, `"declaration": true, +"stripInternal": true`); + } + + function stripInternalScenario(fs: vfs.FileSystem, removeCommentsDisabled?: boolean, jsDocStyle?: boolean) { + const internal = jsDocStyle ? `/**@internal*/` : `/*@internal*/`; + if (removeCommentsDisabled) { + diableRemoveCommentsInAll(fs); + } + stripInternalOfThird(fs); + replaceText(fs, sources[project.first][source.ts][part.one], "interface", `${internal} interface`); + appendText(fs, sources[project.second][source.ts][part.one], ` class normalC { ${internal} constructor() { } ${internal} prop: string; @@ -789,114 +762,114 @@ ${internal} import internalImport = internalNamespace.someClass; ${internal} type internalType = internalC; ${internal} const internalConst = 10; ${internal} enum internalEnum { a, b, c }`); - } + } - // Verify initial + incremental edits - verifyOutFileScenario({ - scenario: "stripInternal", - modifyFs: stripInternalScenario, - modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"), - }); + // Verify initial + incremental edits + verifyOutFileScenario({ + scenario: "stripInternal", + modifyFs: stripInternalScenario, + modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"), + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "stripInternal with comments emit enabled", - modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ true), - modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "stripInternal with comments emit enabled", + modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ true), + modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "stripInternal jsdoc style comment", - modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ false, /*jsDocStyle*/ true), - modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/**@internal*/ interface`, "interface"), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "stripInternal jsdoc style comment", + modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ false, /*jsDocStyle*/ true), + modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/**@internal*/ interface`, "interface"), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "stripInternal jsdoc style with comments emit enabled", - modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ true, /*jsDocStyle*/ true), - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "stripInternal jsdoc style with comments emit enabled", + modifyFs: fs => stripInternalScenario(fs, /*removeCommentsDisabled*/ true, /*jsDocStyle*/ true), + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - function makeOneTwoThreeDependOrder(fs: vfs.FileSystem) { - replaceText(fs, sources[project.second][source.config], "[", `[ + function makeOneTwoThreeDependOrder(fs: vfs.FileSystem) { + replaceText(fs, sources[project.second][source.config], "[", `[ { "path": "../first", "prepend": true }`); - replaceText(fs, sources[project.third][source.config], `{ "path": "../first", "prepend": true },`, ""); - } + replaceText(fs, sources[project.third][source.config], `{ "path": "../first", "prepend": true },`, ""); + } - function stripInternalWithDependentOrder(fs: vfs.FileSystem, removeCommentsDisabled?: boolean, jsDocStyle?: boolean) { - stripInternalScenario(fs, removeCommentsDisabled, jsDocStyle); - makeOneTwoThreeDependOrder(fs); - } + function stripInternalWithDependentOrder(fs: vfs.FileSystem, removeCommentsDisabled?: boolean, jsDocStyle?: boolean) { + stripInternalScenario(fs, removeCommentsDisabled, jsDocStyle); + makeOneTwoThreeDependOrder(fs); + } - // Verify initial + incremental edits - verifyOutFileScenario({ - scenario: "stripInternal when one-two-three are prepended in order", - modifyFs: stripInternalWithDependentOrder, - modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"), - dependOrdered: true, - }); + // Verify initial + incremental edits + verifyOutFileScenario({ + scenario: "stripInternal when one-two-three are prepended in order", + modifyFs: stripInternalWithDependentOrder, + modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"), + dependOrdered: true, + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "stripInternal with comments emit enabled when one-two-three are prepended in order", - modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ true), - modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"), - dependOrdered: true, - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "stripInternal with comments emit enabled when one-two-three are prepended in order", + modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ true), + modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/*@internal*/ interface`, "interface"), + dependOrdered: true, + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "stripInternal jsdoc style comment when one-two-three are prepended in order", - modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ false, /*jsDocStyle*/ true), - modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/**@internal*/ interface`, "interface"), - dependOrdered: true, - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "stripInternal jsdoc style comment when one-two-three are prepended in order", + modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ false, /*jsDocStyle*/ true), + modifyAgainFs: fs => replaceText(fs, sources[project.first][source.ts][part.one], `/**@internal*/ interface`, "interface"), + dependOrdered: true, + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "stripInternal jsdoc style with comments emit enabled when one-two-three are prepended in order", - modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ true, /*jsDocStyle*/ true), - dependOrdered: true, - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "stripInternal jsdoc style with comments emit enabled when one-two-three are prepended in order", + modifyFs: fs => stripInternalWithDependentOrder(fs, /*removeCommentsDisabled*/ true, /*jsDocStyle*/ true), + dependOrdered: true, + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - function makeThirdEmptySourceFile(fs: vfs.FileSystem) { - fs.writeFileSync(sources[project.third][source.ts][part.one], "", "utf8"); - } + function makeThirdEmptySourceFile(fs: vfs.FileSystem) { + fs.writeFileSync(sources[project.third][source.ts][part.one], "", "utf8"); + } - // Verify ignore without build info and dtsChanged - verifyOutFileScenario({ - scenario: "when source files are empty in the own file", - modifyFs: makeThirdEmptySourceFile, - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - baselineOnly: true - }); + // Verify ignore without build info and dtsChanged + verifyOutFileScenario({ + scenario: "when source files are empty in the own file", + modifyFs: makeThirdEmptySourceFile, + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + baselineOnly: true + }); - // only baseline - verifyOutFileScenario({ - scenario: "stripInternal baseline when internal is inside another internal", - modifyFs: fs => { - stripInternalOfThird(fs); - prependText(fs, sources[project.first][source.ts][part.one], `namespace ts { + // only baseline + verifyOutFileScenario({ + scenario: "stripInternal baseline when internal is inside another internal", + modifyFs: fs => { + stripInternalOfThird(fs); + prependText(fs, sources[project.first][source.ts][part.one], `namespace ts { /* @internal */ /** * Subset of properties from SourceFile that are used in multiple utility functions @@ -924,19 +897,19 @@ ${internal} enum internalEnum { a, b, c }`); someProp: string; } }`); - }, - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - ignoreDtsUnchanged: true, - baselineOnly: true - }); + }, + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + ignoreDtsUnchanged: true, + baselineOnly: true + }); - // only baseline - verifyOutFileScenario({ - scenario: "stripInternal when few members of enum are internal", - modifyFs: fs => { - stripInternalOfThird(fs); - prependText(fs, sources[project.first][source.ts][part.one], `enum TokenFlags { + // only baseline + verifyOutFileScenario({ + scenario: "stripInternal when few members of enum are internal", + modifyFs: fs => { + stripInternalOfThird(fs); + prependText(fs, sources[project.first][source.ts][part.one], `enum TokenFlags { None = 0, /* @internal */ PrecedingLineBreak = 1 << 0, @@ -959,26 +932,27 @@ ${internal} enum internalEnum { a, b, c }`); NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator } `); - }, - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - ignoreDtsUnchanged: true, - baselineOnly: true - }); + }, + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + ignoreDtsUnchanged: true, + baselineOnly: true + }); - // only baseline - verifyOutFileScenario({ - scenario: "declarationMap and sourceMap disabled", - modifyFs: fs => { - makeThirdEmptySourceFile(fs); - replaceText(fs, sources[project.third][source.config], `"composite": true,`, ""); - replaceText(fs, sources[project.third][source.config], `"sourceMap": true,`, ""); - replaceText(fs, sources[project.third][source.config], `"declarationMap": true,`, ""); - }, - ignoreWithoutBuildInfo: true, - ignoreDtsChanged: true, - ignoreDtsUnchanged: true, - baselineOnly: true + // only baseline + verifyOutFileScenario({ + scenario: "declarationMap and sourceMap disabled", + modifyFs: fs => { + makeThirdEmptySourceFile(fs); + replaceText(fs, sources[project.third][source.config], `"composite": true,`, ""); + replaceText(fs, sources[project.third][source.config], `"sourceMap": true,`, ""); + replaceText(fs, sources[project.third][source.config], `"declarationMap": true,`, ""); + }, + ignoreWithoutBuildInfo: true, + ignoreDtsChanged: true, + ignoreDtsUnchanged: true, + baselineOnly: true + }); }); }); } diff --git a/src/testRunner/unittests/tsbuild/referencesWithRootDirInParent.ts b/src/testRunner/unittests/tsbuild/referencesWithRootDirInParent.ts index e10c36a4f21..630cd8575ec 100644 --- a/src/testRunner/unittests/tsbuild/referencesWithRootDirInParent.ts +++ b/src/testRunner/unittests/tsbuild/referencesWithRootDirInParent.ts @@ -1,5 +1,14 @@ namespace ts { describe("unittests:: tsbuild:: with rootDir of project reference in parentDirectory", () => { + let projFs: vfs.FileSystem; + before(() => { + projFs = loadProjectFromDisk("tests/projects/projectReferenceWithRootDirInParent"); + }); + + after(() => { + projFs = undefined!; // Release the contents + }); + it("verify that it builds correctly", () => { const projFs = loadProjectFromDisk("tests/projects/projectReferenceWithRootDirInParent"); const allExpectedOutputs = [ @@ -16,5 +25,104 @@ namespace ts { assert(fs.existsSync(output), `Expect file ${output} to exist`); } }); + + it("verify that it reports error for same .tsbuildinfo file because no rootDir in the base", () => { + const allExpectedOutputs = [ + "/src/dist/other.js", "/src/dist/other.d.ts", + "/src/dist/tsconfig.tsbuildinfo" + ]; + const missingOutputs = [ + "/src/dist/a.js", "/src/dist/a.d.ts", + "/src/dist/b.js", "/src/dist/b.d.ts" + ]; + const fs = projFs.shadow(); + replaceText(fs, "/src/tsconfig.base.json", `"rootDir": "./src/",`, ""); + const host = new fakes.SolutionBuilderHost(fs); + const builder = createSolutionBuilder(host, ["/src/src/main"], { verbose: true }); + builder.buildAllProjects(); + host.assertDiagnosticMessages( + getExpectedDiagnosticForProjectsInBuild("src/src/other/tsconfig.json", "src/src/main/tsconfig.json"), + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/other/tsconfig.json", "src/dist/other.js"], + [Diagnostics.Building_project_0, "/src/src/other/tsconfig.json"], + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/main/tsconfig.json", "src/dist/a.js"], + [Diagnostics.Building_project_0, "/src/src/main/tsconfig.json"], + [Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, "/src/dist/tsconfig.tsbuildinfo", "/src/src/other"] + ); + for (const output of allExpectedOutputs) { + assert(fs.existsSync(output), `Expect file ${output} to exist`); + } + for (const output of missingOutputs) { + assert.isFalse(fs.existsSync(output), `Expect file ${output} to not exist`); + } + }); + + it("verify that it reports error for same .tsbuildinfo file", () => { + const allExpectedOutputs = [ + "/src/dist/other.js", "/src/dist/other.d.ts", + "/src/dist/tsconfig.tsbuildinfo" + ]; + const missingOutputs = [ + "/src/dist/a.js", "/src/dist/a.d.ts", + "/src/dist/b.js", "/src/dist/b.d.ts" + ]; + const fs = projFs.shadow(); + fs.writeFileSync("/src/src/main/tsconfig.json", JSON.stringify({ + compilerOptions: { composite: true, outDir: "../../dist/" }, + references: [{ path: "../other" }] + })); + fs.writeFileSync("/src/src/other/tsconfig.json", JSON.stringify({ + compilerOptions: { composite: true, outDir: "../../dist/" }, + })); + const host = new fakes.SolutionBuilderHost(fs); + const builder = createSolutionBuilder(host, ["/src/src/main"], { verbose: true }); + builder.buildAllProjects(); + host.assertDiagnosticMessages( + getExpectedDiagnosticForProjectsInBuild("src/src/other/tsconfig.json", "src/src/main/tsconfig.json"), + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/other/tsconfig.json", "src/dist/other.js"], + [Diagnostics.Building_project_0, "/src/src/other/tsconfig.json"], + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/main/tsconfig.json", "src/dist/a.js"], + [Diagnostics.Building_project_0, "/src/src/main/tsconfig.json"], + [Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, "/src/dist/tsconfig.tsbuildinfo", "/src/src/other"] + ); + for (const output of allExpectedOutputs) { + assert(fs.existsSync(output), `Expect file ${output} to exist`); + } + for (const output of missingOutputs) { + assert.isFalse(fs.existsSync(output), `Expect file ${output} to not exist`); + } + }); + + it("verify that it reports no error when .tsbuildinfo differ", () => { + const allExpectedOutputs = [ + "/src/dist/other.js", "/src/dist/other.d.ts", + "/src/dist/tsconfig.main.tsbuildinfo", + "/src/dist/a.js", "/src/dist/a.d.ts", + "/src/dist/b.js", "/src/dist/b.d.ts", + "/src/dist/tsconfig.other.tsbuildinfo" + ]; + const fs = projFs.shadow(); + fs.renameSync("/src/src/main/tsconfig.json", "/src/src/main/tsconfig.main.json"); + fs.renameSync("/src/src/other/tsconfig.json", "/src/src/other/tsconfig.other.json"); + fs.writeFileSync("/src/src/main/tsconfig.main.json", JSON.stringify({ + compilerOptions: { composite: true, outDir: "../../dist/" }, + references: [{ path: "../other/tsconfig.other.json" }] + })); + fs.writeFileSync("/src/src/other/tsconfig.other.json", JSON.stringify({ + compilerOptions: { composite: true, outDir: "../../dist/" }, + })); + const host = new fakes.SolutionBuilderHost(fs); + const builder = createSolutionBuilder(host, ["/src/src/main/tsconfig.main.json"], { verbose: true }); + builder.buildAllProjects(); + host.assertDiagnosticMessages( + getExpectedDiagnosticForProjectsInBuild("src/src/other/tsconfig.other.json", "src/src/main/tsconfig.main.json"), + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/other/tsconfig.other.json", "src/dist/other.js"], + [Diagnostics.Building_project_0, "/src/src/other/tsconfig.other.json"], + [Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/src/main/tsconfig.main.json", "src/dist/a.js"], + [Diagnostics.Building_project_0, "/src/src/main/tsconfig.main.json"] + ); + for (const output of allExpectedOutputs) { + assert(fs.existsSync(output), `Expect file ${output} to exist`); + } + }); }); } diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index cababb2c774..6385dbafb27 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -366,14 +366,14 @@ export class cNew {}`); "TSFILE: /src/core/index.js", "TSFILE: /src/core/index.d.ts", "TSFILE: /src/core/index.d.ts.map", - "TSFILE: /src/core/.tsbuildinfo", + "TSFILE: /src/core/tsconfig.tsbuildinfo", "TSFILE: /src/logic/index.js", "TSFILE: /src/logic/index.js.map", "TSFILE: /src/logic/index.d.ts", - "TSFILE: /src/logic/.tsbuildinfo", + "TSFILE: /src/logic/tsconfig.tsbuildinfo", "TSFILE: /src/tests/index.js", "TSFILE: /src/tests/index.d.ts", - "TSFILE: /src/tests/.tsbuildinfo", + "TSFILE: /src/tests/tsconfig.tsbuildinfo", ]); }); }); @@ -410,9 +410,9 @@ export class cNew {}`); "/src/logic/index.d.ts", // build info - "/src/core/.tsbuildinfo", - "/src/logic/.tsbuildinfo", - "/src/tests/.tsbuildinfo" + "/src/core/tsconfig.tsbuildinfo", + "/src/logic/tsconfig.tsbuildinfo", + "/src/tests/tsconfig.tsbuildinfo" ] ) }; @@ -454,9 +454,9 @@ export class someClass { }`), "/src/logic/index.d.ts", // build info - "/src/core/.tsbuildinfo", - "/src/logic/.tsbuildinfo", - "/src/tests/.tsbuildinfo", + "/src/core/tsconfig.tsbuildinfo", + "/src/logic/tsconfig.tsbuildinfo", + "/src/tests/tsconfig.tsbuildinfo", "/src/tests/index.d.ts", // to check if d.ts has changed ], @@ -517,7 +517,7 @@ class someClass { }`), "/src/core/index.d.ts", // build info - "/src/core/.tsbuildinfo", + "/src/core/tsconfig.tsbuildinfo", ], ) }, @@ -548,7 +548,7 @@ class someClass { }`), "/src/core/anotherModule.d.ts", // Since its generated again without .buildInfo // build info - "/src/core/.tsbuildinfo", + "/src/core/tsconfig.tsbuildinfo", ], ) } @@ -560,14 +560,14 @@ class someClass { }`), "/src/core/index.js", "/src/core/index.d.ts", "/src/core/index.d.ts.map", - "/src/core/.tsbuildinfo", + "/src/core/tsconfig.tsbuildinfo", "/src/logic/index.js", "/src/logic/index.js.map", "/src/logic/index.d.ts", - "/src/logic/.tsbuildinfo", + "/src/logic/tsconfig.tsbuildinfo", "/src/tests/index.js", "/src/tests/index.d.ts", - "/src/tests/.tsbuildinfo", + "/src/tests/tsconfig.tsbuildinfo", ] }); @@ -614,8 +614,8 @@ class someClass { }`), "/src/logic/decls/index.d.ts", // build info - "/src/logic/.tsbuildinfo", - "/src/tests/.tsbuildinfo", + "/src/logic/tsconfig.tsbuildinfo", + "/src/tests/tsconfig.tsbuildinfo", "/src/tests/index.d.ts", // to check if d.ts has changed ] @@ -628,14 +628,14 @@ class someClass { }`), "/src/core/index.js", "/src/core/index.d.ts", "/src/core/index.d.ts.map", - "/src/core/.tsbuildinfo", + "/src/core/tsconfig.tsbuildinfo", "/src/logic/index.js", "/src/logic/index.js.map", "/src/logic/decls/index.d.ts", - "/src/logic/.tsbuildinfo", + "/src/logic/tsconfig.tsbuildinfo", "/src/tests/index.js", "/src/tests/index.d.ts", - "/src/tests/.tsbuildinfo", + "/src/tests/tsconfig.tsbuildinfo", ], ignoreWithoutBuildInfo: true }); diff --git a/src/testRunner/unittests/tsbuildWatchMode.ts b/src/testRunner/unittests/tsbuildWatchMode.ts index 62adc0386f2..87b3e6d2208 100644 --- a/src/testRunner/unittests/tsbuildWatchMode.ts +++ b/src/testRunner/unittests/tsbuildWatchMode.ts @@ -513,7 +513,7 @@ let x: string = 10;`); changeExtension(fileWithError.path, Extension.Dts), changeExtension(fileWithoutError.path, Extension.Js), changeExtension(fileWithoutError.path, Extension.Dts), - `${subProjectLocation}/${infoFile}` + `${subProjectLocation}/tsconfig${Extension.TsBuildInfo}` ]; function verifyDtsErrors(host: TsBuildWatchSystem, isIncremental: boolean, expectedErrors: ReadonlyArray) { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index f9f46e38b4b..98701b409cf 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2542,6 +2542,7 @@ declare namespace ts { reactNamespace?: string; jsxFactory?: string; composite?: boolean; + incremental?: boolean; removeComments?: boolean; rootDir?: string; rootDirs?: string[]; @@ -2718,7 +2719,8 @@ declare namespace ts { Dts = ".d.ts", Js = ".js", Jsx = ".jsx", - Json = ".json" + Json = ".json", + TsBuildInfo = ".tsbuildinfo" } interface ResolvedModuleWithFailedLookupLocations { readonly resolvedModule: ResolvedModuleFull | undefined; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index cbb7e00a96c..ec520a06b8c 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2542,6 +2542,7 @@ declare namespace ts { reactNamespace?: string; jsxFactory?: string; composite?: boolean; + incremental?: boolean; removeComments?: boolean; rootDir?: string; rootDirs?: string[]; @@ -2718,7 +2719,8 @@ declare namespace ts { Dts = ".d.ts", Js = ".js", Jsx = ".jsx", - Json = ".json" + Json = ".json", + TsBuildInfo = ".tsbuildinfo" } interface ResolvedModuleWithFailedLookupLocations { readonly resolvedModule: ResolvedModuleFull | undefined; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/baseline-sectioned-sourcemaps.js index 48271cc081c..046dd5e833e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/baseline-sectioned-sourcemaps.js @@ -1,61 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 109, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 156, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-109) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-156) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -356,6 +298,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 109, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 156, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-109) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-156) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -370,159 +370,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 109, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 109, - "kind": "text" - } - ] - }, - { - "pos": 109, - "end": 394, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 109, - "end": 394, - "kind": "text" - } - ] - }, - { - "pos": 394, - "end": 430, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 156, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 156, - "kind": "text" - } - ] - }, - { - "pos": 156, - "end": 256, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 156, - "end": 256, - "kind": "text" - } - ] - }, - { - "pos": 256, - "end": 275, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-109):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-109) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (109-394):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (109-394) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (394-430) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-156):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-156) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (156-256):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (156-256) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (256-275) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1258,3 +1105,156 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 109, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 109, + "kind": "text" + } + ] + }, + { + "pos": 109, + "end": 394, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 109, + "end": 394, + "kind": "text" + } + ] + }, + { + "pos": 394, + "end": 430, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 156, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 156, + "kind": "text" + } + ] + }, + { + "pos": 156, + "end": 256, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 156, + "end": 256, + "kind": "text" + } + ] + }, + { + "pos": 256, + "end": 275, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-109):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-109) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (109-394):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (109-394) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (394-430) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-156):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-156) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (156-256):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (156-256) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (256-275) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/emitHelpers-in-all-projects.js index 2685833ac4d..de94cd72b55 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/emitHelpers-in-all-projects.js @@ -1,87 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 643, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 207, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -text: (417-643) -var s = "Hola, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-207) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -473,6 +389,90 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 643, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 207, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +text: (417-643) +var s = "Hola, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-207) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -489,193 +489,6 @@ function forfirstfirst_PART1Rest() { const { b, ...rest } = { a: 10, b: 30, yy: 30 }; } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 643, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 417, - "end": 643, - "kind": "text" - } - ] - }, - { - "pos": 643, - "end": 1047, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 643, - "end": 1047, - "kind": "text" - } - ] - }, - { - "pos": 1047, - "end": 1200, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 207, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 207, - "kind": "text" - } - ] - }, - { - "pos": 207, - "end": 360, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 207, - "end": 360, - "kind": "text" - } - ] - }, - { - "pos": 360, - "end": 430, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (417-643):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (417-643) -var s = "Hola, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (643-1047):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (643-1047) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (1047-1200) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-207):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-207) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (207-360):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (207-360) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (360-430) -declare var c: C; -declare function forthirdthird_part1Rest(): void; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1645,3 +1458,190 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 643, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 417, + "end": 643, + "kind": "text" + } + ] + }, + { + "pos": 643, + "end": 1047, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 643, + "end": 1047, + "kind": "text" + } + ] + }, + { + "pos": 1047, + "end": 1200, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 207, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 207, + "kind": "text" + } + ] + }, + { + "pos": 207, + "end": 360, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 207, + "end": 360, + "kind": "text" + } + ] + }, + { + "pos": 360, + "end": 430, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (417-643):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (417-643) +var s = "Hola, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (643-1047):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (643-1047) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (1047-1200) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-207):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-207) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (207-360):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (207-360) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (360-430) +declare var c: C; +declare function forthirdthird_part1Rest(): void; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/multiple-prologues-in-all-projects.js index 27b10b51849..5f20a459a71 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/multiple-prologues-in-all-projects.js @@ -1,107 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 28, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 30, - "end": 139, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue\"", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - }, - { - "pos": 0, - "end": 12, - "expression": { - "pos": 0, - "end": 12, - "text": "myPrologue" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 156, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prologue: (15-28):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -text: (30-139) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-156) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -419,27 +315,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -457,45 +340,7 @@ console.log(s); }, { "pos": 30, - "end": 44, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 46, - "end": 60, - "kind": "prologue", - "data": "myPrologue3" - }, - { - "pos": 62, - "end": 171, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 62, - "end": 171, - "kind": "text" - } - ] - }, - { - "pos": 171, - "end": 456, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 171, - "end": 456, - "kind": "text" - } - ] - }, - { - "pos": 456, - "end": 492, + "end": 139, "kind": "text" } ], @@ -503,7 +348,7 @@ console.log(s); "prologues": [ { "file": 0, - "text": "\"myPrologue3\";\n\"myPrologue\";", + "text": "\"myPrologue\"", "directives": [ { "pos": -1, @@ -516,19 +361,10 @@ console.log(s); }, { "pos": 0, - "end": 14, + "end": 12, "expression": { "pos": 0, - "end": 13, - "text": "myPrologue3" - } - }, - { - "pos": 14, - "end": 28, - "expression": { - "pos": 14, - "end": 27, + "end": 12, "text": "myPrologue" } } @@ -542,32 +378,6 @@ console.log(s); { "pos": 0, "end": 156, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 156, - "kind": "text" - } - ] - }, - { - "pos": 156, - "end": 256, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 156, - "end": 256, - "kind": "text" - } - ] - }, - { - "pos": 256, - "end": 275, "kind": "text" } ] @@ -575,9 +385,9 @@ console.log(s); } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; @@ -585,15 +395,7 @@ prologue: (0-13):: use strict prologue: (15-28):: myPrologue "myPrologue"; ---------------------------------------------------------------------- -prologue: (30-44):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -prologue: (46-60):: myPrologue3 -"myPrologue3"; ----------------------------------------------------------------------- -prepend: (62-171):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (62-171) +text: (30-139) var s = "Hola, world"; console.log(s); console.log(f()); @@ -601,37 +403,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (171-456):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (171-456) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (456-492) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-156):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-156) interface TheFirst { none: any; @@ -642,24 +417,23 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (156-256):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (156-256) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (256-275) -declare var c: C; - ====================================================================== +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1458,3 +1232,229 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 28, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 30, + "end": 44, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 46, + "end": 60, + "kind": "prologue", + "data": "myPrologue3" + }, + { + "pos": 62, + "end": 171, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 62, + "end": 171, + "kind": "text" + } + ] + }, + { + "pos": 171, + "end": 456, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 171, + "end": 456, + "kind": "text" + } + ] + }, + { + "pos": 456, + "end": 492, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "\"myPrologue3\";\n\"myPrologue\";", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + }, + { + "pos": 0, + "end": 14, + "expression": { + "pos": 0, + "end": 13, + "text": "myPrologue3" + } + }, + { + "pos": 14, + "end": 28, + "expression": { + "pos": 14, + "end": 27, + "text": "myPrologue" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 156, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 156, + "kind": "text" + } + ] + }, + { + "pos": 156, + "end": 256, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 156, + "end": 256, + "kind": "text" + } + ] + }, + { + "pos": 256, + "end": 275, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-28):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prologue: (30-44):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +prologue: (46-60):: myPrologue3 +"myPrologue3"; +---------------------------------------------------------------------- +prepend: (62-171):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (62-171) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (171-456):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (171-456) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (456-492) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-156):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-156) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (156-256):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (156-256) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (256-275) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/shebang-in-all-projects.js index 11872ce15f0..347504840a5 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/shebang-in-all-projects.js @@ -1,61 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 33, - "end": 142, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 33, - "end": 189, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (33-142) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (33-189) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts] #!someshebang first first_PART1 interface TheFirst { @@ -363,6 +305,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 33, + "end": 142, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 33, + "end": 189, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (33-142) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (33-189) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] #!someshebang first first_PART1 interface TheFirst { @@ -378,159 +378,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 33, - "end": 142, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 33, - "end": 142, - "kind": "text" - } - ] - }, - { - "pos": 142, - "end": 427, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 142, - "end": 427, - "kind": "text" - } - ] - }, - { - "pos": 427, - "end": 463, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 33, - "end": 189, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 33, - "end": 189, - "kind": "text" - } - ] - }, - { - "pos": 189, - "end": 289, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 189, - "end": 289, - "kind": "text" - } - ] - }, - { - "pos": 289, - "end": 308, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (33-142):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (33-142) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (142-427):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (142-427) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (427-463) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (33-189):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (33-189) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (189-289):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (189-289) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (289-308) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang first first_PART1 interface TheFirst { @@ -1277,3 +1124,156 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 33, + "end": 142, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 33, + "end": 142, + "kind": "text" + } + ] + }, + { + "pos": 142, + "end": 427, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 142, + "end": 427, + "kind": "text" + } + ] + }, + { + "pos": 427, + "end": 463, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 33, + "end": 189, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 33, + "end": 189, + "kind": "text" + } + ] + }, + { + "pos": 189, + "end": 289, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 189, + "end": 289, + "kind": "text" + } + ] + }, + { + "pos": 289, + "end": 308, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (33-142):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (33-142) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (142-427):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (142-427) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (427-463) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (33-189):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (33-189) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (189-289):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (189-289) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (289-308) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/strict-in-all-projects.js index d92c1507a29..7416f49d989 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/strict-in-all-projects.js @@ -1,89 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 124, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 156, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -text: (15-124) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-156) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -386,26 +300,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -418,32 +320,6 @@ console.log(s); { "pos": 15, "end": 124, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 15, - "end": 124, - "kind": "text" - } - ] - }, - { - "pos": 124, - "end": 409, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 124, - "end": 409, - "kind": "text" - } - ] - }, - { - "pos": 409, - "end": 445, "kind": "text" } ], @@ -472,32 +348,6 @@ console.log(s); { "pos": 0, "end": 156, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 156, - "kind": "text" - } - ] - }, - { - "pos": 156, - "end": 256, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 156, - "end": 256, - "kind": "text" - } - ] - }, - { - "pos": 256, - "end": 275, "kind": "text" } ] @@ -505,15 +355,13 @@ console.log(s); } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; ---------------------------------------------------------------------- -prepend: (15-124):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- text: (15-124) var s = "Hola, world"; console.log(s); @@ -522,37 +370,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (124-409):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (124-409) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (409-445) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-156):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-156) interface TheFirst { none: any; @@ -563,24 +384,22 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (156-256):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (156-256) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (256-275) -declare var c: C; - ====================================================================== +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1318,3 +1137,184 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 124, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 15, + "end": 124, + "kind": "text" + } + ] + }, + { + "pos": 124, + "end": 409, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 124, + "end": 409, + "kind": "text" + } + ] + }, + { + "pos": 409, + "end": 445, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 156, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 156, + "kind": "text" + } + ] + }, + { + "pos": 156, + "end": 256, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 156, + "end": 256, + "kind": "text" + } + ] + }, + { + "pos": 256, + "end": 275, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prepend: (15-124):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (15-124) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (124-409):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (124-409) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (409-445) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-156):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-156) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (156-256):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (156-256) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (256-275) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js index 0b727b90b56..b227c1bb7bc 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,303 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 109, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 109, - "kind": "text" - } - ] - }, - { - "pos": 109, - "end": 3161, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 156, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 156, - "kind": "text" - } - ] - }, - { - "pos": 156, - "end": 233, - "kind": "text" - }, - { - "pos": 233, - "end": 307, - "kind": "internal" - }, - { - "pos": 309, - "end": 341, - "kind": "text" - }, - { - "pos": 341, - "end": 733, - "kind": "internal" - }, - { - "pos": 735, - "end": 738, - "kind": "text" - }, - { - "pos": 738, - "end": 1151, - "kind": "internal" - }, - { - "pos": 1153, - "end": 1201, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-109):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-109) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (109-3161) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-156):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (41-156) -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (156-233) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (233-307) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (309-341) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (341-733) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (735-738) -} - ----------------------------------------------------------------------- -internal: (738-1151) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1153-1201) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -2837,20 +2537,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 109, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 109, + "kind": "text" + } + ] + }, + { + "pos": 109, + "end": 3161, "kind": "text" } ] @@ -2859,12 +2571,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 156, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 156, + "kind": "text" + } + ] + }, + { + "pos": 156, + "end": 233, + "kind": "text" + }, + { + "pos": 233, + "end": 307, "kind": "internal" }, { - "pos": 41, - "end": 156, + "pos": 309, + "end": 341, + "kind": "text" + }, + { + "pos": 341, + "end": 733, + "kind": "internal" + }, + { + "pos": 735, + "end": 738, + "kind": "text" + }, + { + "pos": 738, + "end": 1151, + "kind": "internal" + }, + { + "pos": 1153, + "end": 1201, "kind": "text" } ] @@ -2872,10 +2627,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-109):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-109) var s = "Hola, world"; console.log(s); @@ -2884,15 +2641,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (109-3161) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-156):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-39) interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (41-156) declare const s = "Hola, world"; interface NoJsForHereEither { @@ -2900,6 +2764,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (156-233) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (233-307) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (309-341) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (341-733) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (735-738) +} + +---------------------------------------------------------------------- +internal: (738-1151) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1153-1201) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.d.ts] @@ -3202,6 +3137,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 109, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 156, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-109) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-156) +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -3216,211 +3216,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3161, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3161, - "kind": "text" - } - ] - }, - { - "pos": 3161, - "end": 3197, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 275, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 275, - "kind": "text" - } - ] - }, - { - "pos": 275, - "end": 294, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3161):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3161) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3161-3197) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-275):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-275) -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (275-294) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hola, world"; interface NoJsForHereEither { @@ -5457,3 +5252,208 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3161, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3161, + "kind": "text" + } + ] + }, + { + "pos": 3161, + "end": 3197, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 275, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 275, + "kind": "text" + } + ] + }, + { + "pos": 275, + "end": 294, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3161):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3161) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3161-3197) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-275):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-275) +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (275-294) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/stripInternal.js index eb141c82e1c..2319ab872c9 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/stripInternal.js @@ -1,68 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 109, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 156, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-109) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ----------------------------------------------------------------------- -text: (41-156) -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -363,6 +298,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 109, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 156, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-109) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-156) +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -377,247 +377,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 109, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 109, - "kind": "text" - } - ] - }, - { - "pos": 109, - "end": 3161, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 109, - "end": 3161, - "kind": "text" - } - ] - }, - { - "pos": 3161, - "end": 3197, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 115, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 115, - "kind": "text" - } - ] - }, - { - "pos": 115, - "end": 275, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 115, - "end": 275, - "kind": "text" - } - ] - }, - { - "pos": 275, - "end": 294, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-109):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-109) -var s = "Hola, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (109-3161):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (109-3161) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3161-3197) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-115):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-115) -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (115-275):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (115-275) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (275-294) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hola, world"; interface NoJsForHereEither { @@ -2654,3 +2413,244 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 109, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 109, + "kind": "text" + } + ] + }, + { + "pos": 109, + "end": 3161, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 109, + "end": 3161, + "kind": "text" + } + ] + }, + { + "pos": 3161, + "end": 3197, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 115, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 115, + "kind": "text" + } + ] + }, + { + "pos": 115, + "end": 275, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 115, + "end": 275, + "kind": "text" + } + ] + }, + { + "pos": 275, + "end": 294, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-109):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-109) +var s = "Hola, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (109-3161):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (109-3161) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3161-3197) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-115):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-115) +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (115-275):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (115-275) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (275-294) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/triple-slash-refs-in-all-projects.js index 76afdf009c1..49a321fe6c5 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/buildInfo/triple-slash-refs-in-all-projects.js @@ -1,72 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 42, - "kind": "reference", - "data": "../tripleRef.d.ts" - }, - { - "pos": 44, - "end": 251, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-157) -var s = "Hola, world"; -console.log(s); -var first_part2Const = new firstfirst_part2(); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -reference: (0-42):: ../tripleRef.d.ts -/// ----------------------------------------------------------------------- -text: (44-251) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare const first_part2Const: firstfirst_part2; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts] /// interface TheFirst { @@ -424,6 +355,75 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 42, + "kind": "reference", + "data": "../tripleRef.d.ts" + }, + { + "pos": 44, + "end": 251, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-157) +var s = "Hola, world"; +console.log(s); +var first_part2Const = new firstfirst_part2(); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +reference: (0-42):: ../tripleRef.d.ts +/// +---------------------------------------------------------------------- +text: (44-251) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare const first_part2Const: firstfirst_part2; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -438,192 +438,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 493, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 157, - "end": 493, - "kind": "text" - } - ] - }, - { - "pos": 493, - "end": 577, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 45, - "kind": "reference", - "data": "../../tripleRef.d.ts" - }, - { - "pos": 47, - "end": 101, - "kind": "reference", - "data": "../../../first/tripleRef.d.ts" - }, - { - "pos": 103, - "end": 158, - "kind": "reference", - "data": "../../../second/tripleRef.d.ts" - }, - { - "pos": 160, - "end": 367, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 160, - "end": 367, - "kind": "text" - } - ] - }, - { - "pos": 367, - "end": 521, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 367, - "end": 521, - "kind": "text" - } - ] - }, - { - "pos": 521, - "end": 591, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -var s = "Hola, world"; -console.log(s); -var first_part2Const = new firstfirst_part2(); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (157-493):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (157-493) -var second_part1Const = new secondsecond_part1(); -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (493-577) -var third_part1Const = new thirdthird_part1(); -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -reference: (0-45):: ../../tripleRef.d.ts -/// ----------------------------------------------------------------------- -reference: (47-101):: ../../../first/tripleRef.d.ts -/// ----------------------------------------------------------------------- -reference: (103-158):: ../../../second/tripleRef.d.ts -/// ----------------------------------------------------------------------- -prepend: (160-367):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (160-367) -interface TheFirst { - none: any; -} -declare const s = "Hola, world"; -interface NoJsForHereEither { - none: any; -} -declare const first_part2Const: firstfirst_part2; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (367-521):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (367-521) -declare const second_part1Const: secondsecond_part1; -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (521-591) -declare const third_part1Const: thirdthird_part1; -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] /// /// @@ -1525,3 +1339,189 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 493, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 157, + "end": 493, + "kind": "text" + } + ] + }, + { + "pos": 493, + "end": 577, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 45, + "kind": "reference", + "data": "../../tripleRef.d.ts" + }, + { + "pos": 47, + "end": 101, + "kind": "reference", + "data": "../../../first/tripleRef.d.ts" + }, + { + "pos": 103, + "end": 158, + "kind": "reference", + "data": "../../../second/tripleRef.d.ts" + }, + { + "pos": 160, + "end": 367, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 160, + "end": 367, + "kind": "text" + } + ] + }, + { + "pos": 367, + "end": 521, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 367, + "end": 521, + "kind": "text" + } + ] + }, + { + "pos": 521, + "end": 591, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +var s = "Hola, world"; +console.log(s); +var first_part2Const = new firstfirst_part2(); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (157-493):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (157-493) +var second_part1Const = new secondsecond_part1(); +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (493-577) +var third_part1Const = new thirdthird_part1(); +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +reference: (0-45):: ../../tripleRef.d.ts +/// +---------------------------------------------------------------------- +reference: (47-101):: ../../../first/tripleRef.d.ts +/// +---------------------------------------------------------------------- +reference: (103-158):: ../../../second/tripleRef.d.ts +/// +---------------------------------------------------------------------- +prepend: (160-367):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (160-367) +interface TheFirst { + none: any; +} +declare const s = "Hola, world"; +interface NoJsForHereEither { + none: any; +} +declare const first_part2Const: firstfirst_part2; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (367-521):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (367-521) +declare const second_part1Const: secondsecond_part1; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (521-591) +declare const third_part1Const: thirdthird_part1; +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/baseline-sectioned-sourcemaps.js index 8be84adf5fc..47428409f83 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/baseline-sectioned-sourcemaps.js @@ -1,62 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -242,6 +183,65 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -256,160 +256,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 412, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 127, - "end": 412, - "kind": "text" - } - ] - }, - { - "pos": 412, - "end": 448, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (127-412):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (127-412) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (412-448) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -910,3 +756,157 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 412, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 127, + "end": 412, + "kind": "text" + } + ] + }, + { + "pos": 412, + "end": 448, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (127-412):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (127-412) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (412-448) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/emitHelpers-in-all-projects.js index 91010853c0d..3b7d22b3732 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/emitHelpers-in-all-projects.js @@ -1,88 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 661, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -text: (417-661) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; @@ -338,6 +253,91 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 661, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +text: (417-661) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -354,194 +354,6 @@ function forfirstfirst_PART1Rest() { const { b, ...rest } = { a: 10, b: 30, yy: 30 }; }console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 661, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 417, - "end": 661, - "kind": "text" - } - ] - }, - { - "pos": 661, - "end": 1065, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 661, - "end": 1065, - "kind": "text" - } - ] - }, - { - "pos": 1065, - "end": 1218, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 361, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 361, - "kind": "text" - } - ] - }, - { - "pos": 361, - "end": 431, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (417-661):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (417-661) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (661-1065):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (661-1065) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (1065-1218) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-361) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (361-431) -declare var c: C; -declare function forthirdthird_part1Rest(): void; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; @@ -1218,3 +1030,191 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 661, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 417, + "end": 661, + "kind": "text" + } + ] + }, + { + "pos": 661, + "end": 1065, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 661, + "end": 1065, + "kind": "text" + } + ] + }, + { + "pos": 1065, + "end": 1218, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 361, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 361, + "kind": "text" + } + ] + }, + { + "pos": 361, + "end": 431, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (417-661):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (417-661) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (661-1065):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (661-1065) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (1065-1218) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-361) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (361-431) +declare var c: C; +declare function forthirdthird_part1Rest(): void; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/emitHelpers-in-only-one-dependency-project.js index 16c43900d86..6b4231c4900 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/emitHelpers-in-only-one-dependency-project.js @@ -1,64 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 167, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-167) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -262,6 +201,67 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 167, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-167) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -276,183 +276,6 @@ interface NoJsForHereEither { console.log(s); function forfirstfirst_PART1Rest() { }console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 584, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 417, - "end": 584, - "kind": "text" - } - ] - }, - { - "pos": 584, - "end": 988, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 584, - "end": 988, - "kind": "text" - } - ] - }, - { - "pos": 988, - "end": 1024, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 361, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 361, - "kind": "text" - } - ] - }, - { - "pos": 361, - "end": 380, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (417-584):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (417-584) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (584-988):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (584-988) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (988-1024) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-361) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (361-380) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; @@ -1042,3 +865,180 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 584, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 417, + "end": 584, + "kind": "text" + } + ] + }, + { + "pos": 584, + "end": 988, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 584, + "end": 988, + "kind": "text" + } + ] + }, + { + "pos": 988, + "end": 1024, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 361, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 361, + "kind": "text" + } + ] + }, + { + "pos": 361, + "end": 380, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (417-584):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (417-584) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (584-988):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (584-988) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (988-1024) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-361) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (361-380) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-emitHelpers-in-all-projects.js index be7e00f65b7..28a72d7a12a 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-emitHelpers-in-all-projects.js @@ -1,134 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 921, - "kind": "emitHelpers", - "data": "typescript:read" - }, - { - "pos": 923, - "end": 1093, - "kind": "emitHelpers", - "data": "typescript:spread" - }, - { - "pos": 1095, - "end": 1551, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest", - "typescript:read", - "typescript:spread" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 272, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -emitHelpers: (417-921):: typescript:read -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (923-1093):: typescript:spread -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; ----------------------------------------------------------------------- -text: (1095-1551) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -function firstfirst_part3Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-272) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; -declare function firstfirst_part3Spread(...b: number[]): void; - -====================================================================== - //// [/src/first/bin/first-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; @@ -526,28 +395,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(s); - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -572,32 +427,6 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; { "pos": 1095, "end": 1551, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 1095, - "end": 1551, - "kind": "text" - } - ] - }, - { - "pos": 1551, - "end": 2171, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 1551, - "end": 2171, - "kind": "text" - } - ] - }, - { - "pos": 2171, - "end": 2536, "kind": "text" } ], @@ -614,32 +443,6 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; { "pos": 0, "end": 272, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 272, - "kind": "text" - } - ] - }, - { - "pos": 272, - "end": 491, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 272, - "end": 491, - "kind": "text" - } - ] - }, - { - "pos": 491, - "end": 625, "kind": "text" } ] @@ -647,9 +450,9 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- emitHelpers: (0-415):: typescript:rest var __rest = (this && this.__rest) || function (s, e) { @@ -686,8 +489,6 @@ var __spread = (this && this.__spread) || function () { return ar; }; ---------------------------------------------------------------------- -prepend: (1095-1551):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- text: (1095-1551) var s = "Hello, world"; console.log(s); @@ -707,57 +508,10 @@ function firstfirst_part3Spread() { } firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); ----------------------------------------------------------------------- -prepend: (1551-2171):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1551-2171) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); -function secondsecond_part2Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -secondsecond_part2Spread.apply(void 0, __spread([10, 20, 30])); - ----------------------------------------------------------------------- -text: (2171-2536) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -function thirdthird_part1Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -thirdthird_part1Spread.apply(void 0, __spread([10, 20, 30])); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-272):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-272) interface TheFirst { none: any; @@ -770,28 +524,24 @@ declare function forfirstfirst_PART1Rest(): void; declare function f(): string; declare function firstfirst_part3Spread(...b: number[]): void; ----------------------------------------------------------------------- -prepend: (272-491):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (272-491) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} -declare function secondsecond_part2Spread(...b: number[]): void; - ----------------------------------------------------------------------- -text: (491-625) -declare var c: C; -declare function forthirdthird_part1Rest(): void; -declare function thirdthird_part1Spread(...b: number[]): void; - ====================================================================== +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(s); + //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; @@ -1815,3 +1565,253 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 921, + "kind": "emitHelpers", + "data": "typescript:read" + }, + { + "pos": 923, + "end": 1093, + "kind": "emitHelpers", + "data": "typescript:spread" + }, + { + "pos": 1095, + "end": 1551, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 1095, + "end": 1551, + "kind": "text" + } + ] + }, + { + "pos": 1551, + "end": 2171, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 1551, + "end": 2171, + "kind": "text" + } + ] + }, + { + "pos": 2171, + "end": 2536, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest", + "typescript:read", + "typescript:spread" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 272, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 272, + "kind": "text" + } + ] + }, + { + "pos": 272, + "end": 491, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 272, + "end": 491, + "kind": "text" + } + ] + }, + { + "pos": 491, + "end": 625, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +emitHelpers: (417-921):: typescript:read +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (923-1093):: typescript:spread +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +---------------------------------------------------------------------- +prepend: (1095-1551):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1095-1551) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +function firstfirst_part3Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); + +---------------------------------------------------------------------- +prepend: (1551-2171):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1551-2171) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +function secondsecond_part2Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +secondsecond_part2Spread.apply(void 0, __spread([10, 20, 30])); + +---------------------------------------------------------------------- +text: (2171-2536) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +function thirdthird_part1Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +thirdthird_part1Spread.apply(void 0, __spread([10, 20, 30])); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-272):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-272) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; +declare function firstfirst_part3Spread(...b: number[]): void; + +---------------------------------------------------------------------- +prepend: (272-491):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (272-491) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} +declare function secondsecond_part2Spread(...b: number[]): void; + +---------------------------------------------------------------------- +text: (491-625) +declare var c: C; +declare function forthirdthird_part1Rest(): void; +declare function thirdthird_part1Spread(...b: number[]): void; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-emitHelpers-in-different-projects.js index f074a4b4a3f..4562d330750 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-emitHelpers-in-different-projects.js @@ -1,88 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 661, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -text: (417-661) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; @@ -338,6 +253,91 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 661, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +text: (417-661) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -354,234 +354,6 @@ function forfirstfirst_PART1Rest() { const { b, ...rest } = { a: 10, b: 30, yy: 30 }; }console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 921, - "kind": "emitHelpers", - "data": "typescript:read" - }, - { - "pos": 923, - "end": 1093, - "kind": "emitHelpers", - "data": "typescript:spread" - }, - { - "pos": 1095, - "end": 1339, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 1095, - "end": 1339, - "kind": "text" - } - ] - }, - { - "pos": 1339, - "end": 1840, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 1339, - "end": 1840, - "kind": "text" - } - ] - }, - { - "pos": 1840, - "end": 1993, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 374, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 374, - "kind": "text" - } - ] - }, - { - "pos": 374, - "end": 444, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -emitHelpers: (417-921):: typescript:read -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (923-1093):: typescript:spread -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; ----------------------------------------------------------------------- -prepend: (1095-1339):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1095-1339) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (1339-1840):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1339-1840) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function secondsecond_part1Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -secondsecond_part1Spread.apply(void 0, __spread([10, 20, 30])); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (1840-1993) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-374):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-374) -declare namespace N { -} -declare namespace N { -} -declare function secondsecond_part1Spread(...b: number[]): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (374-444) -declare var c: C; -declare function forthirdthird_part1Rest(): void; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; @@ -1348,3 +1120,231 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 921, + "kind": "emitHelpers", + "data": "typescript:read" + }, + { + "pos": 923, + "end": 1093, + "kind": "emitHelpers", + "data": "typescript:spread" + }, + { + "pos": 1095, + "end": 1339, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 1095, + "end": 1339, + "kind": "text" + } + ] + }, + { + "pos": 1339, + "end": 1840, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 1339, + "end": 1840, + "kind": "text" + } + ] + }, + { + "pos": 1840, + "end": 1993, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 374, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 374, + "kind": "text" + } + ] + }, + { + "pos": 374, + "end": 444, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +emitHelpers: (417-921):: typescript:read +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (923-1093):: typescript:spread +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +---------------------------------------------------------------------- +prepend: (1095-1339):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1095-1339) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (1339-1840):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1339-1840) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function secondsecond_part1Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +secondsecond_part1Spread.apply(void 0, __spread([10, 20, 30])); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (1840-1993) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-374):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-374) +declare namespace N { +} +declare namespace N { +} +declare function secondsecond_part1Spread(...b: number[]): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (374-444) +declare var c: C; +declare function forthirdthird_part1Rest(): void; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-prologues-in-all-projects.js index fe2f764631b..4f48b491019 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-prologues-in-all-projects.js @@ -1,108 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 28, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 30, - "end": 157, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue\"", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - }, - { - "pos": 0, - "end": 12, - "expression": { - "pos": 0, - "end": 12, - "text": "myPrologue" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prologue: (15-28):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -text: (30-157) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] "use strict"; "myPrologue"; @@ -304,27 +199,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -342,45 +224,7 @@ console.log(s); }, { "pos": 30, - "end": 44, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 46, - "end": 60, - "kind": "prologue", - "data": "myPrologue3" - }, - { - "pos": 62, - "end": 189, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 62, - "end": 189, - "kind": "text" - } - ] - }, - { - "pos": 189, - "end": 474, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 189, - "end": 474, - "kind": "text" - } - ] - }, - { - "pos": 474, - "end": 510, + "end": 157, "kind": "text" } ], @@ -388,7 +232,7 @@ console.log(s); "prologues": [ { "file": 0, - "text": "\"myPrologue3\";\n\"myPrologue\";", + "text": "\"myPrologue\"", "directives": [ { "pos": -1, @@ -401,19 +245,10 @@ console.log(s); }, { "pos": 0, - "end": 14, + "end": 12, "expression": { "pos": 0, - "end": 13, - "text": "myPrologue3" - } - }, - { - "pos": 14, - "end": 28, - "expression": { - "pos": 14, - "end": 27, + "end": 12, "text": "myPrologue" } } @@ -427,32 +262,6 @@ console.log(s); { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, "kind": "text" } ] @@ -460,9 +269,9 @@ console.log(s); } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; @@ -470,15 +279,7 @@ prologue: (0-13):: use strict prologue: (15-28):: myPrologue "myPrologue"; ---------------------------------------------------------------------- -prologue: (30-44):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -prologue: (46-60):: myPrologue3 -"myPrologue3"; ----------------------------------------------------------------------- -prepend: (62-189):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (62-189) +text: (30-157) var s = "Hello, world"; console.log(s); console.log(s); @@ -487,37 +288,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (189-474):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (189-474) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (474-510) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -528,24 +302,23 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - ====================================================================== +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + //// [/src/third/thirdjs/output/third-output.js] "use strict"; "myPrologue"; @@ -1104,3 +877,230 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 28, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 30, + "end": 44, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 46, + "end": 60, + "kind": "prologue", + "data": "myPrologue3" + }, + { + "pos": 62, + "end": 189, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 62, + "end": 189, + "kind": "text" + } + ] + }, + { + "pos": 189, + "end": 474, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 189, + "end": 474, + "kind": "text" + } + ] + }, + { + "pos": 474, + "end": 510, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "\"myPrologue3\";\n\"myPrologue\";", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + }, + { + "pos": 0, + "end": 14, + "expression": { + "pos": 0, + "end": 13, + "text": "myPrologue3" + } + }, + { + "pos": 14, + "end": 28, + "expression": { + "pos": 14, + "end": 27, + "text": "myPrologue" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-28):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prologue: (30-44):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +prologue: (46-60):: myPrologue3 +"myPrologue3"; +---------------------------------------------------------------------- +prepend: (62-189):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (62-189) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (189-474):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (189-474) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (474-510) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-prologues-in-different-projects.js index 0479d8f6179..4e6e8970890 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/multiple-prologues-in-different-projects.js @@ -1,90 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 142, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -text: (15-142) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] "use strict"; var s = "Hello, world"; @@ -272,26 +185,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -303,45 +204,7 @@ console.log(s); }, { "pos": 15, - "end": 28, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 30, - "end": 44, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 46, - "end": 173, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 46, - "end": 173, - "kind": "text" - } - ] - }, - { - "pos": 173, - "end": 458, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 173, - "end": 458, - "kind": "text" - } - ] - }, - { - "pos": 458, - "end": 494, + "end": 142, "kind": "text" } ], @@ -370,32 +233,6 @@ console.log(s); { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, "kind": "text" } ] @@ -403,22 +240,14 @@ console.log(s); } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; ---------------------------------------------------------------------- -prologue: (15-28):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -prologue: (30-44):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -prepend: (46-173):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (46-173) +text: (15-142) var s = "Hello, world"; console.log(s); console.log(s); @@ -427,37 +256,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (173-458):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (173-458) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (458-494) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -468,24 +270,22 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - ====================================================================== +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + //// [/src/third/thirdjs/output/third-output.js] "use strict"; "myPrologue"; @@ -1024,3 +824,203 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 28, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 30, + "end": 44, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 46, + "end": 173, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 46, + "end": 173, + "kind": "text" + } + ] + }, + { + "pos": 173, + "end": 458, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 173, + "end": 458, + "kind": "text" + } + ] + }, + { + "pos": 458, + "end": 494, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-28):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prologue: (30-44):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +prepend: (46-173):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (46-173) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (173-458):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (173-458) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (458-494) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/shebang-in-all-projects.js index dbd28e11abb..8536344abbb 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/shebang-in-all-projects.js @@ -1,62 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 33, - "end": 160, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 33, - "end": 190, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (33-160) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (33-190) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] #!someshebang first first_PART1 var s = "Hello, world"; @@ -246,6 +187,65 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 33, + "end": 160, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 33, + "end": 190, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (33-160) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (33-190) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] #!someshebang first first_PART1 interface TheFirst { @@ -261,160 +261,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 33, - "end": 160, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 33, - "end": 160, - "kind": "text" - } - ] - }, - { - "pos": 160, - "end": 445, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 160, - "end": 445, - "kind": "text" - } - ] - }, - { - "pos": 445, - "end": 481, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 33, - "end": 190, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 33, - "end": 190, - "kind": "text" - } - ] - }, - { - "pos": 190, - "end": 290, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 190, - "end": 290, - "kind": "text" - } - ] - }, - { - "pos": 290, - "end": 309, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (33-160):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (33-160) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (160-445):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (160-445) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (445-481) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (33-190):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (33-190) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (190-290):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (190-290) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (290-309) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] #!someshebang first first_PART1 var s = "Hello, world"; @@ -921,3 +767,157 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 33, + "end": 160, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 33, + "end": 160, + "kind": "text" + } + ] + }, + { + "pos": 160, + "end": 445, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 160, + "end": 445, + "kind": "text" + } + ] + }, + { + "pos": 445, + "end": 481, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 33, + "end": 190, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 33, + "end": 190, + "kind": "text" + } + ] + }, + { + "pos": 190, + "end": 290, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 190, + "end": 290, + "kind": "text" + } + ] + }, + { + "pos": 290, + "end": 309, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (33-160):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (33-160) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (160-445):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (160-445) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (445-481) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (33-190):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (33-190) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (190-290):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (190-290) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (290-309) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/shebang-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/shebang-in-only-one-dependency-project.js index 3747bbf6a7a..bb6d770d60c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/shebang-in-only-one-dependency-project.js @@ -1,62 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -242,6 +183,65 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -256,160 +256,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 35, - "end": 162, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 35, - "end": 162, - "kind": "text" - } - ] - }, - { - "pos": 162, - "end": 447, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 162, - "end": 447, - "kind": "text" - } - ] - }, - { - "pos": 447, - "end": 483, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 35, - "end": 192, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 35, - "end": 192, - "kind": "text" - } - ] - }, - { - "pos": 192, - "end": 292, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 192, - "end": 292, - "kind": "text" - } - ] - }, - { - "pos": 292, - "end": 311, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (35-162):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (35-162) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (162-447):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (162-447) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (447-483) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (35-192):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (35-192) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (192-292):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (192-292) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (292-311) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] #!someshebang second second_part1 var s = "Hello, world"; @@ -913,3 +759,157 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 35, + "end": 162, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 35, + "end": 162, + "kind": "text" + } + ] + }, + { + "pos": 162, + "end": 447, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 162, + "end": 447, + "kind": "text" + } + ] + }, + { + "pos": 447, + "end": 483, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 35, + "end": 192, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 35, + "end": 192, + "kind": "text" + } + ] + }, + { + "pos": 192, + "end": 292, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 192, + "end": 292, + "kind": "text" + } + ] + }, + { + "pos": 292, + "end": 311, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (35-162):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (35-162) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (162-447):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (162-447) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (447-483) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (35-192):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (35-192) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (192-292):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (192-292) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (292-311) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/strict-in-all-projects.js index 20cf18794bd..71243b11275 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/strict-in-all-projects.js @@ -1,90 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 142, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -text: (15-142) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] "use strict"; var s = "Hello, world"; @@ -272,26 +185,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -304,32 +205,6 @@ console.log(s); { "pos": 15, "end": 142, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 15, - "end": 142, - "kind": "text" - } - ] - }, - { - "pos": 142, - "end": 427, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 142, - "end": 427, - "kind": "text" - } - ] - }, - { - "pos": 427, - "end": 463, "kind": "text" } ], @@ -358,32 +233,6 @@ console.log(s); { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, "kind": "text" } ] @@ -391,15 +240,13 @@ console.log(s); } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; ---------------------------------------------------------------------- -prepend: (15-142):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- text: (15-142) var s = "Hello, world"; console.log(s); @@ -409,37 +256,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (142-427):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (142-427) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (427-463) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -450,24 +270,22 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - ====================================================================== +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + //// [/src/third/thirdjs/output/third-output.js] "use strict"; var s = "Hello, world"; @@ -970,3 +788,185 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 142, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 15, + "end": 142, + "kind": "text" + } + ] + }, + { + "pos": 142, + "end": 427, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 142, + "end": 427, + "kind": "text" + } + ] + }, + { + "pos": 427, + "end": 463, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prepend: (15-142):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (15-142) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (142-427):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (142-427) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (427-463) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/strict-in-one-dependency.js index 1fff1951a1e..e76d0376432 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/strict-in-one-dependency.js @@ -1,62 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -242,6 +183,65 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -256,169 +256,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 142, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 15, - "end": 142, - "kind": "text" - } - ] - }, - { - "pos": 142, - "end": 427, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 142, - "end": 427, - "kind": "text" - } - ] - }, - { - "pos": 427, - "end": 463, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prepend: (15-142):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (15-142) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (142-427):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (142-427) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (427-463) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] "use strict"; var s = "Hello, world"; @@ -921,3 +758,166 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 142, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 15, + "end": 142, + "kind": "text" + } + ] + }, + { + "pos": 142, + "end": 427, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 142, + "end": 427, + "kind": "text" + } + ] + }, + { + "pos": 427, + "end": 463, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prepend: (15-142):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (15-142) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (142-427):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (142-427) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (427-463) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index 3841fbd87ea..36da201e3d2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,304 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 3179, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 308, - "kind": "internal" - }, - { - "pos": 310, - "end": 342, - "kind": "text" - }, - { - "pos": 342, - "end": 734, - "kind": "internal" - }, - { - "pos": 736, - "end": 739, - "kind": "text" - }, - { - "pos": 739, - "end": 1152, - "kind": "internal" - }, - { - "pos": 1154, - "end": 1202, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (127-3179) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-308) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (310-342) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (342-734) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (736-739) -} - ----------------------------------------------------------------------- -internal: (739-1152) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1154-1202) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2023,20 +1722,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 3179, "kind": "text" } ] @@ -2045,12 +1756,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 308, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 310, + "end": 342, + "kind": "text" + }, + { + "pos": 342, + "end": 734, + "kind": "internal" + }, + { + "pos": 736, + "end": 739, + "kind": "text" + }, + { + "pos": 739, + "end": 1152, + "kind": "internal" + }, + { + "pos": 1154, + "end": 1202, "kind": "text" } ] @@ -2058,10 +1812,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-127) var s = "Hello, world"; console.log(s); @@ -2071,15 +1827,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (127-3179) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-39) interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (41-157) declare const s = "Hello, world"; interface NoJsForHereEither { @@ -2087,6 +1950,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-308) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (310-342) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (342-734) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (736-739) +} + +---------------------------------------------------------------------- +internal: (739-1152) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1154-1202) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.js] @@ -2274,6 +2208,72 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /**@internal*/ interface TheFirst { none: any; @@ -2288,212 +2288,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3179, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3179, - "kind": "text" - } - ] - }, - { - "pos": 3179, - "end": 3215, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3179):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3179) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3179-3215) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-276) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -4273,3 +4067,209 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3179, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3179, + "kind": "text" + } + ] + }, + { + "pos": 3179, + "end": 3215, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3179):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3179) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3179-3215) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-276) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-comment.js index bd021af993b..c67041ae7e2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-comment.js @@ -1,69 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ----------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -249,6 +183,72 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /**@internal*/ interface TheFirst { none: any; @@ -263,248 +263,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 3179, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 127, - "end": 3179, - "kind": "text" - } - ] - }, - { - "pos": 3179, - "end": 3215, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 116, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 116, - "kind": "text" - } - ] - }, - { - "pos": 116, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 116, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (127-3179):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (127-3179) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3179-3215) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-116) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (116-276) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -2284,3 +2042,245 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 3179, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 127, + "end": 3179, + "kind": "text" + } + ] + }, + { + "pos": 3179, + "end": 3215, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 116, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 116, + "kind": "text" + } + ] + }, + { + "pos": 116, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 116, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (127-3179):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (127-3179) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3179-3215) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-116) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (116-276) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index a9ca80cb200..b1cbda8b906 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,304 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 3561, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 172, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 54, - "kind": "internal" - }, - { - "pos": 56, - "end": 172, - "kind": "text" - } - ] - }, - { - "pos": 172, - "end": 249, - "kind": "text" - }, - { - "pos": 249, - "end": 398, - "kind": "internal" - }, - { - "pos": 400, - "end": 432, - "kind": "text" - }, - { - "pos": 432, - "end": 944, - "kind": "internal" - }, - { - "pos": 946, - "end": 949, - "kind": "text" - }, - { - "pos": 949, - "end": 1482, - "kind": "internal" - }, - { - "pos": 1484, - "end": 1532, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (127-3561) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /**@internal*/ function normalC() { - } - /**@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /**@internal*/ get: function () { return 10; }, - /**@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /**@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /**@internal*/ function foo() { } - normalN.foo = foo; - /**@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /**@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /**@internal*/ normalN.someImport = someNamespace.C; - /**@internal*/ normalN.internalConst = 10; - /**@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/**@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/**@internal*/ function internalfoo() { } -/**@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/**@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/**@internal*/ var internalImport = internalNamespace.someClass; -/**@internal*/ var internalConst = 10; -/**@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-172):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-54) -/**@internal*/ interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (56-172) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (172-249) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (249-398) - /**@internal*/ constructor(); - /**@internal*/ prop: string; - /**@internal*/ method(): void; - /**@internal*/ /**@internal*/ c: number; ----------------------------------------------------------------------- -text: (400-432) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (432-944) - /**@internal*/ class C { - } - /**@internal*/ function foo(): void; - /**@internal*/ namespace someNamespace { - class C { - } - } - /**@internal*/ namespace someOther.something { - class someClass { - } - } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ type internalType = internalC; - /**@internal*/ const internalConst = 10; - /**@internal*/ enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (946-949) -} - ----------------------------------------------------------------------- -internal: (949-1482) -/**@internal*/ declare class internalC { -} -/**@internal*/ declare function internalfoo(): void; -/**@internal*/ declare namespace internalNamespace { - class someClass { - } -} -/**@internal*/ declare namespace internalOther.something { - class someClass { - } -} -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ declare type internalType = internalC; -/**@internal*/ declare const internalConst = 10; -/**@internal*/ declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1484-1532) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2123,20 +1822,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 3561, "kind": "text" } ] @@ -2145,12 +1856,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 54, + "end": 172, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 54, + "kind": "internal" + }, + { + "pos": 56, + "end": 172, + "kind": "text" + } + ] + }, + { + "pos": 172, + "end": 249, + "kind": "text" + }, + { + "pos": 249, + "end": 398, "kind": "internal" }, { - "pos": 56, - "end": 172, + "pos": 400, + "end": 432, + "kind": "text" + }, + { + "pos": 432, + "end": 944, + "kind": "internal" + }, + { + "pos": 946, + "end": 949, + "kind": "text" + }, + { + "pos": 949, + "end": 1482, + "kind": "internal" + }, + { + "pos": 1484, + "end": 1532, "kind": "text" } ] @@ -2158,10 +1912,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-127) var s = "Hello, world"; console.log(s); @@ -2171,15 +1927,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (127-3561) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /**@internal*/ function normalC() { + } + /**@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /**@internal*/ get: function () { return 10; }, + /**@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /**@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /**@internal*/ function foo() { } + normalN.foo = foo; + /**@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /**@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /**@internal*/ normalN.someImport = someNamespace.C; + /**@internal*/ normalN.internalConst = 10; + /**@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/**@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/**@internal*/ function internalfoo() { } +/**@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/**@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/**@internal*/ var internalImport = internalNamespace.someClass; +/**@internal*/ var internalConst = 10; +/**@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-172):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-54) /**@internal*/ interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (56-172) declare const s = "Hello, world"; interface NoJsForHereEither { @@ -2187,6 +2050,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (172-249) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (249-398) + /**@internal*/ constructor(); + /**@internal*/ prop: string; + /**@internal*/ method(): void; + /**@internal*/ /**@internal*/ c: number; +---------------------------------------------------------------------- +text: (400-432) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (432-944) + /**@internal*/ class C { + } + /**@internal*/ function foo(): void; + /**@internal*/ namespace someNamespace { + class C { + } + } + /**@internal*/ namespace someOther.something { + class someClass { + } + } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ type internalType = internalC; + /**@internal*/ const internalConst = 10; + /**@internal*/ enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (946-949) +} + +---------------------------------------------------------------------- +internal: (949-1482) +/**@internal*/ declare class internalC { +} +/**@internal*/ declare function internalfoo(): void; +/**@internal*/ declare namespace internalNamespace { + class someClass { + } +} +/**@internal*/ declare namespace internalOther.something { + class someClass { + } +} +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ declare type internalType = internalC; +/**@internal*/ declare const internalConst = 10; +/**@internal*/ declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1484-1532) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.js] @@ -2374,6 +2308,72 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 54, + "kind": "internal" + }, + { + "pos": 56, + "end": 172, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-54) +/**@internal*/ interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (56-172) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /**@internal*/ interface TheFirst { none: any; @@ -2388,212 +2388,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3561, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3561, - "kind": "text" - } - ] - }, - { - "pos": 3561, - "end": 3597, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3561):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3561) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /**@internal*/ function normalC() { - } - /**@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /**@internal*/ get: function () { return 10; }, - /**@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /**@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /**@internal*/ function foo() { } - normalN.foo = foo; - /**@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /**@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /**@internal*/ normalN.someImport = someNamespace.C; - /**@internal*/ normalN.internalConst = 10; - /**@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/**@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/**@internal*/ function internalfoo() { } -/**@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/**@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/**@internal*/ var internalImport = internalNamespace.someClass; -/**@internal*/ var internalConst = 10; -/**@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3561-3597) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-276) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -4473,3 +4267,209 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3561, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3561, + "kind": "text" + } + ] + }, + { + "pos": 3561, + "end": 3597, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3561):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3561) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /**@internal*/ function normalC() { + } + /**@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /**@internal*/ get: function () { return 10; }, + /**@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /**@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /**@internal*/ function foo() { } + normalN.foo = foo; + /**@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /**@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /**@internal*/ normalN.someImport = someNamespace.C; + /**@internal*/ normalN.internalConst = 10; + /**@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/**@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/**@internal*/ function internalfoo() { } +/**@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/**@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/**@internal*/ var internalImport = internalNamespace.someClass; +/**@internal*/ var internalConst = 10; +/**@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3561-3597) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-276) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled.js index b2544e4f5dc..adbb5b56742 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled.js @@ -1,69 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 54, - "kind": "internal" - }, - { - "pos": 56, - "end": 172, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -internal: (0-54) -/**@internal*/ interface TheFirst { - none: any; -} ----------------------------------------------------------------------- -text: (56-172) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -249,6 +183,72 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 54, + "kind": "internal" + }, + { + "pos": 56, + "end": 172, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-54) +/**@internal*/ interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (56-172) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /**@internal*/ interface TheFirst { none: any; @@ -263,248 +263,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 3561, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 127, - "end": 3561, - "kind": "text" - } - ] - }, - { - "pos": 3561, - "end": 3597, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 116, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 116, - "kind": "text" - } - ] - }, - { - "pos": 116, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 116, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (127-3561):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (127-3561) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /**@internal*/ function normalC() { - } - /**@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /**@internal*/ get: function () { return 10; }, - /**@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /**@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /**@internal*/ function foo() { } - normalN.foo = foo; - /**@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /**@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /**@internal*/ normalN.someImport = someNamespace.C; - /**@internal*/ normalN.internalConst = 10; - /**@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/**@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/**@internal*/ function internalfoo() { } -/**@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/**@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/**@internal*/ var internalImport = internalNamespace.someClass; -/**@internal*/ var internalConst = 10; -/**@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3561-3597) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-116) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (116-276) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -2384,3 +2142,245 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 3561, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 127, + "end": 3561, + "kind": "text" + } + ] + }, + { + "pos": 3561, + "end": 3597, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 116, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 116, + "kind": "text" + } + ] + }, + { + "pos": 116, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 116, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (127-3561):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (127-3561) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /**@internal*/ function normalC() { + } + /**@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /**@internal*/ get: function () { return 10; }, + /**@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /**@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /**@internal*/ function foo() { } + normalN.foo = foo; + /**@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /**@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /**@internal*/ normalN.someImport = someNamespace.C; + /**@internal*/ normalN.internalConst = 10; + /**@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/**@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/**@internal*/ function internalfoo() { } +/**@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/**@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/**@internal*/ var internalImport = internalNamespace.someClass; +/**@internal*/ var internalConst = 10; +/**@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3561-3597) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-116) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (116-276) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js index 52bef6e361d..0287b1e01e0 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,304 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 3179, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 308, - "kind": "internal" - }, - { - "pos": 310, - "end": 342, - "kind": "text" - }, - { - "pos": 342, - "end": 734, - "kind": "internal" - }, - { - "pos": 736, - "end": 739, - "kind": "text" - }, - { - "pos": 739, - "end": 1152, - "kind": "internal" - }, - { - "pos": 1154, - "end": 1202, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (127-3179) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-308) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (310-342) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (342-734) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (736-739) -} - ----------------------------------------------------------------------- -internal: (739-1152) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1154-1202) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2023,20 +1722,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 3179, "kind": "text" } ] @@ -2045,12 +1756,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 308, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 310, + "end": 342, + "kind": "text" + }, + { + "pos": 342, + "end": 734, + "kind": "internal" + }, + { + "pos": 736, + "end": 739, + "kind": "text" + }, + { + "pos": 739, + "end": 1152, + "kind": "internal" + }, + { + "pos": 1154, + "end": 1202, "kind": "text" } ] @@ -2058,10 +1812,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-127) var s = "Hello, world"; console.log(s); @@ -2071,15 +1827,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (127-3179) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-39) interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (41-157) declare const s = "Hello, world"; interface NoJsForHereEither { @@ -2087,6 +1950,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-308) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (310-342) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (342-734) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (736-739) +} + +---------------------------------------------------------------------- +internal: (739-1152) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1154-1202) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.js] @@ -2274,6 +2208,72 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -2288,212 +2288,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3179, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3179, - "kind": "text" - } - ] - }, - { - "pos": 3179, - "end": 3215, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3179):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3179) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3179-3215) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-276) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -4273,3 +4067,209 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3179, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3179, + "kind": "text" + } + ] + }, + { + "pos": 3179, + "end": 3215, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3179):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3179) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3179-3215) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-276) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 2840e5debff..e90771ec915 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,304 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 3543, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 322, - "kind": "internal" - }, - { - "pos": 324, - "end": 356, - "kind": "text" - }, - { - "pos": 356, - "end": 748, - "kind": "internal" - }, - { - "pos": 750, - "end": 753, - "kind": "text" - }, - { - "pos": 753, - "end": 1166, - "kind": "internal" - }, - { - "pos": 1168, - "end": 1216, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (127-3543) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-322) - constructor(); - prop: string; - method(): void; - /*@internal*/ c: number; ----------------------------------------------------------------------- -text: (324-356) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (356-748) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (750-753) -} - ----------------------------------------------------------------------- -internal: (753-1166) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1168-1216) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2123,20 +1822,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 3543, "kind": "text" } ] @@ -2145,12 +1856,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 322, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 324, + "end": 356, + "kind": "text" + }, + { + "pos": 356, + "end": 748, + "kind": "internal" + }, + { + "pos": 750, + "end": 753, + "kind": "text" + }, + { + "pos": 753, + "end": 1166, + "kind": "internal" + }, + { + "pos": 1168, + "end": 1216, "kind": "text" } ] @@ -2158,10 +1912,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-127) var s = "Hello, world"; console.log(s); @@ -2171,15 +1927,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (127-3543) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-39) interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (41-157) declare const s = "Hello, world"; interface NoJsForHereEither { @@ -2187,6 +2050,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-322) + constructor(); + prop: string; + method(): void; + /*@internal*/ c: number; +---------------------------------------------------------------------- +text: (324-356) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (356-748) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (750-753) +} + +---------------------------------------------------------------------- +internal: (753-1166) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1168-1216) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.js] @@ -2374,6 +2308,72 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -2388,212 +2388,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3543, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3543, - "kind": "text" - } - ] - }, - { - "pos": 3543, - "end": 3579, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3543):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3543) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3543-3579) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-276) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -4473,3 +4267,209 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3543, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3543, + "kind": "text" + } + ] + }, + { + "pos": 3543, + "end": 3579, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3543):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3543) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3543-3579) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-276) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-with-comments-emit-enabled.js index cb89b229a18..fff1d2339ce 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal-with-comments-emit-enabled.js @@ -1,69 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ----------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -249,6 +183,72 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -263,248 +263,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 3543, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 127, - "end": 3543, - "kind": "text" - } - ] - }, - { - "pos": 3543, - "end": 3579, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 116, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 116, - "kind": "text" - } - ] - }, - { - "pos": 116, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 116, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (127-3543):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (127-3543) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3543-3579) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-116) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (116-276) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -2384,3 +2142,245 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 3543, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 127, + "end": 3543, + "kind": "text" + } + ] + }, + { + "pos": 3543, + "end": 3579, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 116, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 116, + "kind": "text" + } + ] + }, + { + "pos": 116, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 116, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (127-3543):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (127-3543) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3543-3579) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-116) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (116-276) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal.js index aa0319311d1..3c2a87634a6 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/stripInternal.js @@ -1,69 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ----------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -249,6 +183,72 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -263,248 +263,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 3179, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 127, - "end": 3179, - "kind": "text" - } - ] - }, - { - "pos": 3179, - "end": 3215, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 116, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 116, - "kind": "text" - } - ] - }, - { - "pos": 116, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 116, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (127-3179):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (127-3179) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3179-3215) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-116) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (116-276) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -2284,3 +2042,245 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 3179, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 127, + "end": 3179, + "kind": "text" + } + ] + }, + { + "pos": 3179, + "end": 3215, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 116, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 116, + "kind": "text" + } + ] + }, + { + "pos": 116, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 116, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (127-3179):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (127-3179) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3179-3215) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-116) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (116-276) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/triple-slash-refs-in-all-projects.js index 29e04189278..58765845482 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/triple-slash-refs-in-all-projects.js @@ -1,73 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 175, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 42, - "kind": "reference", - "data": "../tripleRef.d.ts" - }, - { - "pos": 44, - "end": 252, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-175) -var s = "Hello, world"; -console.log(s); -console.log(s); -var first_part2Const = new firstfirst_part2(); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -reference: (0-42):: ../tripleRef.d.ts -/// ----------------------------------------------------------------------- -text: (44-252) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare const first_part2Const: firstfirst_part2; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -282,6 +212,76 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 175, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 42, + "kind": "reference", + "data": "../tripleRef.d.ts" + }, + { + "pos": 44, + "end": 252, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-175) +var s = "Hello, world"; +console.log(s); +console.log(s); +var first_part2Const = new firstfirst_part2(); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +reference: (0-42):: ../tripleRef.d.ts +/// +---------------------------------------------------------------------- +text: (44-252) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare const first_part2Const: firstfirst_part2; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -296,193 +296,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 175, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 175, - "kind": "text" - } - ] - }, - { - "pos": 175, - "end": 511, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 175, - "end": 511, - "kind": "text" - } - ] - }, - { - "pos": 511, - "end": 595, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 45, - "kind": "reference", - "data": "../../tripleRef.d.ts" - }, - { - "pos": 47, - "end": 101, - "kind": "reference", - "data": "../../../first/tripleRef.d.ts" - }, - { - "pos": 103, - "end": 158, - "kind": "reference", - "data": "../../../second/tripleRef.d.ts" - }, - { - "pos": 160, - "end": 368, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 160, - "end": 368, - "kind": "text" - } - ] - }, - { - "pos": 368, - "end": 522, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 368, - "end": 522, - "kind": "text" - } - ] - }, - { - "pos": 522, - "end": 592, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-175):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-175) -var s = "Hello, world"; -console.log(s); -console.log(s); -var first_part2Const = new firstfirst_part2(); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (175-511):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (175-511) -var second_part1Const = new secondsecond_part1(); -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (511-595) -var third_part1Const = new thirdthird_part1(); -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -reference: (0-45):: ../../tripleRef.d.ts -/// ----------------------------------------------------------------------- -reference: (47-101):: ../../../first/tripleRef.d.ts -/// ----------------------------------------------------------------------- -reference: (103-158):: ../../../second/tripleRef.d.ts -/// ----------------------------------------------------------------------- -prepend: (160-368):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (160-368) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare const first_part2Const: firstfirst_part2; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (368-522):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (368-522) -declare const second_part1Const: secondsecond_part1; -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (522-592) -declare const third_part1Const: thirdthird_part1; -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -1070,3 +883,190 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 175, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 175, + "kind": "text" + } + ] + }, + { + "pos": 175, + "end": 511, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 175, + "end": 511, + "kind": "text" + } + ] + }, + { + "pos": 511, + "end": 595, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 45, + "kind": "reference", + "data": "../../tripleRef.d.ts" + }, + { + "pos": 47, + "end": 101, + "kind": "reference", + "data": "../../../first/tripleRef.d.ts" + }, + { + "pos": 103, + "end": 158, + "kind": "reference", + "data": "../../../second/tripleRef.d.ts" + }, + { + "pos": 160, + "end": 368, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 160, + "end": 368, + "kind": "text" + } + ] + }, + { + "pos": 368, + "end": 522, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 368, + "end": 522, + "kind": "text" + } + ] + }, + { + "pos": 522, + "end": 592, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-175):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-175) +var s = "Hello, world"; +console.log(s); +console.log(s); +var first_part2Const = new firstfirst_part2(); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (175-511):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (175-511) +var second_part1Const = new secondsecond_part1(); +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (511-595) +var third_part1Const = new thirdthird_part1(); +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +reference: (0-45):: ../../tripleRef.d.ts +/// +---------------------------------------------------------------------- +reference: (47-101):: ../../../first/tripleRef.d.ts +/// +---------------------------------------------------------------------- +reference: (103-158):: ../../../second/tripleRef.d.ts +/// +---------------------------------------------------------------------- +prepend: (160-368):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (160-368) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare const first_part2Const: firstfirst_part2; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (368-522):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (368-522) +declare const second_part1Const: secondsecond_part1; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (522-592) +declare const third_part1Const: thirdthird_part1; +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/triple-slash-refs-in-one-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/triple-slash-refs-in-one-project.js index 8189dac45cb..8bdc90da3a0 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/triple-slash-refs-in-one-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/triple-slash-refs-in-one-project.js @@ -1,62 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -242,6 +183,65 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -256,171 +256,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 463, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 127, - "end": 463, - "kind": "text" - } - ] - }, - { - "pos": 463, - "end": 499, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 55, - "kind": "reference", - "data": "../../../second/tripleRef.d.ts" - }, - { - "pos": 57, - "end": 214, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 57, - "end": 214, - "kind": "text" - } - ] - }, - { - "pos": 214, - "end": 368, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 214, - "end": 368, - "kind": "text" - } - ] - }, - { - "pos": 368, - "end": 387, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (127-463):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (127-463) -var second_part1Const = new secondsecond_part1(); -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (463-499) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -reference: (0-55):: ../../../second/tripleRef.d.ts -/// ----------------------------------------------------------------------- -prepend: (57-214):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (57-214) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (214-368):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (214-368) -declare const second_part1Const: secondsecond_part1; -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (368-387) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -950,3 +785,168 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 463, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 127, + "end": 463, + "kind": "text" + } + ] + }, + { + "pos": 463, + "end": 499, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 55, + "kind": "reference", + "data": "../../../second/tripleRef.d.ts" + }, + { + "pos": 57, + "end": 214, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 57, + "end": 214, + "kind": "text" + } + ] + }, + { + "pos": 214, + "end": 368, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 214, + "end": 368, + "kind": "text" + } + ] + }, + { + "pos": 368, + "end": 387, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (127-463):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (127-463) +var second_part1Const = new secondsecond_part1(); +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (463-499) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +reference: (0-55):: ../../../second/tripleRef.d.ts +/// +---------------------------------------------------------------------- +prepend: (57-214):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (57-214) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (214-368):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (214-368) +declare const second_part1Const: secondsecond_part1; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (368-387) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/when-source-files-are-empty-in-the-own-file.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/when-source-files-are-empty-in-the-own-file.js index f83d687646c..513c379f1c4 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/when-source-files-are-empty-in-the-own-file.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/buildInfo/when-source-files-are-empty-in-the-own-file.js @@ -1,62 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.js] var s = "Hello, world"; console.log(s); @@ -242,6 +183,65 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -256,141 +256,6 @@ interface NoJsForHereEither { console.log(s); console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 127, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 127, - "kind": "text" - } - ] - }, - { - "pos": 127, - "end": 412, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 127, - "end": 412, - "kind": "text" - } - ] - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-127) -var s = "Hello, world"; -console.log(s); -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (127-412):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (127-412) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); @@ -836,3 +701,138 @@ sourceFile:../../../second/second_part2.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 127, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 127, + "kind": "text" + } + ] + }, + { + "pos": 127, + "end": 412, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 127, + "end": 412, + "kind": "text" + } + ] + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-127):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-127) +var s = "Hello, world"; +console.log(s); +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (127-412):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (127-412) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/emitHelpers-in-all-projects.js index ea64d10c82a..3f83460a4af 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/emitHelpers-in-all-projects.js @@ -1,63 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 150, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-150) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET"} @@ -383,6 +323,66 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 150, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-150) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -397,191 +397,6 @@ interface NoJsForHereEither { console.log(s); function forfirstfirst_PART1Rest() { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 567, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 417, - "end": 567, - "kind": "text" - } - ] - }, - { - "pos": 567, - "end": 971, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 567, - "end": 971, - "kind": "text" - } - ] - }, - { - "pos": 971, - "end": 1124, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 361, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 361, - "kind": "text" - } - ] - }, - { - "pos": 361, - "end": 431, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (417-567):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (417-567) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (567-971):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (567-971) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (971-1124) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-361) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (361-431) -declare var c: C; -declare function forthirdthird_part1Rest(): void; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B"} @@ -1493,3 +1308,188 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 567, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 417, + "end": 567, + "kind": "text" + } + ] + }, + { + "pos": 567, + "end": 971, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 567, + "end": 971, + "kind": "text" + } + ] + }, + { + "pos": 971, + "end": 1124, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 361, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 361, + "kind": "text" + } + ] + }, + { + "pos": 361, + "end": 431, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (417-567):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (417-567) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (567-971):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (567-971) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (971-1124) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-361) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (361-431) +declare var c: C; +declare function forthirdthird_part1Rest(): void; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/emitHelpers-in-only-one-dependency-project.js index 339f88344f5..387c23aca1c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/emitHelpers-in-only-one-dependency-project.js @@ -1,87 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 644, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -text: (417-644) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAE/B;AEbD,iBAAS,CAAC,WAET"} @@ -461,6 +377,90 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 644, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +text: (417-644) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -477,184 +477,6 @@ function forfirstfirst_PART1Rest() { const { b, ...rest } = { a: 10, b: 30, yy: 30 }; } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 644, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 417, - "end": 644, - "kind": "text" - } - ] - }, - { - "pos": 644, - "end": 1048, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 644, - "end": 1048, - "kind": "text" - } - ] - }, - { - "pos": 1048, - "end": 1084, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 361, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 361, - "kind": "text" - } - ] - }, - { - "pos": 361, - "end": 380, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (417-644):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (417-644) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (644-1048):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (644-1048) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (1048-1084) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-361) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (361-380) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAE/B;ACbD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} @@ -1531,3 +1353,181 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 644, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 417, + "end": 644, + "kind": "text" + } + ] + }, + { + "pos": 644, + "end": 1048, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 644, + "end": 1048, + "kind": "text" + } + ] + }, + { + "pos": 1048, + "end": 1084, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 361, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 361, + "kind": "text" + } + ] + }, + { + "pos": 361, + "end": 380, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (417-644):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (417-644) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (644-1048):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (644-1048) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (1048-1084) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-361) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (361-380) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-emitHelpers-in-all-projects.js index bca5d0ca9c2..beb8e064697 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-emitHelpers-in-all-projects.js @@ -1,113 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 504, - "kind": "emitHelpers", - "data": "typescript:read" - }, - { - "pos": 506, - "end": 676, - "kind": "emitHelpers", - "data": "typescript:spread" - }, - { - "pos": 678, - "end": 1040, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:read", - "typescript:spread" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 272, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -emitHelpers: (0-504):: typescript:read -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (506-676):: typescript:spread -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; ----------------------------------------------------------------------- -text: (678-1040) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(f()); -function f() { - return "JS does hoists"; -} -function firstfirst_part3Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-272) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; -declare function firstfirst_part3Spread(...b: number[]): void; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK"} @@ -605,26 +495,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -642,45 +520,12 @@ function forfirstfirst_PART1Rest() { } }, { "pos": 678, - "end": 1093, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 1095, - "end": 1457, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 1095, - "end": 1457, - "kind": "text" - } - ] - }, - { - "pos": 1457, - "end": 2077, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 1457, - "end": 2077, - "kind": "text" - } - ] - }, - { - "pos": 2077, - "end": 2442, + "end": 1040, "kind": "text" } ], "sources": { "helpers": [ - "typescript:rest", "typescript:read", "typescript:spread" ] @@ -691,32 +536,6 @@ function forfirstfirst_PART1Rest() { } { "pos": 0, "end": 272, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 272, - "kind": "text" - } - ] - }, - { - "pos": 272, - "end": 491, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 272, - "end": 491, - "kind": "text" - } - ] - }, - { - "pos": 491, - "end": 625, "kind": "text" } ] @@ -724,9 +543,9 @@ function forfirstfirst_PART1Rest() { } } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- emitHelpers: (0-504):: typescript:read var __read = (this && this.__read) || function (o, n) { @@ -752,20 +571,7 @@ var __spread = (this && this.__spread) || function () { return ar; }; ---------------------------------------------------------------------- -emitHelpers: (678-1093):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (1095-1457):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1095-1457) +text: (678-1040) var s = "Hello, world"; console.log(s); function forfirstfirst_PART1Rest() { } @@ -781,57 +587,10 @@ function firstfirst_part3Spread() { } firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); ----------------------------------------------------------------------- -prepend: (1457-2077):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1457-2077) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); -function secondsecond_part2Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -secondsecond_part2Spread.apply(void 0, __spread([10, 20, 30])); - ----------------------------------------------------------------------- -text: (2077-2442) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -function thirdthird_part1Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -thirdthird_part1Spread.apply(void 0, __spread([10, 20, 30])); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-272):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-272) interface TheFirst { none: any; @@ -844,28 +603,22 @@ declare function forfirstfirst_PART1Rest(): void; declare function f(): string; declare function firstfirst_part3Spread(...b: number[]): void; ----------------------------------------------------------------------- -prepend: (272-491):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (272-491) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} -declare function secondsecond_part2Spread(...b: number[]): void; - ----------------------------------------------------------------------- -text: (491-625) -declare var c: C; -declare function forthirdthird_part1Rest(): void; -declare function thirdthird_part1Spread(...b: number[]): void; - ====================================================================== +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACHnD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;AAED,iBAAS,wBAAwB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACNrD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK"} @@ -2217,3 +1970,250 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 504, + "kind": "emitHelpers", + "data": "typescript:read" + }, + { + "pos": 506, + "end": 676, + "kind": "emitHelpers", + "data": "typescript:spread" + }, + { + "pos": 678, + "end": 1093, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 1095, + "end": 1457, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 1095, + "end": 1457, + "kind": "text" + } + ] + }, + { + "pos": 1457, + "end": 2077, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 1457, + "end": 2077, + "kind": "text" + } + ] + }, + { + "pos": 2077, + "end": 2442, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest", + "typescript:read", + "typescript:spread" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 272, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 272, + "kind": "text" + } + ] + }, + { + "pos": 272, + "end": 491, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 272, + "end": 491, + "kind": "text" + } + ] + }, + { + "pos": 491, + "end": 625, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-504):: typescript:read +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (506-676):: typescript:spread +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (678-1093):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (1095-1457):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1095-1457) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(f()); +function f() { + return "JS does hoists"; +} +function firstfirst_part3Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); + +---------------------------------------------------------------------- +prepend: (1457-2077):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1457-2077) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +function secondsecond_part2Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +secondsecond_part2Spread.apply(void 0, __spread([10, 20, 30])); + +---------------------------------------------------------------------- +text: (2077-2442) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +function thirdthird_part1Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +thirdthird_part1Spread.apply(void 0, __spread([10, 20, 30])); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-272):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-272) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; +declare function firstfirst_part3Spread(...b: number[]): void; + +---------------------------------------------------------------------- +prepend: (272-491):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (272-491) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} +declare function secondsecond_part2Spread(...b: number[]): void; + +---------------------------------------------------------------------- +text: (491-625) +declare var c: C; +declare function forthirdthird_part1Rest(): void; +declare function thirdthird_part1Spread(...b: number[]): void; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-emitHelpers-in-different-projects.js index 32c900074d4..327f55602e2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-emitHelpers-in-different-projects.js @@ -1,63 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 150, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-150) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET"} @@ -383,6 +323,66 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 150, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-150) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -397,231 +397,6 @@ interface NoJsForHereEither { console.log(s); function forfirstfirst_PART1Rest() { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 504, - "kind": "emitHelpers", - "data": "typescript:read" - }, - { - "pos": 506, - "end": 676, - "kind": "emitHelpers", - "data": "typescript:spread" - }, - { - "pos": 678, - "end": 1093, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 1095, - "end": 1245, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 1095, - "end": 1245, - "kind": "text" - } - ] - }, - { - "pos": 1245, - "end": 1746, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 1245, - "end": 1746, - "kind": "text" - } - ] - }, - { - "pos": 1746, - "end": 1899, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 374, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 374, - "kind": "text" - } - ] - }, - { - "pos": 374, - "end": 444, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-504):: typescript:read -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (506-676):: typescript:spread -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (678-1093):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (1095-1245):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1095-1245) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (1245-1746):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1245-1746) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function secondsecond_part1Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -secondsecond_part1Spread.apply(void 0, __spread([10, 20, 30])); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (1746-1899) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-374):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-374) -declare namespace N { -} -declare namespace N { -} -declare function secondsecond_part1Spread(...b: number[]): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (374-444) -declare var c: C; -declare function forthirdthird_part1Rest(): void; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,iBAAS,wBAAwB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACZrD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B"} @@ -1637,3 +1412,228 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 504, + "kind": "emitHelpers", + "data": "typescript:read" + }, + { + "pos": 506, + "end": 676, + "kind": "emitHelpers", + "data": "typescript:spread" + }, + { + "pos": 678, + "end": 1093, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 1095, + "end": 1245, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 1095, + "end": 1245, + "kind": "text" + } + ] + }, + { + "pos": 1245, + "end": 1746, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 1245, + "end": 1746, + "kind": "text" + } + ] + }, + { + "pos": 1746, + "end": 1899, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 374, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 374, + "kind": "text" + } + ] + }, + { + "pos": 374, + "end": 444, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-504):: typescript:read +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (506-676):: typescript:spread +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (678-1093):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (1095-1245):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1095-1245) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (1245-1746):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1245-1746) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function secondsecond_part1Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +secondsecond_part1Spread.apply(void 0, __spread([10, 20, 30])); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (1746-1899) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-374):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-374) +declare namespace N { +} +declare namespace N { +} +declare function secondsecond_part1Spread(...b: number[]): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (374-444) +declare var c: C; +declare function forthirdthird_part1Rest(): void; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-prologues-in-all-projects.js index 882f7b794be..228904833e8 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-prologues-in-all-projects.js @@ -1,125 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 29, - "kind": "prologue", - "data": "myPrologue5" - }, - { - "pos": 31, - "end": 44, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 46, - "end": 156, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue5\"\n\"myPrologue\"", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - }, - { - "pos": 0, - "end": 13, - "expression": { - "pos": 0, - "end": 13, - "text": "myPrologue5" - } - }, - { - "pos": 13, - "end": 26, - "expression": { - "pos": 13, - "end": 26, - "text": "myPrologue" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prologue: (15-29):: myPrologue5 -"myPrologue5"; ----------------------------------------------------------------------- -prologue: (31-44):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -text: (46-156) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAEA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AEVD,iBAAS,CAAC,WAET"} @@ -440,28 +318,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -"myPrologue5" -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -485,45 +349,7 @@ console.log(s); }, { "pos": 46, - "end": 60, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 62, - "end": 76, - "kind": "prologue", - "data": "myPrologue3" - }, - { - "pos": 78, - "end": 188, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 78, - "end": 188, - "kind": "text" - } - ] - }, - { - "pos": 188, - "end": 473, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 188, - "end": 473, - "kind": "text" - } - ] - }, - { - "pos": 473, - "end": 509, + "end": 156, "kind": "text" } ], @@ -531,7 +357,7 @@ console.log(s); "prologues": [ { "file": 0, - "text": "\"myPrologue3\";\n\"myPrologue\";", + "text": "\"myPrologue5\"\n\"myPrologue\"", "directives": [ { "pos": -1, @@ -544,19 +370,19 @@ console.log(s); }, { "pos": 0, - "end": 14, + "end": 13, "expression": { "pos": 0, "end": 13, - "text": "myPrologue3" + "text": "myPrologue5" } }, { - "pos": 14, - "end": 28, + "pos": 13, + "end": 26, "expression": { - "pos": 14, - "end": 27, + "pos": 13, + "end": 26, "text": "myPrologue" } } @@ -570,32 +396,6 @@ console.log(s); { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, "kind": "text" } ] @@ -603,9 +403,9 @@ console.log(s); } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; @@ -616,15 +416,7 @@ prologue: (15-29):: myPrologue5 prologue: (31-44):: myPrologue "myPrologue"; ---------------------------------------------------------------------- -prologue: (46-60):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -prologue: (62-76):: myPrologue3 -"myPrologue3"; ----------------------------------------------------------------------- -prepend: (78-188):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (78-188) +text: (46-156) var s = "Hello, world"; console.log(s); console.log(f()); @@ -632,37 +424,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (188-473):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (188-473) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (473-509) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -673,24 +438,24 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - ====================================================================== +//// [/src/first/first_PART1.ts] +"myPrologue5" +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAEA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACVD,iBAAS,CAAC,WAET;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACHD,QAAA,IAAI,CAAC,GAAU,CAAC"} @@ -1485,3 +1250,238 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 29, + "kind": "prologue", + "data": "myPrologue5" + }, + { + "pos": 31, + "end": 44, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 46, + "end": 60, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 62, + "end": 76, + "kind": "prologue", + "data": "myPrologue3" + }, + { + "pos": 78, + "end": 188, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 78, + "end": 188, + "kind": "text" + } + ] + }, + { + "pos": 188, + "end": 473, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 188, + "end": 473, + "kind": "text" + } + ] + }, + { + "pos": 473, + "end": 509, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "\"myPrologue3\";\n\"myPrologue\";", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + }, + { + "pos": 0, + "end": 14, + "expression": { + "pos": 0, + "end": 13, + "text": "myPrologue3" + } + }, + { + "pos": 14, + "end": 28, + "expression": { + "pos": 14, + "end": 27, + "text": "myPrologue" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-29):: myPrologue5 +"myPrologue5"; +---------------------------------------------------------------------- +prologue: (31-44):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prologue: (46-60):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +prologue: (62-76):: myPrologue3 +"myPrologue3"; +---------------------------------------------------------------------- +prepend: (78-188):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (78-188) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (188-473):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (188-473) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (473-509) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-prologues-in-different-projects.js index a957e05ff48..8894e73e3ac 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/multiple-prologues-in-different-projects.js @@ -1,107 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 29, - "kind": "prologue", - "data": "myPrologue5" - }, - { - "pos": 31, - "end": 141, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue5\"", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - }, - { - "pos": 0, - "end": 13, - "expression": { - "pos": 0, - "end": 13, - "text": "myPrologue5" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prologue: (15-29):: myPrologue5 -"myPrologue5"; ----------------------------------------------------------------------- -text: (31-141) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -408,27 +304,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -"myPrologue5" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -446,45 +329,7 @@ console.log(s); }, { "pos": 31, - "end": 44, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 46, - "end": 60, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 62, - "end": 172, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 62, - "end": 172, - "kind": "text" - } - ] - }, - { - "pos": 172, - "end": 457, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 172, - "end": 457, - "kind": "text" - } - ] - }, - { - "pos": 457, - "end": 493, + "end": 141, "kind": "text" } ], @@ -492,7 +337,7 @@ console.log(s); "prologues": [ { "file": 0, - "text": "", + "text": "\"myPrologue5\"", "directives": [ { "pos": -1, @@ -502,6 +347,15 @@ console.log(s); "end": -1, "text": "use strict" } + }, + { + "pos": 0, + "end": 13, + "expression": { + "pos": 0, + "end": 13, + "text": "myPrologue5" + } } ] } @@ -513,32 +367,6 @@ console.log(s); { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, "kind": "text" } ] @@ -546,9 +374,9 @@ console.log(s); } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; @@ -556,15 +384,7 @@ prologue: (0-13):: use strict prologue: (15-29):: myPrologue5 "myPrologue5"; ---------------------------------------------------------------------- -prologue: (31-44):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -prologue: (46-60):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -prepend: (62-172):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (62-172) +text: (31-141) var s = "Hello, world"; console.log(s); console.log(f()); @@ -572,37 +392,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (172-457):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (172-457) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (457-493) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -613,24 +406,23 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - ====================================================================== +//// [/src/first/first_PART1.ts] +"myPrologue5" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACLD,QAAA,IAAI,CAAC,GAAU,CAAC"} @@ -1405,3 +1197,211 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 29, + "kind": "prologue", + "data": "myPrologue5" + }, + { + "pos": 31, + "end": 44, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 46, + "end": 60, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 62, + "end": 172, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 62, + "end": 172, + "kind": "text" + } + ] + }, + { + "pos": 172, + "end": 457, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 172, + "end": 457, + "kind": "text" + } + ] + }, + { + "pos": 457, + "end": 493, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-29):: myPrologue5 +"myPrologue5"; +---------------------------------------------------------------------- +prologue: (31-44):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prologue: (46-60):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +prepend: (62-172):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (62-172) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (172-457):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (172-457) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (457-493) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/strict-in-all-projects.js index 8420cee02bb..83284f0338a 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/strict-in-all-projects.js @@ -1,107 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 28, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 30, - "end": 140, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue\"", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - }, - { - "pos": 0, - "end": 12, - "expression": { - "pos": 0, - "end": 12, - "text": "myPrologue" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prologue: (15-28):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -text: (30-140) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -408,27 +304,14 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ @@ -447,32 +330,6 @@ console.log(s); { "pos": 30, "end": 140, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 30, - "end": 140, - "kind": "text" - } - ] - }, - { - "pos": 140, - "end": 425, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 140, - "end": 425, - "kind": "text" - } - ] - }, - { - "pos": 425, - "end": 461, "kind": "text" } ], @@ -480,7 +337,7 @@ console.log(s); "prologues": [ { "file": 0, - "text": "", + "text": "\"myPrologue\"", "directives": [ { "pos": -1, @@ -490,6 +347,15 @@ console.log(s); "end": -1, "text": "use strict" } + }, + { + "pos": 0, + "end": 12, + "expression": { + "pos": 0, + "end": 12, + "text": "myPrologue" + } } ] } @@ -501,32 +367,6 @@ console.log(s); { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, "kind": "text" } ] @@ -534,9 +374,9 @@ console.log(s); } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; @@ -544,8 +384,6 @@ prologue: (0-13):: use strict prologue: (15-28):: myPrologue "myPrologue"; ---------------------------------------------------------------------- -prepend: (30-140):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- text: (30-140) var s = "Hello, world"; console.log(s); @@ -554,37 +392,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (140-425):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (140-425) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (425-461) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -595,24 +406,23 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - ====================================================================== +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} @@ -1346,3 +1156,193 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 28, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 30, + "end": 140, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 30, + "end": 140, + "kind": "text" + } + ] + }, + { + "pos": 140, + "end": 425, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 140, + "end": 425, + "kind": "text" + } + ] + }, + { + "pos": 425, + "end": 461, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-28):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prepend: (30-140):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (30-140) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (140-425):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (140-425) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (425-461) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/strict-in-one-dependency.js index 7a203552e9a..83504713bc1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/strict-in-one-dependency.js @@ -1,89 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 15, - "end": 125, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue\"", - "directives": [ - { - "pos": 0, - "end": 12, - "expression": { - "pos": 0, - "end": 12, - "text": "myPrologue" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -prologue: (0-13):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -text: (15-125) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -388,6 +302,92 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 15, + "end": 125, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "\"myPrologue\"", + "directives": [ + { + "pos": 0, + "end": 12, + "expression": { + "pos": 0, + "end": 12, + "text": "myPrologue" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +prologue: (0-13):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +text: (15-125) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] "myPrologue" interface TheFirst { @@ -403,177 +403,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 15, - "end": 28, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 30, - "end": 140, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 30, - "end": 140, - "kind": "text" - } - ] - }, - { - "pos": 140, - "end": 425, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 140, - "end": 425, - "kind": "text" - } - ] - }, - { - "pos": 425, - "end": 461, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prologue: (0-13):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -prologue: (15-28):: use strict -"use strict"; ----------------------------------------------------------------------- -prepend: (30-140):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (30-140) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (140-425):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (140-425) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (425-461) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} @@ -1307,3 +1136,174 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 15, + "end": 28, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 30, + "end": 140, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 30, + "end": 140, + "kind": "text" + } + ] + }, + { + "pos": 140, + "end": 425, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 140, + "end": 425, + "kind": "text" + } + ] + }, + { + "pos": 425, + "end": 461, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prologue: (15-28):: use strict +"use strict"; +---------------------------------------------------------------------- +prepend: (30-140):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (30-140) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (140-425):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (140-425) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (425-461) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index 5f84710e2d0..d6e81a705da 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,296 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3162, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 308, - "kind": "internal" - }, - { - "pos": 310, - "end": 342, - "kind": "text" - }, - { - "pos": 342, - "end": 734, - "kind": "internal" - }, - { - "pos": 736, - "end": 739, - "kind": "text" - }, - { - "pos": 739, - "end": 1152, - "kind": "internal" - }, - { - "pos": 1154, - "end": 1202, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (110-3162) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-308) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (310-342) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (342-734) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (736-739) -} - ----------------------------------------------------------------------- -internal: (739-1152) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1154-1202) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEM,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;IACF,CAAC,EACM,MAAM;CACnC;AACD,kBAAU,OAAO,CAAC;IACC,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACtD;AACc,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC5C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -2652,20 +2359,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3162, "kind": "text" } ] @@ -2675,6 +2394,49 @@ sourceFile:../second/second_part2.ts { "pos": 0, "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 308, + "kind": "internal" + }, + { + "pos": 310, + "end": 342, + "kind": "text" + }, + { + "pos": 342, + "end": 734, + "kind": "internal" + }, + { + "pos": 736, + "end": 739, + "kind": "text" + }, + { + "pos": 739, + "end": 1152, + "kind": "internal" + }, + { + "pos": 1154, + "end": 1202, "kind": "text" } ] @@ -2682,10 +2444,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -2694,10 +2458,117 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (110-3162) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -2708,6 +2579,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-308) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (310-342) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (342-734) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (736-739) +} + +---------------------------------------------------------------------- +internal: (739-1152) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1154-1202) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.d.ts.map] @@ -2987,6 +2929,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -3001,214 +3001,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3162, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3162, - "kind": "text" - } - ] - }, - { - "pos": 3162, - "end": 3198, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 317, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 317, - "kind": "text" - } - ] - }, - { - "pos": 317, - "end": 336, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3162):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3162) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3162-3198) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-317):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-317) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (317-336) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -5166,3 +4958,211 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3162, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3162, + "kind": "text" + } + ] + }, + { + "pos": 3162, + "end": 3198, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 317, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 317, + "kind": "text" + } + ] + }, + { + "pos": 317, + "end": 336, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3162):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3162) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3162-3198) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-317):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-317) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (317-336) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-jsdoc-style-comment.js index 218898dc24b..46cae19cbae 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-jsdoc-style-comment.js @@ -1,61 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -333,6 +275,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -347,250 +347,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3162, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 3162, - "kind": "text" - } - ] - }, - { - "pos": 3162, - "end": 3198, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 317, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 317, - "kind": "text" - } - ] - }, - { - "pos": 317, - "end": 336, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-3162):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-3162) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3162-3198) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-317):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-317) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (317-336) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2548,3 +2304,247 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3162, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 3162, + "kind": "text" + } + ] + }, + { + "pos": 3162, + "end": 3198, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 317, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 317, + "kind": "text" + } + ] + }, + { + "pos": 317, + "end": 336, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-3162):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-3162) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3162-3198) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-317):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-317) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (317-336) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js index dc2421256f6..d70db017532 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,296 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3162, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 308, - "kind": "internal" - }, - { - "pos": 310, - "end": 342, - "kind": "text" - }, - { - "pos": 342, - "end": 734, - "kind": "internal" - }, - { - "pos": 736, - "end": 739, - "kind": "text" - }, - { - "pos": 739, - "end": 1152, - "kind": "internal" - }, - { - "pos": 1154, - "end": 1202, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (110-3162) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-308) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (310-342) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (342-734) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (736-739) -} - ----------------------------------------------------------------------- -internal: (739-1152) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1154-1202) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEK,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;IACF,CAAC,EACM,MAAM;CAClC;AACD,kBAAU,OAAO,CAAC;IACA,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACrD;AACa,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC3C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -2652,20 +2359,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3162, "kind": "text" } ] @@ -2675,6 +2394,49 @@ sourceFile:../second/second_part2.ts { "pos": 0, "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 308, + "kind": "internal" + }, + { + "pos": 310, + "end": 342, + "kind": "text" + }, + { + "pos": 342, + "end": 734, + "kind": "internal" + }, + { + "pos": 736, + "end": 739, + "kind": "text" + }, + { + "pos": 739, + "end": 1152, + "kind": "internal" + }, + { + "pos": 1154, + "end": 1202, "kind": "text" } ] @@ -2682,10 +2444,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -2694,10 +2458,117 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (110-3162) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -2708,6 +2579,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-308) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (310-342) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (342-734) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (736-739) +} + +---------------------------------------------------------------------- +internal: (739-1152) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1154-1202) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.d.ts.map] @@ -2987,6 +2929,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -3001,214 +3001,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3162, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3162, - "kind": "text" - } - ] - }, - { - "pos": 3162, - "end": 3198, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 317, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 317, - "kind": "text" - } - ] - }, - { - "pos": 317, - "end": 336, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3162):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3162) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3162-3198) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-317):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-317) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (317-336) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -5166,3 +4958,211 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3162, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3162, + "kind": "text" + } + ] + }, + { + "pos": 3162, + "end": 3198, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 317, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 317, + "kind": "text" + } + ] + }, + { + "pos": 317, + "end": 336, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3162):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3162) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3162-3198) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-317):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-317) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (317-336) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 61d9d923739..9d60b8f2d90 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,296 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3526, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 322, - "kind": "internal" - }, - { - "pos": 324, - "end": 356, - "kind": "text" - }, - { - "pos": 356, - "end": 748, - "kind": "internal" - }, - { - "pos": 750, - "end": 753, - "kind": "text" - }, - { - "pos": 753, - "end": 1166, - "kind": "internal" - }, - { - "pos": 1168, - "end": 1216, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (110-3526) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-322) - constructor(); - prop: string; - method(): void; - /*@internal*/ c: number; ----------------------------------------------------------------------- -text: (324-356) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (356-748) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (750-753) -} - ----------------------------------------------------------------------- -internal: (753-1166) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1168-1216) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEK,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;kBACF,CAAC,EACM,MAAM;CAClC;AACD,kBAAU,OAAO,CAAC;IACA,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACrD;AACa,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC3C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -2752,20 +2459,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3526, "kind": "text" } ] @@ -2775,6 +2494,49 @@ sourceFile:../second/second_part2.ts { "pos": 0, "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 322, + "kind": "internal" + }, + { + "pos": 324, + "end": 356, + "kind": "text" + }, + { + "pos": 356, + "end": 748, + "kind": "internal" + }, + { + "pos": 750, + "end": 753, + "kind": "text" + }, + { + "pos": 753, + "end": 1166, + "kind": "internal" + }, + { + "pos": 1168, + "end": 1216, "kind": "text" } ] @@ -2782,10 +2544,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -2794,10 +2558,117 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (110-3526) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -2808,6 +2679,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-322) + constructor(); + prop: string; + method(): void; + /*@internal*/ c: number; +---------------------------------------------------------------------- +text: (324-356) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (356-748) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (750-753) +} + +---------------------------------------------------------------------- +internal: (753-1166) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1168-1216) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.d.ts.map] @@ -3087,6 +3029,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -3101,214 +3101,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3526, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3526, - "kind": "text" - } - ] - }, - { - "pos": 3526, - "end": 3562, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 317, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 317, - "kind": "text" - } - ] - }, - { - "pos": 317, - "end": 336, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3526):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3526) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3526-3562) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-317):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-317) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (317-336) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -5366,3 +5158,211 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3526, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3526, + "kind": "text" + } + ] + }, + { + "pos": 3526, + "end": 3562, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 317, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 317, + "kind": "text" + } + ] + }, + { + "pos": 317, + "end": 336, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3526):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3526) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3526-3562) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-317):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-317) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (317-336) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-with-comments-emit-enabled.js index 5cfdce7c3a0..69b03d2ade7 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal-with-comments-emit-enabled.js @@ -1,61 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -333,6 +275,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -347,250 +347,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3526, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 3526, - "kind": "text" - } - ] - }, - { - "pos": 3526, - "end": 3562, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 317, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 317, - "kind": "text" - } - ] - }, - { - "pos": 317, - "end": 336, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-3526):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-3526) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3526-3562) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-317):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-317) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (317-336) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2648,3 +2404,247 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3526, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 3526, + "kind": "text" + } + ] + }, + { + "pos": 3526, + "end": 3562, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 317, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 317, + "kind": "text" + } + ] + }, + { + "pos": 317, + "end": 336, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-3526):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-3526) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3526-3562) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-317):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-317) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (317-336) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal.js index f539981ed93..6cae866956f 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/buildInfo/stripInternal.js @@ -1,61 +1,3 @@ -//// [/src/first/bin/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/first/", - "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - } -} - -//// [/src/first/bin/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -333,6 +275,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -347,250 +347,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3162, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 3162, - "kind": "text" - } - ] - }, - { - "pos": 3162, - "end": 3198, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 317, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 317, - "kind": "text" - } - ] - }, - { - "pos": 317, - "end": 336, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-3162):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-3162) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3162-3198) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-317):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-317) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (317-336) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2548,3 +2304,247 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3162, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 3162, + "kind": "text" + } + ] + }, + { + "pos": 3162, + "end": 3198, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 317, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 317, + "kind": "text" + } + ] + }, + { + "pos": 317, + "end": 336, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-3162):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-3162) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3162-3198) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-317):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-317) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (317-336) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/baseline-sectioned-sourcemaps.js index ad0aa1dc98c..47c953497cc 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/baseline-sectioned-sourcemaps.js @@ -1,68 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 285, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-285) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -448,20 +383,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 285, "kind": "text" } ] @@ -470,7 +404,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 157, + "end": 100, "kind": "text" } ] @@ -478,31 +412,39 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (0-100) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -806,44 +748,20 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 395, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 395, - "kind": "text" - } - ] - }, - { - "pos": 395, - "end": 431, "kind": "text" } ] @@ -853,32 +771,6 @@ sourceFile:../first_part3.ts { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, "kind": "text" } ] @@ -886,12 +778,10 @@ sourceFile:../first_part3.ts } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -900,37 +790,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (110-395):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-395) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (395-431) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -941,22 +804,6 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - ====================================================================== //// [/src/third/thirdjs/output/third-output.d.ts] @@ -1694,3 +1541,156 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 395, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 395, + "kind": "text" + } + ] + }, + { + "pos": 395, + "end": 431, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-395):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-395) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (395-431) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/declarationMap-and-sourceMap-disabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/declarationMap-and-sourceMap-disabled.js index e3c6a4191f8..369b1b7413b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/declarationMap-and-sourceMap-disabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/declarationMap-and-sourceMap-disabled.js @@ -1,68 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 285, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-285) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -448,20 +383,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 285, "kind": "text" } ] @@ -470,7 +404,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 157, + "end": 100, "kind": "text" } ] @@ -478,31 +412,39 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (0-100) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -806,40 +748,21 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 395, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 395, - "kind": "text" - } - ] + "kind": "text" } ] }, @@ -848,40 +771,17 @@ sourceFile:../first_part3.ts { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] + "kind": "text" } ] } } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -890,32 +790,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (110-395):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-395) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -926,18 +804,6 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ====================================================================== //// [/src/third/thirdjs/output/third-output.d.ts] diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/emitHelpers-in-all-projects.js index 9c6913e33ac..43d28e084e7 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/emitHelpers-in-all-projects.js @@ -1,94 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 821, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 153, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -text: (417-821) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-153) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -563,14 +472,13 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ @@ -582,7 +490,7 @@ sourceFile:../second/second_part2.ts }, { "pos": 417, - "end": 644, + "end": 821, "kind": "text" } ], @@ -596,7 +504,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 208, + "end": 153, "kind": "text" } ] @@ -604,9 +512,9 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- emitHelpers: (0-415):: typescript:rest var __rest = (this && this.__rest) || function (s, e) { @@ -619,31 +527,39 @@ var __rest = (this && this.__rest) || function (s, e) { return t; }; ---------------------------------------------------------------------- -text: (417-644) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { +text: (417-821) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); } -console.log(f()); -function f() { - return "JS does hoists"; -} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; +text: (0-153) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; } -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; ====================================================================== @@ -1038,6 +954,90 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 644, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +text: (417-644) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -1070,193 +1070,6 @@ function forsecondsecond_part1Rest() { const { b, ...rest } = { a: 10, b: 30, yy: 30 }; } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 644, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 417, - "end": 644, - "kind": "text" - } - ] - }, - { - "pos": 644, - "end": 1048, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 644, - "end": 1048, - "kind": "text" - } - ] - }, - { - "pos": 1048, - "end": 1201, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 361, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 361, - "kind": "text" - } - ] - }, - { - "pos": 361, - "end": 431, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (417-644):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (417-644) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (644-1048):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (644-1048) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (1048-1201) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-361) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (361-431) -declare var c: C; -declare function forthirdthird_part1Rest(): void; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2226,6 +2039,193 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 644, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 417, + "end": 644, + "kind": "text" + } + ] + }, + { + "pos": 644, + "end": 1048, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 644, + "end": 1048, + "kind": "text" + } + ] + }, + { + "pos": 1048, + "end": 1201, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 361, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 361, + "kind": "text" + } + ] + }, + { + "pos": 361, + "end": 431, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (417-644):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (417-644) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (644-1048):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (644-1048) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (1048-1201) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-361) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (361-431) +declare var c: C; +declare function forthirdthird_part1Rest(): void; + +====================================================================== + //// [/src/third/third_part1.ts] var c = new C(); c.doSomething(); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/emitHelpers-in-only-one-dependency-project.js index a1dfa6af026..4b050adcf6b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/emitHelpers-in-only-one-dependency-project.js @@ -1,94 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 821, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 153, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -text: (417-821) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-153) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -563,29 +472,39 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 150, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 821, "kind": "text" } - ] + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } }, "dts": { "sections": [ { "pos": 0, - "end": 208, + "end": 153, "kind": "text" } ] @@ -593,33 +512,54 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-150) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(f()); -function f() { - return "JS does hoists"; +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +text: (417-821) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); } +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; +text: (0-153) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; } -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; ====================================================================== @@ -960,6 +900,66 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 150, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-150) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -990,182 +990,6 @@ function forsecondsecond_part1Rest() { const { b, ...rest } = { a: 10, b: 30, yy: 30 }; } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 567, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 417, - "end": 567, - "kind": "text" - } - ] - }, - { - "pos": 567, - "end": 971, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 567, - "end": 971, - "kind": "text" - } - ] - }, - { - "pos": 971, - "end": 1007, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 361, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 361, - "kind": "text" - } - ] - }, - { - "pos": 361, - "end": 380, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -prepend: (417-567):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (417-567) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { } -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (567-971):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (567-971) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (971-1007) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-361) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (361-380) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2027,3 +1851,179 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 567, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 417, + "end": 567, + "kind": "text" + } + ] + }, + { + "pos": 567, + "end": 971, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 567, + "end": 971, + "kind": "text" + } + ] + }, + { + "pos": 971, + "end": 1007, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 361, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 361, + "kind": "text" + } + ] + }, + { + "pos": 361, + "end": 380, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +prepend: (417-567):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (417-567) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { } +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (567-971):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (567-971) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (971-1007) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-361):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-361) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (361-380) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-emitHelpers-in-all-projects.js index fa3f521a0f8..42506be86d8 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-emitHelpers-in-all-projects.js @@ -1,140 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 921, - "kind": "emitHelpers", - "data": "typescript:read" - }, - { - "pos": 923, - "end": 1093, - "kind": "emitHelpers", - "data": "typescript:spread" - }, - { - "pos": 1095, - "end": 1715, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest", - "typescript:read", - "typescript:spread" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 219, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -emitHelpers: (417-921):: typescript:read -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (923-1093):: typescript:spread -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; ----------------------------------------------------------------------- -text: (1095-1715) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); -function secondsecond_part2Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -secondsecond_part2Spread.apply(void 0, __spread([10, 20, 30])); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-219) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} -declare function secondsecond_part2Spread(...b: number[]): void; - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -784,14 +647,13 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ @@ -815,7 +677,7 @@ sourceFile:../second/second_part2.ts }, { "pos": 1095, - "end": 1534, + "end": 1715, "kind": "text" } ], @@ -831,7 +693,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 272, + "end": 219, "kind": "text" } ] @@ -839,9 +701,9 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- emitHelpers: (0-415):: typescript:rest var __rest = (this && this.__rest) || function (s, e) { @@ -878,39 +740,47 @@ var __spread = (this && this.__spread) || function () { return ar; }; ---------------------------------------------------------------------- -text: (1095-1534) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { +text: (1095-1715) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); } -console.log(f()); -function f() { - return "JS does hoists"; -} -function firstfirst_part3Spread() { +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +function secondsecond_part2Spread() { var b = []; for (var _i = 0; _i < arguments.length; _i++) { b[_i] = arguments[_i]; } } -firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); +secondsecond_part2Spread.apply(void 0, __spread([10, 20, 30])); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-272) -interface TheFirst { - none: any; +text: (0-219) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { } -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; -declare function firstfirst_part3Spread(...b: number[]): void; +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} +declare function secondsecond_part2Spread(...b: number[]): void; ====================================================================== @@ -1478,6 +1348,136 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 921, + "kind": "emitHelpers", + "data": "typescript:read" + }, + { + "pos": 923, + "end": 1093, + "kind": "emitHelpers", + "data": "typescript:spread" + }, + { + "pos": 1095, + "end": 1534, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest", + "typescript:read", + "typescript:spread" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 272, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +emitHelpers: (417-921):: typescript:read +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (923-1093):: typescript:spread +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +---------------------------------------------------------------------- +text: (1095-1534) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} +function firstfirst_part3Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-272) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; +declare function firstfirst_part3Spread(...b: number[]): void; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -1569,255 +1569,6 @@ secondsecond_part2Spread(...[10, 20, 30]); } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 921, - "kind": "emitHelpers", - "data": "typescript:read" - }, - { - "pos": 923, - "end": 1093, - "kind": "emitHelpers", - "data": "typescript:spread" - }, - { - "pos": 1095, - "end": 1534, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 1095, - "end": 1534, - "kind": "text" - } - ] - }, - { - "pos": 1534, - "end": 2154, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 1534, - "end": 2154, - "kind": "text" - } - ] - }, - { - "pos": 2154, - "end": 2519, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest", - "typescript:read", - "typescript:spread" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 272, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 272, - "kind": "text" - } - ] - }, - { - "pos": 272, - "end": 491, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 272, - "end": 491, - "kind": "text" - } - ] - }, - { - "pos": 491, - "end": 625, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -emitHelpers: (417-921):: typescript:read -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (923-1093):: typescript:spread -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; ----------------------------------------------------------------------- -prepend: (1095-1534):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1095-1534) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(f()); -function f() { - return "JS does hoists"; -} -function firstfirst_part3Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); - ----------------------------------------------------------------------- -prepend: (1534-2154):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1534-2154) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function forsecondsecond_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); -function secondsecond_part2Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -secondsecond_part2Spread.apply(void 0, __spread([10, 20, 30])); - ----------------------------------------------------------------------- -text: (2154-2519) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -function thirdthird_part1Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -thirdthird_part1Spread.apply(void 0, __spread([10, 20, 30])); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-272):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-272) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; -declare function firstfirst_part3Spread(...b: number[]): void; - ----------------------------------------------------------------------- -prepend: (272-491):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (272-491) -declare namespace N { -} -declare namespace N { -} -declare function forsecondsecond_part1Rest(): void; -declare class C { - doSomething(): void; -} -declare function secondsecond_part2Spread(...b: number[]): void; - ----------------------------------------------------------------------- -text: (491-625) -declare var c: C; -declare function forthirdthird_part1Rest(): void; -declare function thirdthird_part1Spread(...b: number[]): void; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -3230,6 +2981,255 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 921, + "kind": "emitHelpers", + "data": "typescript:read" + }, + { + "pos": 923, + "end": 1093, + "kind": "emitHelpers", + "data": "typescript:spread" + }, + { + "pos": 1095, + "end": 1534, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 1095, + "end": 1534, + "kind": "text" + } + ] + }, + { + "pos": 1534, + "end": 2154, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 1534, + "end": 2154, + "kind": "text" + } + ] + }, + { + "pos": 2154, + "end": 2519, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest", + "typescript:read", + "typescript:spread" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 272, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 272, + "kind": "text" + } + ] + }, + { + "pos": 272, + "end": 491, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 272, + "end": 491, + "kind": "text" + } + ] + }, + { + "pos": 491, + "end": 625, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +emitHelpers: (417-921):: typescript:read +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (923-1093):: typescript:spread +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +---------------------------------------------------------------------- +prepend: (1095-1534):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1095-1534) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} +function firstfirst_part3Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +firstfirst_part3Spread.apply(void 0, __spread([10, 20, 30])); + +---------------------------------------------------------------------- +prepend: (1534-2154):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1534-2154) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function forsecondsecond_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +function secondsecond_part2Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +secondsecond_part2Spread.apply(void 0, __spread([10, 20, 30])); + +---------------------------------------------------------------------- +text: (2154-2519) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +function thirdthird_part1Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +thirdthird_part1Spread.apply(void 0, __spread([10, 20, 30])); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-272):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-272) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; +declare function firstfirst_part3Spread(...b: number[]): void; + +---------------------------------------------------------------------- +prepend: (272-491):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (272-491) +declare namespace N { +} +declare namespace N { +} +declare function forsecondsecond_part1Rest(): void; +declare class C { + doSomething(): void; +} +declare function secondsecond_part2Spread(...b: number[]): void; + +---------------------------------------------------------------------- +text: (491-625) +declare var c: C; +declare function forthirdthird_part1Rest(): void; +declare function thirdthird_part1Spread(...b: number[]): void; + +====================================================================== + //// [/src/third/third_part1.ts] var c = new C(); c.doSomething(); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-emitHelpers-in-different-projects.js index 01b630ef697..e37f4a62e6b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-emitHelpers-in-different-projects.js @@ -1,118 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 504, - "kind": "emitHelpers", - "data": "typescript:read" - }, - { - "pos": 506, - "end": 676, - "kind": "emitHelpers", - "data": "typescript:spread" - }, - { - "pos": 678, - "end": 1179, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:read", - "typescript:spread" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 166, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -emitHelpers: (0-504):: typescript:read -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (506-676):: typescript:spread -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; ----------------------------------------------------------------------- -text: (678-1179) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function secondsecond_part1Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -secondsecond_part1Spread.apply(void 0, __spread([10, 20, 30])); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-166) -declare namespace N { -} -declare namespace N { -} -declare function secondsecond_part1Spread(...b: number[]): void; -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -673,32 +558,38 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 415, + "end": 504, "kind": "emitHelpers", - "data": "typescript:rest" + "data": "typescript:read" }, { - "pos": 417, - "end": 644, + "pos": 506, + "end": 676, + "kind": "emitHelpers", + "data": "typescript:spread" + }, + { + "pos": 678, + "end": 1179, "kind": "text" } ], "sources": { "helpers": [ - "typescript:rest" + "typescript:read", + "typescript:spread" ] } }, @@ -706,7 +597,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 208, + "end": 166, "kind": "text" } ] @@ -714,46 +605,71 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; +emitHelpers: (0-504):: typescript:read +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; }; ---------------------------------------------------------------------- -text: (417-644) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(f()); -function f() { - return "JS does hoists"; +emitHelpers: (506-676):: typescript:spread +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +---------------------------------------------------------------------- +text: (678-1179) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function secondsecond_part1Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } } +secondsecond_part1Spread.apply(void 0, __spread([10, 20, 30])); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; +text: (0-166) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare function secondsecond_part1Spread(...b: number[]): void; +declare class C { + doSomething(): void; } -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; ====================================================================== @@ -1148,6 +1064,90 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 644, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +text: (417-644) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -1199,233 +1199,6 @@ secondsecond_part1Spread(...[10, 20, 30]); } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 415, - "kind": "emitHelpers", - "data": "typescript:rest" - }, - { - "pos": 417, - "end": 921, - "kind": "emitHelpers", - "data": "typescript:read" - }, - { - "pos": 923, - "end": 1093, - "kind": "emitHelpers", - "data": "typescript:spread" - }, - { - "pos": 1095, - "end": 1322, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 1095, - "end": 1322, - "kind": "text" - } - ] - }, - { - "pos": 1322, - "end": 1823, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 1322, - "end": 1823, - "kind": "text" - } - ] - }, - { - "pos": 1823, - "end": 1976, - "kind": "text" - } - ], - "sources": { - "helpers": [ - "typescript:rest" - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 208, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 208, - "kind": "text" - } - ] - }, - { - "pos": 208, - "end": 374, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 208, - "end": 374, - "kind": "text" - } - ] - }, - { - "pos": 374, - "end": 444, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -emitHelpers: (0-415):: typescript:rest -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -}; ----------------------------------------------------------------------- -emitHelpers: (417-921):: typescript:read -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; ----------------------------------------------------------------------- -emitHelpers: (923-1093):: typescript:spread -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; ----------------------------------------------------------------------- -prepend: (1095-1322):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1095-1322) -var s = "Hello, world"; -console.log(s); -function forfirstfirst_PART1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (1322-1823):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1322-1823) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -function secondsecond_part1Spread() { - var b = []; - for (var _i = 0; _i < arguments.length; _i++) { - b[_i] = arguments[_i]; - } -} -secondsecond_part1Spread.apply(void 0, __spread([10, 20, 30])); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (1823-1976) -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { - var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); -} - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-208) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function forfirstfirst_PART1Rest(): void; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (208-374):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (208-374) -declare namespace N { -} -declare namespace N { -} -declare function secondsecond_part1Spread(...b: number[]): void; -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (374-444) -declare var c: C; -declare function forthirdthird_part1Rest(): void; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2499,6 +2272,233 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 415, + "kind": "emitHelpers", + "data": "typescript:rest" + }, + { + "pos": 417, + "end": 921, + "kind": "emitHelpers", + "data": "typescript:read" + }, + { + "pos": 923, + "end": 1093, + "kind": "emitHelpers", + "data": "typescript:spread" + }, + { + "pos": 1095, + "end": 1322, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 1095, + "end": 1322, + "kind": "text" + } + ] + }, + { + "pos": 1322, + "end": 1823, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 1322, + "end": 1823, + "kind": "text" + } + ] + }, + { + "pos": 1823, + "end": 1976, + "kind": "text" + } + ], + "sources": { + "helpers": [ + "typescript:rest" + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 208, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 208, + "kind": "text" + } + ] + }, + { + "pos": 208, + "end": 374, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 208, + "end": 374, + "kind": "text" + } + ] + }, + { + "pos": 374, + "end": 444, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +emitHelpers: (0-415):: typescript:rest +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +---------------------------------------------------------------------- +emitHelpers: (417-921):: typescript:read +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +---------------------------------------------------------------------- +emitHelpers: (923-1093):: typescript:spread +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +---------------------------------------------------------------------- +prepend: (1095-1322):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1095-1322) +var s = "Hello, world"; +console.log(s); +function forfirstfirst_PART1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (1322-1823):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1322-1823) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +function secondsecond_part1Spread() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i] = arguments[_i]; + } +} +secondsecond_part1Spread.apply(void 0, __spread([10, 20, 30])); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (1823-1976) +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { + var _a = { a: 10, b: 30, yy: 30 }, b = _a.b, rest = __rest(_a, ["b"]); +} + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-208):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-208) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function forfirstfirst_PART1Rest(): void; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (208-374):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (208-374) +declare namespace N { +} +declare namespace N { +} +declare function secondsecond_part1Spread(...b: number[]): void; +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (374-444) +declare var c: C; +declare function forthirdthird_part1Rest(): void; + +====================================================================== + //// [/src/third/third_part1.ts] var c = new C(); c.doSomething(); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-prologues-in-all-projects.js index d2cdb5d65b4..4ad8b4256ee 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-prologues-in-all-projects.js @@ -1,138 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 28, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 30, - "end": 44, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 46, - "end": 331, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue\"", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - }, - { - "pos": 0, - "end": 12, - "expression": { - "pos": 0, - "end": 12, - "text": "myPrologue" - } - } - ] - }, - { - "file": 1, - "text": "\"myPrologue2\";", - "directives": [ - { - "pos": 0, - "end": 14, - "expression": { - "pos": 0, - "end": 13, - "text": "myPrologue2" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prologue: (15-28):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -prologue: (30-44):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -text: (46-331) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -557,14 +422,13 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ @@ -582,7 +446,13 @@ sourceFile:../second/second_part2.ts }, { "pos": 30, - "end": 140, + "end": 44, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 46, + "end": 331, "kind": "text" } ], @@ -611,6 +481,21 @@ sourceFile:../second/second_part2.ts } } ] + }, + { + "file": 1, + "text": "\"myPrologue2\";", + "directives": [ + { + "pos": 0, + "end": 14, + "expression": { + "pos": 0, + "end": 13, + "text": "myPrologue2" + } + } + ] } ] } @@ -619,7 +504,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 157, + "end": 100, "kind": "text" } ] @@ -627,9 +512,9 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; @@ -637,27 +522,38 @@ prologue: (0-13):: use strict prologue: (15-28):: myPrologue "myPrologue"; ---------------------------------------------------------------------- -text: (30-140) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +prologue: (30-44):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +text: (46-331) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (0-100) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -978,6 +874,110 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 28, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 30, + "end": 140, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "\"myPrologue\"", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + }, + { + "pos": 0, + "end": 12, + "expression": { + "pos": 0, + "end": 12, + "text": "myPrologue" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-28):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +text: (30-140) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] "myPrologue" interface TheFirst { @@ -1057,232 +1057,6 @@ class C { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 28, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 30, - "end": 44, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 46, - "end": 60, - "kind": "prologue", - "data": "myPrologue3" - }, - { - "pos": 62, - "end": 172, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 62, - "end": 172, - "kind": "text" - } - ] - }, - { - "pos": 172, - "end": 457, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 172, - "end": 457, - "kind": "text" - } - ] - }, - { - "pos": 457, - "end": 493, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue3\";\n\"myPrologue\";", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - }, - { - "pos": 0, - "end": 14, - "expression": { - "pos": 0, - "end": 13, - "text": "myPrologue3" - } - }, - { - "pos": 14, - "end": 28, - "expression": { - "pos": 14, - "end": 27, - "text": "myPrologue" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prologue: (15-28):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -prologue: (30-44):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -prologue: (46-60):: myPrologue3 -"myPrologue3"; ----------------------------------------------------------------------- -prepend: (62-172):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (62-172) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (172-457):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (172-457) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (457-493) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2081,6 +1855,232 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 28, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 30, + "end": 44, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 46, + "end": 60, + "kind": "prologue", + "data": "myPrologue3" + }, + { + "pos": 62, + "end": 172, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 62, + "end": 172, + "kind": "text" + } + ] + }, + { + "pos": 172, + "end": 457, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 172, + "end": 457, + "kind": "text" + } + ] + }, + { + "pos": 457, + "end": 493, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "\"myPrologue3\";\n\"myPrologue\";", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + }, + { + "pos": 0, + "end": 14, + "expression": { + "pos": 0, + "end": 13, + "text": "myPrologue3" + } + }, + { + "pos": 14, + "end": 28, + "expression": { + "pos": 14, + "end": 27, + "text": "myPrologue" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-28):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prologue: (30-44):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +prologue: (46-60):: myPrologue3 +"myPrologue3"; +---------------------------------------------------------------------- +prepend: (62-172):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (62-172) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (172-457):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (172-457) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (457-493) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + //// [/src/third/third_part1.ts] "myPrologue3"; "myPrologue"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-prologues-in-different-projects.js index 088e1596a8e..1495618487b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/multiple-prologues-in-different-projects.js @@ -1,120 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 15, - "end": 29, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 31, - "end": 316, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "\"myPrologue\"", - "directives": [ - { - "pos": 0, - "end": 12, - "expression": { - "pos": 0, - "end": 12, - "text": "myPrologue" - } - } - ] - }, - { - "file": 1, - "text": "\"myPrologue2\";", - "directives": [ - { - "pos": 0, - "end": 14, - "expression": { - "pos": 0, - "end": 13, - "text": "myPrologue2" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prologue: (0-13):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -prologue: (15-29):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -text: (31-316) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -537,14 +420,13 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ @@ -552,11 +434,17 @@ sourceFile:../second/second_part2.ts "pos": 0, "end": 13, "kind": "prologue", - "data": "use strict" + "data": "myPrologue" }, { "pos": 15, - "end": 125, + "end": 29, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 31, + "end": 316, "kind": "text" } ], @@ -564,15 +452,30 @@ sourceFile:../second/second_part2.ts "prologues": [ { "file": 0, - "text": "", + "text": "\"myPrologue\"", "directives": [ { - "pos": -1, - "end": -1, + "pos": 0, + "end": 12, "expression": { - "pos": -1, - "end": -1, - "text": "use strict" + "pos": 0, + "end": 12, + "text": "myPrologue" + } + } + ] + }, + { + "file": 1, + "text": "\"myPrologue2\";", + "directives": [ + { + "pos": 0, + "end": 14, + "expression": { + "pos": 0, + "end": 13, + "text": "myPrologue2" } } ] @@ -584,7 +487,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 157, + "end": 100, "kind": "text" } ] @@ -592,34 +495,45 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; +prologue: (0-13):: myPrologue +"myPrologue"; ---------------------------------------------------------------------- -text: (15-125) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +prologue: (15-29):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +text: (31-316) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (0-100) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -925,6 +839,92 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 125, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +text: (15-125) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/tsconfig.json] { "compilerOptions": { @@ -971,205 +971,6 @@ class C { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 28, - "kind": "prologue", - "data": "myPrologue" - }, - { - "pos": 30, - "end": 44, - "kind": "prologue", - "data": "myPrologue2" - }, - { - "pos": 46, - "end": 156, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 46, - "end": 156, - "kind": "text" - } - ] - }, - { - "pos": 156, - "end": 441, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 156, - "end": 441, - "kind": "text" - } - ] - }, - { - "pos": 441, - "end": 477, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prologue: (15-28):: myPrologue -"myPrologue"; ----------------------------------------------------------------------- -prologue: (30-44):: myPrologue2 -"myPrologue2"; ----------------------------------------------------------------------- -prepend: (46-156):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (46-156) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (156-441):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (156-441) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (441-477) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1945,6 +1746,205 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 28, + "kind": "prologue", + "data": "myPrologue" + }, + { + "pos": 30, + "end": 44, + "kind": "prologue", + "data": "myPrologue2" + }, + { + "pos": 46, + "end": 156, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 46, + "end": 156, + "kind": "text" + } + ] + }, + { + "pos": 156, + "end": 441, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 156, + "end": 441, + "kind": "text" + } + ] + }, + { + "pos": 441, + "end": 477, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prologue: (15-28):: myPrologue +"myPrologue"; +---------------------------------------------------------------------- +prologue: (30-44):: myPrologue2 +"myPrologue2"; +---------------------------------------------------------------------- +prepend: (46-156):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (46-156) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (156-441):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (156-441) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (441-477) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/shebang-in-all-projects.js index 80d063b2561..cfeef6662a6 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/shebang-in-all-projects.js @@ -1,68 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 35, - "end": 320, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 35, - "end": 135, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (35-320) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (35-135) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] #!someshebang second second_part1 declare namespace N { @@ -454,20 +389,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { - "pos": 33, - "end": 143, + "pos": 35, + "end": 320, "kind": "text" } ] @@ -475,8 +409,8 @@ sourceFile:../second/second_part2.ts "dts": { "sections": [ { - "pos": 33, - "end": 190, + "pos": 35, + "end": 135, "kind": "text" } ] @@ -484,31 +418,39 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (33-143) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (35-320) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (33-190) -interface TheFirst { - none: any; +text: (35-135) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -819,6 +761,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 33, + "end": 143, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 33, + "end": 190, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (33-143) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (33-190) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] #!someshebang first first_PART1 interface TheFirst { @@ -854,159 +854,6 @@ namespace N { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 33, - "end": 143, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 33, - "end": 143, - "kind": "text" - } - ] - }, - { - "pos": 143, - "end": 428, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 143, - "end": 428, - "kind": "text" - } - ] - }, - { - "pos": 428, - "end": 464, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 33, - "end": 190, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 33, - "end": 190, - "kind": "text" - } - ] - }, - { - "pos": 190, - "end": 290, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 190, - "end": 290, - "kind": "text" - } - ] - }, - { - "pos": 290, - "end": 309, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (33-143):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (33-143) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (143-428):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (143-428) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (428-464) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (33-190):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (33-190) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (190-290):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (190-290) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (290-309) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang first first_PART1 interface TheFirst { @@ -1753,6 +1600,159 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 33, + "end": 143, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 33, + "end": 143, + "kind": "text" + } + ] + }, + { + "pos": 143, + "end": 428, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 143, + "end": 428, + "kind": "text" + } + ] + }, + { + "pos": 428, + "end": 464, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 33, + "end": 190, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 33, + "end": 190, + "kind": "text" + } + ] + }, + { + "pos": 190, + "end": 290, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 190, + "end": 290, + "kind": "text" + } + ] + }, + { + "pos": 290, + "end": 309, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (33-143):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (33-143) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (143-428):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (143-428) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (428-464) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (33-190):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (33-190) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (190-290):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (190-290) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (290-309) +declare var c: C; + +====================================================================== + //// [/src/third/third_part1.ts] #!someshebang third third_part1 var c = new C(); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/shebang-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/shebang-in-only-one-dependency-project.js index a4cc8e05cb2..c6bc9d9d9cb 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/shebang-in-only-one-dependency-project.js @@ -1,68 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 35, - "end": 320, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 35, - "end": 135, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (35-320) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (35-135) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] #!someshebang second second_part1 declare namespace N { @@ -454,20 +389,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { - "pos": 0, - "end": 110, + "pos": 35, + "end": 320, "kind": "text" } ] @@ -475,8 +409,8 @@ sourceFile:../second/second_part2.ts "dts": { "sections": [ { - "pos": 0, - "end": 157, + "pos": 35, + "end": 135, "kind": "text" } ] @@ -484,31 +418,39 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (35-320) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (35-135) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -812,6 +754,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/second/second_part1.ts] #!someshebang second second_part1 namespace N { @@ -827,159 +827,6 @@ namespace N { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 35, - "end": 145, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 35, - "end": 145, - "kind": "text" - } - ] - }, - { - "pos": 145, - "end": 430, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 145, - "end": 430, - "kind": "text" - } - ] - }, - { - "pos": 430, - "end": 466, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 35, - "end": 192, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 35, - "end": 192, - "kind": "text" - } - ] - }, - { - "pos": 192, - "end": 292, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 192, - "end": 292, - "kind": "text" - } - ] - }, - { - "pos": 292, - "end": 311, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (35-145):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (35-145) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (145-430):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (145-430) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (430-466) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (35-192):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (35-192) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (192-292):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (192-292) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (292-311) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang second second_part1 interface TheFirst { @@ -1721,3 +1568,156 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 35, + "end": 145, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 35, + "end": 145, + "kind": "text" + } + ] + }, + { + "pos": 145, + "end": 430, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 145, + "end": 430, + "kind": "text" + } + ] + }, + { + "pos": 430, + "end": 466, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 35, + "end": 192, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 35, + "end": 192, + "kind": "text" + } + ] + }, + { + "pos": 192, + "end": 292, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 192, + "end": 292, + "kind": "text" + } + ] + }, + { + "pos": 292, + "end": 311, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (35-145):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (35-145) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (145-430):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (145-430) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (430-466) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (35-192):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (35-192) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (192-292):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (192-292) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (292-311) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/strict-in-all-projects.js index 9a3e99f012a..a9db17cc5bc 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/strict-in-all-projects.js @@ -1,96 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 300, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -text: (15-300) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -478,14 +385,13 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ @@ -497,7 +403,7 @@ sourceFile:../second/second_part2.ts }, { "pos": 15, - "end": 125, + "end": 300, "kind": "text" } ], @@ -525,7 +431,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 157, + "end": 100, "kind": "text" } ] @@ -533,34 +439,42 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- prologue: (0-13):: use strict "use strict"; ---------------------------------------------------------------------- -text: (15-125) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (15-300) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (0-100) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -866,6 +780,92 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 125, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +text: (15-125) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/tsconfig.json] { "compilerOptions": { @@ -906,187 +906,6 @@ sourceFile:../first_part3.ts } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 125, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 15, - "end": 125, - "kind": "text" - } - ] - }, - { - "pos": 125, - "end": 410, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 125, - "end": 410, - "kind": "text" - } - ] - }, - { - "pos": 410, - "end": 446, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prepend: (15-125):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (15-125) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (125-410):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (125-410) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (410-446) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1824,6 +1643,187 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 125, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 15, + "end": 125, + "kind": "text" + } + ] + }, + { + "pos": 125, + "end": 410, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 125, + "end": 410, + "kind": "text" + } + ] + }, + { + "pos": 410, + "end": 446, + "kind": "text" + } + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prepend: (15-125):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (15-125) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (125-410):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (125-410) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (410-446) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/strict-in-one-dependency.js index b0cdc5a62b5..4f1aa8aaae4 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/strict-in-one-dependency.js @@ -1,96 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 300, - "kind": "text" - } - ], - "sources": { - "prologues": [ - { - "file": 0, - "text": "", - "directives": [ - { - "pos": -1, - "end": -1, - "expression": { - "pos": -1, - "end": -1, - "text": "use strict" - } - } - ] - } - ] - } - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -text: (15-300) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -478,29 +385,53 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 300, "kind": "text" } - ] + ], + "sources": { + "prologues": [ + { + "file": 0, + "text": "", + "directives": [ + { + "pos": -1, + "end": -1, + "expression": { + "pos": -1, + "end": -1, + "text": "use strict" + } + } + ] + } + ] + } }, "dts": { "sections": [ { "pos": 0, - "end": 157, + "end": 100, "kind": "text" } ] @@ -508,31 +439,42 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +text: (15-300) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (0-100) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -836,6 +778,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/second/tsconfig.json] { "compilerOptions": { @@ -854,168 +854,6 @@ sourceFile:../first_part3.ts } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 13, - "kind": "prologue", - "data": "use strict" - }, - { - "pos": 15, - "end": 125, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 15, - "end": 125, - "kind": "text" - } - ] - }, - { - "pos": 125, - "end": 410, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 125, - "end": 410, - "kind": "text" - } - ] - }, - { - "pos": 410, - "end": 446, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prologue: (0-13):: use strict -"use strict"; ----------------------------------------------------------------------- -prepend: (15-125):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (15-125) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (125-410):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (125-410) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (410-446) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1753,3 +1591,165 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 13, + "kind": "prologue", + "data": "use strict" + }, + { + "pos": 15, + "end": 125, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 15, + "end": 125, + "kind": "text" + } + ] + }, + { + "pos": 125, + "end": 410, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 125, + "end": 410, + "kind": "text" + } + ] + }, + { + "pos": 410, + "end": 446, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prologue: (0-13):: use strict +"use strict"; +---------------------------------------------------------------------- +prepend: (15-125):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (15-125) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (125-410):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (125-410) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (410-446) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-baseline-when-internal-is-inside-another-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-baseline-when-internal-is-inside-another-internal.js index 8ba2b42b42e..ba582e1e1b7 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-baseline-when-internal-is-inside-another-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-baseline-when-internal-is-inside-another-internal.js @@ -1,68 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 285, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-285) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -448,20 +383,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 285, "kind": "text" } ] @@ -470,17 +404,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 24, - "kind": "text" - }, - { - "pos": 24, - "end": 363, - "kind": "internal" - }, - { - "pos": 365, - "end": 587, + "end": 100, "kind": "text" } ] @@ -488,50 +412,39 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-24) -declare namespace ts { - ----------------------------------------------------------------------- -internal: (24-363) - interface SourceFileLike { - readonly text: string; - lineMap?: ReadonlyArray; - getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number; - } - interface RedirectInfo { - readonly redirectTarget: SourceFile; - readonly unredirected: SourceFile; - } ----------------------------------------------------------------------- -text: (365-587) - interface SourceFile { - someProp: string; - } +text: (0-100) +declare namespace N { } -interface TheFirst { - none: any; +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -1153,6 +1066,93 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 24, + "kind": "text" + }, + { + "pos": 24, + "end": 363, + "kind": "internal" + }, + { + "pos": 365, + "end": 587, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-24) +declare namespace ts { + +---------------------------------------------------------------------- +internal: (24-363) + interface SourceFileLike { + readonly text: string; + lineMap?: ReadonlyArray; + getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number; + } + interface RedirectInfo { + readonly redirectTarget: SourceFile; + readonly unredirected: SourceFile; + } +---------------------------------------------------------------------- +text: (365-587) + interface SourceFile { + someProp: string; + } +} +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] namespace ts { /* @internal */ @@ -1194,164 +1194,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 395, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 395, - "kind": "text" - } - ] - }, - { - "pos": 395, - "end": 431, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 246, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 246, - "kind": "text" - } - ] - }, - { - "pos": 246, - "end": 346, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 246, - "end": 346, - "kind": "text" - } - ] - }, - { - "pos": 346, - "end": 365, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-395):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-395) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (395-431) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-246):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-246) -declare namespace ts { - interface SourceFile { - someProp: string; - } -} -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (246-346):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (246-346) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (346-365) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare namespace ts { interface SourceFile { @@ -2201,6 +2043,164 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 395, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 395, + "kind": "text" + } + ] + }, + { + "pos": 395, + "end": 431, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 246, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 246, + "kind": "text" + } + ] + }, + { + "pos": 246, + "end": 346, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 246, + "end": 346, + "kind": "text" + } + ] + }, + { + "pos": 346, + "end": 365, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-395):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-395) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (395-431) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-246):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-246) +declare namespace ts { + interface SourceFile { + someProp: string; + } +} +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (246-346):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (246-346) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (346-365) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index 5319f795ecf..b6fa83e103e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,303 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3162, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 308, - "kind": "internal" - }, - { - "pos": 310, - "end": 342, - "kind": "text" - }, - { - "pos": 342, - "end": 734, - "kind": "internal" - }, - { - "pos": 736, - "end": 739, - "kind": "text" - }, - { - "pos": 739, - "end": 1152, - "kind": "internal" - }, - { - "pos": 1154, - "end": 1202, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (110-3162) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-308) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (310-342) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (342-734) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (736-739) -} - ----------------------------------------------------------------------- -internal: (739-1152) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1154-1202) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -2837,20 +2537,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3162, "kind": "text" } ] @@ -2859,12 +2571,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 308, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 310, + "end": 342, + "kind": "text" + }, + { + "pos": 342, + "end": 734, + "kind": "internal" + }, + { + "pos": 736, + "end": 739, + "kind": "text" + }, + { + "pos": 739, + "end": 1152, + "kind": "internal" + }, + { + "pos": 1154, + "end": 1202, "kind": "text" } ] @@ -2872,10 +2627,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -2884,15 +2641,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (110-3162) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-39) interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (41-157) declare const s = "Hello, world"; interface NoJsForHereEither { @@ -2900,6 +2764,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-308) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (310-342) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (342-734) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (736-739) +} + +---------------------------------------------------------------------- +internal: (739-1152) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1154-1202) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.d.ts] @@ -3202,6 +3137,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /**@internal*/ interface TheFirst { none: any; @@ -3274,211 +3274,6 @@ namespace normalN { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3162, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3162, - "kind": "text" - } - ] - }, - { - "pos": 3162, - "end": 3198, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3162):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3162) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3162-3198) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-276) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5515,6 +5310,211 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3162, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3162, + "kind": "text" + } + ] + }, + { + "pos": 3162, + "end": 3198, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3162):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3162) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3162-3198) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-276) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-comment.js index f23385255db..b2df4084800 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-comment.js @@ -1,246 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3052, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 77, - "kind": "text" - }, - { - "pos": 77, - "end": 151, - "kind": "internal" - }, - { - "pos": 153, - "end": 185, - "kind": "text" - }, - { - "pos": 185, - "end": 577, - "kind": "internal" - }, - { - "pos": 579, - "end": 582, - "kind": "text" - }, - { - "pos": 582, - "end": 995, - "kind": "internal" - }, - { - "pos": 997, - "end": 1045, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-3052) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-77) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (77-151) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (153-185) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (185-577) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (579-582) -} - ----------------------------------------------------------------------- -internal: (582-995) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (997-1045) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -2511,20 +2268,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 3052, "kind": "text" } ] @@ -2533,12 +2289,37 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 77, + "kind": "text" + }, + { + "pos": 77, + "end": 151, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 153, + "end": 185, + "kind": "text" + }, + { + "pos": 185, + "end": 577, + "kind": "internal" + }, + { + "pos": 579, + "end": 582, + "kind": "text" + }, + { + "pos": 582, + "end": 995, + "kind": "internal" + }, + { + "pos": 997, + "end": 1045, "kind": "text" } ] @@ -2546,33 +2327,187 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-3052) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; +text: (0-77) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (77-151) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (153-185) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (185-577) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (579-582) +} + +---------------------------------------------------------------------- +internal: (582-995) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 } ---------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +text: (997-1045) +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -2876,6 +2811,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /**@internal*/ interface TheFirst { none: any; @@ -2929,247 +2929,6 @@ namespace normalN { /**@internal*/ const internalConst = 10; /**@internal*/ enum internalEnum { a, b, c } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3162, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 3162, - "kind": "text" - } - ] - }, - { - "pos": 3162, - "end": 3198, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 116, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 116, - "kind": "text" - } - ] - }, - { - "pos": 116, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 116, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-3162):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-3162) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3162-3198) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-116) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (116-276) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5206,6 +4965,247 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3162, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 3162, + "kind": "text" + } + ] + }, + { + "pos": 3162, + "end": 3198, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 116, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 116, + "kind": "text" + } + ] + }, + { + "pos": 116, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 116, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-3162):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-3162) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3162-3198) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-116) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (116-276) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index d11a3831a59..5b477f51694 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,303 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3544, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 172, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 54, - "kind": "internal" - }, - { - "pos": 56, - "end": 172, - "kind": "text" - } - ] - }, - { - "pos": 172, - "end": 249, - "kind": "text" - }, - { - "pos": 249, - "end": 398, - "kind": "internal" - }, - { - "pos": 400, - "end": 432, - "kind": "text" - }, - { - "pos": 432, - "end": 944, - "kind": "internal" - }, - { - "pos": 946, - "end": 949, - "kind": "text" - }, - { - "pos": 949, - "end": 1482, - "kind": "internal" - }, - { - "pos": 1484, - "end": 1532, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (110-3544) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /**@internal*/ function normalC() { - } - /**@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /**@internal*/ get: function () { return 10; }, - /**@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /**@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /**@internal*/ function foo() { } - normalN.foo = foo; - /**@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /**@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /**@internal*/ normalN.someImport = someNamespace.C; - /**@internal*/ normalN.internalConst = 10; - /**@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/**@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/**@internal*/ function internalfoo() { } -/**@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/**@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/**@internal*/ var internalImport = internalNamespace.someClass; -/**@internal*/ var internalConst = 10; -/**@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-172):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-54) -/**@internal*/ interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (56-172) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (172-249) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (249-398) - /**@internal*/ constructor(); - /**@internal*/ prop: string; - /**@internal*/ method(): void; - /**@internal*/ /**@internal*/ c: number; ----------------------------------------------------------------------- -text: (400-432) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (432-944) - /**@internal*/ class C { - } - /**@internal*/ function foo(): void; - /**@internal*/ namespace someNamespace { - class C { - } - } - /**@internal*/ namespace someOther.something { - class someClass { - } - } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ type internalType = internalC; - /**@internal*/ const internalConst = 10; - /**@internal*/ enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (946-949) -} - ----------------------------------------------------------------------- -internal: (949-1482) -/**@internal*/ declare class internalC { -} -/**@internal*/ declare function internalfoo(): void; -/**@internal*/ declare namespace internalNamespace { - class someClass { - } -} -/**@internal*/ declare namespace internalOther.something { - class someClass { - } -} -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ declare type internalType = internalC; -/**@internal*/ declare const internalConst = 10; -/**@internal*/ declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1484-1532) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] /**@internal*/ interface TheFirst { none: any; @@ -3067,20 +2767,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3544, "kind": "text" } ] @@ -3089,12 +2801,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 54, + "end": 172, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 54, + "kind": "internal" + }, + { + "pos": 56, + "end": 172, + "kind": "text" + } + ] + }, + { + "pos": 172, + "end": 249, + "kind": "text" + }, + { + "pos": 249, + "end": 398, "kind": "internal" }, { - "pos": 56, - "end": 172, + "pos": 400, + "end": 432, + "kind": "text" + }, + { + "pos": 432, + "end": 944, + "kind": "internal" + }, + { + "pos": 946, + "end": 949, + "kind": "text" + }, + { + "pos": 949, + "end": 1482, + "kind": "internal" + }, + { + "pos": 1484, + "end": 1532, "kind": "text" } ] @@ -3102,10 +2857,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -3114,15 +2871,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (110-3544) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /**@internal*/ function normalC() { + } + /**@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /**@internal*/ get: function () { return 10; }, + /**@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /**@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /**@internal*/ function foo() { } + normalN.foo = foo; + /**@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /**@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /**@internal*/ normalN.someImport = someNamespace.C; + /**@internal*/ normalN.internalConst = 10; + /**@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/**@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/**@internal*/ function internalfoo() { } +/**@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/**@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/**@internal*/ var internalImport = internalNamespace.someClass; +/**@internal*/ var internalConst = 10; +/**@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-172):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-54) /**@internal*/ interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (56-172) declare const s = "Hello, world"; interface NoJsForHereEither { @@ -3130,6 +2994,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (172-249) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (249-398) + /**@internal*/ constructor(); + /**@internal*/ prop: string; + /**@internal*/ method(): void; + /**@internal*/ /**@internal*/ c: number; +---------------------------------------------------------------------- +text: (400-432) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (432-944) + /**@internal*/ class C { + } + /**@internal*/ function foo(): void; + /**@internal*/ namespace someNamespace { + class C { + } + } + /**@internal*/ namespace someOther.something { + class someClass { + } + } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ type internalType = internalC; + /**@internal*/ const internalConst = 10; + /**@internal*/ enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (946-949) +} + +---------------------------------------------------------------------- +internal: (949-1482) +/**@internal*/ declare class internalC { +} +/**@internal*/ declare function internalfoo(): void; +/**@internal*/ declare namespace internalNamespace { + class someClass { + } +} +/**@internal*/ declare namespace internalOther.something { + class someClass { + } +} +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ declare type internalType = internalC; +/**@internal*/ declare const internalConst = 10; +/**@internal*/ declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1484-1532) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.d.ts] @@ -3438,6 +3373,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 54, + "kind": "internal" + }, + { + "pos": 56, + "end": 172, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-54) +/**@internal*/ interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (56-172) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /**@internal*/ interface TheFirst { none: any; @@ -3532,211 +3532,6 @@ namespace normalN { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3544, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3544, - "kind": "text" - } - ] - }, - { - "pos": 3544, - "end": 3580, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3544):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3544) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /**@internal*/ function normalC() { - } - /**@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /**@internal*/ get: function () { return 10; }, - /**@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /**@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /**@internal*/ function foo() { } - normalN.foo = foo; - /**@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /**@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /**@internal*/ normalN.someImport = someNamespace.C; - /**@internal*/ normalN.internalConst = 10; - /**@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/**@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/**@internal*/ function internalfoo() { } -/**@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/**@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/**@internal*/ var internalImport = internalNamespace.someClass; -/**@internal*/ var internalConst = 10; -/**@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3544-3580) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-276) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5873,6 +5668,211 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3544, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3544, + "kind": "text" + } + ] + }, + { + "pos": 3544, + "end": 3580, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3544):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3544) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /**@internal*/ function normalC() { + } + /**@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /**@internal*/ get: function () { return 10; }, + /**@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /**@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /**@internal*/ function foo() { } + normalN.foo = foo; + /**@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /**@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /**@internal*/ normalN.someImport = someNamespace.C; + /**@internal*/ normalN.internalConst = 10; + /**@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/**@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/**@internal*/ function internalfoo() { } +/**@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/**@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/**@internal*/ var internalImport = internalNamespace.someClass; +/**@internal*/ var internalConst = 10; +/**@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3544-3580) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-276) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled.js index 66f4fcc7f0b..89b3de47cae 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-jsdoc-style-with-comments-emit-enabled.js @@ -1,246 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3434, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 77, - "kind": "text" - }, - { - "pos": 77, - "end": 226, - "kind": "internal" - }, - { - "pos": 228, - "end": 260, - "kind": "text" - }, - { - "pos": 260, - "end": 772, - "kind": "internal" - }, - { - "pos": 774, - "end": 777, - "kind": "text" - }, - { - "pos": 777, - "end": 1310, - "kind": "internal" - }, - { - "pos": 1312, - "end": 1360, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-3434) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /**@internal*/ function normalC() { - } - /**@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /**@internal*/ get: function () { return 10; }, - /**@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /**@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /**@internal*/ function foo() { } - normalN.foo = foo; - /**@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /**@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /**@internal*/ normalN.someImport = someNamespace.C; - /**@internal*/ normalN.internalConst = 10; - /**@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/**@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/**@internal*/ function internalfoo() { } -/**@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/**@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/**@internal*/ var internalImport = internalNamespace.someClass; -/**@internal*/ var internalConst = 10; -/**@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-77) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (77-226) - /**@internal*/ constructor(); - /**@internal*/ prop: string; - /**@internal*/ method(): void; - /**@internal*/ /**@internal*/ c: number; ----------------------------------------------------------------------- -text: (228-260) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (260-772) - /**@internal*/ class C { - } - /**@internal*/ function foo(): void; - /**@internal*/ namespace someNamespace { - class C { - } - } - /**@internal*/ namespace someOther.something { - class someClass { - } - } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ type internalType = internalC; - /**@internal*/ const internalConst = 10; - /**@internal*/ enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (774-777) -} - ----------------------------------------------------------------------- -internal: (777-1310) -/**@internal*/ declare class internalC { -} -/**@internal*/ declare function internalfoo(): void; -/**@internal*/ declare namespace internalNamespace { - class someClass { - } -} -/**@internal*/ declare namespace internalOther.something { - class someClass { - } -} -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ declare type internalType = internalC; -/**@internal*/ declare const internalConst = 10; -/**@internal*/ declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1312-1360) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -2735,20 +2492,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 3434, "kind": "text" } ] @@ -2757,12 +2513,37 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 54, + "end": 77, + "kind": "text" + }, + { + "pos": 77, + "end": 226, "kind": "internal" }, { - "pos": 56, - "end": 172, + "pos": 228, + "end": 260, + "kind": "text" + }, + { + "pos": 260, + "end": 772, + "kind": "internal" + }, + { + "pos": 774, + "end": 777, + "kind": "text" + }, + { + "pos": 777, + "end": 1310, + "kind": "internal" + }, + { + "pos": 1312, + "end": 1360, "kind": "text" } ] @@ -2770,33 +2551,187 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-3434) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /**@internal*/ function normalC() { + } + /**@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /**@internal*/ get: function () { return 10; }, + /**@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /**@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /**@internal*/ function foo() { } + normalN.foo = foo; + /**@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /**@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /**@internal*/ normalN.someImport = someNamespace.C; + /**@internal*/ normalN.internalConst = 10; + /**@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/**@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/**@internal*/ function internalfoo() { } +/**@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/**@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/**@internal*/ var internalImport = internalNamespace.someClass; +/**@internal*/ var internalConst = 10; +/**@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -internal: (0-54) -/**@internal*/ interface TheFirst { - none: any; +text: (0-77) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (77-226) + /**@internal*/ constructor(); + /**@internal*/ prop: string; + /**@internal*/ method(): void; + /**@internal*/ /**@internal*/ c: number; +---------------------------------------------------------------------- +text: (228-260) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (260-772) + /**@internal*/ class C { + } + /**@internal*/ function foo(): void; + /**@internal*/ namespace someNamespace { + class C { + } + } + /**@internal*/ namespace someOther.something { + class someClass { + } + } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ type internalType = internalC; + /**@internal*/ const internalConst = 10; + /**@internal*/ enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (774-777) +} + +---------------------------------------------------------------------- +internal: (777-1310) +/**@internal*/ declare class internalC { +} +/**@internal*/ declare function internalfoo(): void; +/**@internal*/ declare namespace internalNamespace { + class someClass { + } +} +/**@internal*/ declare namespace internalOther.something { + class someClass { + } +} +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ declare type internalType = internalC; +/**@internal*/ declare const internalConst = 10; +/**@internal*/ declare enum internalEnum { + a = 0, + b = 1, + c = 2 } ---------------------------------------------------------------------- -text: (56-172) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +text: (1312-1360) +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -3106,6 +3041,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 54, + "kind": "internal" + }, + { + "pos": 56, + "end": 172, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-54) +/**@internal*/ interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (56-172) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /**@internal*/ interface TheFirst { none: any; @@ -3199,247 +3199,6 @@ namespace normalN { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3544, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 3544, - "kind": "text" - } - ] - }, - { - "pos": 3544, - "end": 3580, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 116, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 116, - "kind": "text" - } - ] - }, - { - "pos": 116, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 116, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-3544):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-3544) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /**@internal*/ function normalC() { - } - /**@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /**@internal*/ get: function () { return 10; }, - /**@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /**@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /**@internal*/ function foo() { } - normalN.foo = foo; - /**@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /**@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /**@internal*/ normalN.someImport = someNamespace.C; - /**@internal*/ normalN.internalConst = 10; - /**@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/**@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/**@internal*/ function internalfoo() { } -/**@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/**@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/**@internal*/ var internalImport = internalNamespace.someClass; -/**@internal*/ var internalConst = 10; -/**@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3544-3580) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-116) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (116-276) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5576,6 +5335,247 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3544, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 3544, + "kind": "text" + } + ] + }, + { + "pos": 3544, + "end": 3580, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 116, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 116, + "kind": "text" + } + ] + }, + { + "pos": 116, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 116, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-3544):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-3544) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /**@internal*/ function normalC() { + } + /**@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /**@internal*/ get: function () { return 10; }, + /**@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /**@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /**@internal*/ function foo() { } + normalN.foo = foo; + /**@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /**@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /**@internal*/ normalN.someImport = someNamespace.C; + /**@internal*/ normalN.internalConst = 10; + /**@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/**@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/**@internal*/ function internalfoo() { } +/**@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/**@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/**@internal*/ var internalImport = internalNamespace.someClass; +/**@internal*/ var internalConst = 10; +/**@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3544-3580) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-116) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (116-276) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-when-few-members-of-enum-are-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-when-few-members-of-enum-are-internal.js index cdbafdcb458..ee49196e076 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-when-few-members-of-enum-are-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-when-few-members-of-enum-are-internal.js @@ -1,68 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 285, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-285) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -448,20 +383,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 1131, + "end": 285, "kind": "text" } ] @@ -470,27 +404,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 42, - "kind": "text" - }, - { - "pos": 42, - "end": 156, - "kind": "internal" - }, - { - "pos": 158, - "end": 276, - "kind": "text" - }, - { - "pos": 276, - "end": 371, - "kind": "internal" - }, - { - "pos": 373, - "end": 533, + "end": 100, "kind": "text" } ] @@ -498,72 +412,39 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-1131) -var TokenFlags; -(function (TokenFlags) { - TokenFlags[TokenFlags["None"] = 0] = "None"; - TokenFlags[TokenFlags["PrecedingLineBreak"] = 1] = "PrecedingLineBreak"; - TokenFlags[TokenFlags["PrecedingJSDocComment"] = 2] = "PrecedingJSDocComment"; - TokenFlags[TokenFlags["Unterminated"] = 4] = "Unterminated"; - TokenFlags[TokenFlags["ExtendedUnicodeEscape"] = 8] = "ExtendedUnicodeEscape"; - TokenFlags[TokenFlags["Scientific"] = 16] = "Scientific"; - TokenFlags[TokenFlags["Octal"] = 32] = "Octal"; - TokenFlags[TokenFlags["HexSpecifier"] = 64] = "HexSpecifier"; - TokenFlags[TokenFlags["BinarySpecifier"] = 128] = "BinarySpecifier"; - TokenFlags[TokenFlags["OctalSpecifier"] = 256] = "OctalSpecifier"; - TokenFlags[TokenFlags["ContainsSeparator"] = 512] = "ContainsSeparator"; - TokenFlags[TokenFlags["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; - TokenFlags[TokenFlags["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; -})(TokenFlags || (TokenFlags = {})); -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-42) -declare enum TokenFlags { - None = 0, - ----------------------------------------------------------------------- -internal: (42-156) - PrecedingLineBreak = 1, - PrecedingJSDocComment = 2, - Unterminated = 4, - ExtendedUnicodeEscape = 8, ----------------------------------------------------------------------- -text: (158-276) - Scientific = 16, - Octal = 32, - HexSpecifier = 64, - BinarySpecifier = 128, - OctalSpecifier = 256, - ----------------------------------------------------------------------- -internal: (276-371) - ContainsSeparator = 512, - BinaryOrOctalSpecifier = 384, - NumericLiteralFlags = 1008 ----------------------------------------------------------------------- -text: (373-533) +text: (0-100) +declare namespace N { } -interface TheFirst { - none: any; +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -1349,6 +1230,125 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 1131, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 42, + "kind": "text" + }, + { + "pos": 42, + "end": 156, + "kind": "internal" + }, + { + "pos": 158, + "end": 276, + "kind": "text" + }, + { + "pos": 276, + "end": 371, + "kind": "internal" + }, + { + "pos": 373, + "end": 533, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-1131) +var TokenFlags; +(function (TokenFlags) { + TokenFlags[TokenFlags["None"] = 0] = "None"; + TokenFlags[TokenFlags["PrecedingLineBreak"] = 1] = "PrecedingLineBreak"; + TokenFlags[TokenFlags["PrecedingJSDocComment"] = 2] = "PrecedingJSDocComment"; + TokenFlags[TokenFlags["Unterminated"] = 4] = "Unterminated"; + TokenFlags[TokenFlags["ExtendedUnicodeEscape"] = 8] = "ExtendedUnicodeEscape"; + TokenFlags[TokenFlags["Scientific"] = 16] = "Scientific"; + TokenFlags[TokenFlags["Octal"] = 32] = "Octal"; + TokenFlags[TokenFlags["HexSpecifier"] = 64] = "HexSpecifier"; + TokenFlags[TokenFlags["BinarySpecifier"] = 128] = "BinarySpecifier"; + TokenFlags[TokenFlags["OctalSpecifier"] = 256] = "OctalSpecifier"; + TokenFlags[TokenFlags["ContainsSeparator"] = 512] = "ContainsSeparator"; + TokenFlags[TokenFlags["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; + TokenFlags[TokenFlags["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; +})(TokenFlags || (TokenFlags = {})); +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-42) +declare enum TokenFlags { + None = 0, + +---------------------------------------------------------------------- +internal: (42-156) + PrecedingLineBreak = 1, + PrecedingJSDocComment = 2, + Unterminated = 4, + ExtendedUnicodeEscape = 8, +---------------------------------------------------------------------- +text: (158-276) + Scientific = 16, + Octal = 32, + HexSpecifier = 64, + BinarySpecifier = 128, + OctalSpecifier = 256, + +---------------------------------------------------------------------- +internal: (276-371) + ContainsSeparator = 512, + BinaryOrOctalSpecifier = 384, + NumericLiteralFlags = 1008 +---------------------------------------------------------------------- +text: (373-533) +} +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] enum TokenFlags { None = 0, @@ -1385,183 +1385,6 @@ interface NoJsForHereEither { console.log(s); -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 1131, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 1131, - "kind": "text" - } - ] - }, - { - "pos": 1131, - "end": 1416, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 1131, - "end": 1416, - "kind": "text" - } - ] - }, - { - "pos": 1416, - "end": 1452, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 320, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 320, - "kind": "text" - } - ] - }, - { - "pos": 320, - "end": 420, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 320, - "end": 420, - "kind": "text" - } - ] - }, - { - "pos": 420, - "end": 439, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-1131):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-1131) -var TokenFlags; -(function (TokenFlags) { - TokenFlags[TokenFlags["None"] = 0] = "None"; - TokenFlags[TokenFlags["PrecedingLineBreak"] = 1] = "PrecedingLineBreak"; - TokenFlags[TokenFlags["PrecedingJSDocComment"] = 2] = "PrecedingJSDocComment"; - TokenFlags[TokenFlags["Unterminated"] = 4] = "Unterminated"; - TokenFlags[TokenFlags["ExtendedUnicodeEscape"] = 8] = "ExtendedUnicodeEscape"; - TokenFlags[TokenFlags["Scientific"] = 16] = "Scientific"; - TokenFlags[TokenFlags["Octal"] = 32] = "Octal"; - TokenFlags[TokenFlags["HexSpecifier"] = 64] = "HexSpecifier"; - TokenFlags[TokenFlags["BinarySpecifier"] = 128] = "BinarySpecifier"; - TokenFlags[TokenFlags["OctalSpecifier"] = 256] = "OctalSpecifier"; - TokenFlags[TokenFlags["ContainsSeparator"] = 512] = "ContainsSeparator"; - TokenFlags[TokenFlags["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; - TokenFlags[TokenFlags["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; -})(TokenFlags || (TokenFlags = {})); -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (1131-1416):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (1131-1416) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (1416-1452) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-320):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-320) -declare enum TokenFlags { - None = 0, - Scientific = 16, - Octal = 32, - HexSpecifier = 64, - BinarySpecifier = 128, - OctalSpecifier = 256, -} -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (320-420):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (320-420) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (420-439) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare enum TokenFlags { None = 0, @@ -2691,6 +2514,183 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 1131, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 1131, + "kind": "text" + } + ] + }, + { + "pos": 1131, + "end": 1416, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 1131, + "end": 1416, + "kind": "text" + } + ] + }, + { + "pos": 1416, + "end": 1452, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 320, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 320, + "kind": "text" + } + ] + }, + { + "pos": 320, + "end": 420, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 320, + "end": 420, + "kind": "text" + } + ] + }, + { + "pos": 420, + "end": 439, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-1131):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-1131) +var TokenFlags; +(function (TokenFlags) { + TokenFlags[TokenFlags["None"] = 0] = "None"; + TokenFlags[TokenFlags["PrecedingLineBreak"] = 1] = "PrecedingLineBreak"; + TokenFlags[TokenFlags["PrecedingJSDocComment"] = 2] = "PrecedingJSDocComment"; + TokenFlags[TokenFlags["Unterminated"] = 4] = "Unterminated"; + TokenFlags[TokenFlags["ExtendedUnicodeEscape"] = 8] = "ExtendedUnicodeEscape"; + TokenFlags[TokenFlags["Scientific"] = 16] = "Scientific"; + TokenFlags[TokenFlags["Octal"] = 32] = "Octal"; + TokenFlags[TokenFlags["HexSpecifier"] = 64] = "HexSpecifier"; + TokenFlags[TokenFlags["BinarySpecifier"] = 128] = "BinarySpecifier"; + TokenFlags[TokenFlags["OctalSpecifier"] = 256] = "OctalSpecifier"; + TokenFlags[TokenFlags["ContainsSeparator"] = 512] = "ContainsSeparator"; + TokenFlags[TokenFlags["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; + TokenFlags[TokenFlags["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; +})(TokenFlags || (TokenFlags = {})); +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (1131-1416):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (1131-1416) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (1416-1452) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-320):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-320) +declare enum TokenFlags { + None = 0, + Scientific = 16, + Octal = 32, + HexSpecifier = 64, + BinarySpecifier = 128, + OctalSpecifier = 256, +} +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (320-420):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (320-420) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (420-439) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js index dd49a9c2d29..86b1db1026c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,303 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3162, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 308, - "kind": "internal" - }, - { - "pos": 310, - "end": 342, - "kind": "text" - }, - { - "pos": 342, - "end": 734, - "kind": "internal" - }, - { - "pos": 736, - "end": 739, - "kind": "text" - }, - { - "pos": 739, - "end": 1152, - "kind": "internal" - }, - { - "pos": 1154, - "end": 1202, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (110-3162) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-308) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (310-342) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (342-734) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (736-739) -} - ----------------------------------------------------------------------- -internal: (739-1152) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1154-1202) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -2837,20 +2537,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3162, "kind": "text" } ] @@ -2859,12 +2571,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 308, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 310, + "end": 342, + "kind": "text" + }, + { + "pos": 342, + "end": 734, + "kind": "internal" + }, + { + "pos": 736, + "end": 739, + "kind": "text" + }, + { + "pos": 739, + "end": 1152, + "kind": "internal" + }, + { + "pos": 1154, + "end": 1202, "kind": "text" } ] @@ -2872,10 +2627,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -2884,15 +2641,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (110-3162) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-39) interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (41-157) declare const s = "Hello, world"; interface NoJsForHereEither { @@ -2900,6 +2764,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-308) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (310-342) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (342-734) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (736-739) +} + +---------------------------------------------------------------------- +internal: (739-1152) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1154-1202) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.d.ts] @@ -3202,6 +3137,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -3274,211 +3274,6 @@ namespace normalN { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3162, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3162, - "kind": "text" - } - ] - }, - { - "pos": 3162, - "end": 3198, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3162):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3162) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3162-3198) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-276) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5515,6 +5310,211 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3162, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3162, + "kind": "text" + } + ] + }, + { + "pos": 3162, + "end": 3198, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3162):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3162) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3162-3198) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-276) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index f9602a08dc2..b61b1a2a2f3 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,303 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3526, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 39, - "kind": "internal" - }, - { - "pos": 41, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 234, - "kind": "text" - }, - { - "pos": 234, - "end": 322, - "kind": "internal" - }, - { - "pos": 324, - "end": 356, - "kind": "text" - }, - { - "pos": 356, - "end": 748, - "kind": "internal" - }, - { - "pos": 750, - "end": 753, - "kind": "text" - }, - { - "pos": 753, - "end": 1166, - "kind": "internal" - }, - { - "pos": 1168, - "end": 1216, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -text: (110-3526) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 ->>-------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; -} ->>-------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -text: (157-234) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (234-322) - constructor(); - prop: string; - method(): void; - /*@internal*/ c: number; ----------------------------------------------------------------------- -text: (324-356) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (356-748) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (750-753) -} - ----------------------------------------------------------------------- -internal: (753-1166) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1168-1216) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -2937,20 +2637,32 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3526, "kind": "text" } ] @@ -2959,12 +2671,55 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 234, + "kind": "text" + }, + { + "pos": 234, + "end": 322, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 324, + "end": 356, + "kind": "text" + }, + { + "pos": 356, + "end": 748, + "kind": "internal" + }, + { + "pos": 750, + "end": 753, + "kind": "text" + }, + { + "pos": 753, + "end": 1166, + "kind": "internal" + }, + { + "pos": 1168, + "end": 1216, "kind": "text" } ] @@ -2972,10 +2727,12 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -2984,15 +2741,122 @@ function f() { return "JS does hoists"; } -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- +text: (110-3526) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 2 +>>-------------------------------------------------------------------- internal: (0-39) interface TheFirst { none: any; } ----------------------------------------------------------------------- +>>-------------------------------------------------------------------- text: (41-157) declare const s = "Hello, world"; interface NoJsForHereEither { @@ -3000,6 +2864,77 @@ interface NoJsForHereEither { } declare function f(): string; +---------------------------------------------------------------------- +text: (157-234) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (234-322) + constructor(); + prop: string; + method(): void; + /*@internal*/ c: number; +---------------------------------------------------------------------- +text: (324-356) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (356-748) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (750-753) +} + +---------------------------------------------------------------------- +internal: (753-1166) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 +} +---------------------------------------------------------------------- +text: (1168-1216) +declare class C { + doSomething(): void; +} + ====================================================================== //// [/src/first/bin/first-output.d.ts] @@ -3302,6 +3237,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -3396,211 +3396,6 @@ namespace normalN { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3526, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 0, - "end": 3526, - "kind": "text" - } - ] - }, - { - "pos": 3526, - "end": 3562, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-3526):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-3526) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3526-3562) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-276) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5737,6 +5532,211 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 3526, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 0, + "end": 3526, + "kind": "text" + } + ] + }, + { + "pos": 3526, + "end": 3562, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-3526):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-3526) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3526-3562) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-276) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-with-comments-emit-enabled.js index 5c885ff4721..625d5c93187 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal-with-comments-emit-enabled.js @@ -1,246 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3416, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 77, - "kind": "text" - }, - { - "pos": 77, - "end": 165, - "kind": "internal" - }, - { - "pos": 167, - "end": 199, - "kind": "text" - }, - { - "pos": 199, - "end": 591, - "kind": "internal" - }, - { - "pos": 593, - "end": 596, - "kind": "text" - }, - { - "pos": 596, - "end": 1009, - "kind": "internal" - }, - { - "pos": 1011, - "end": 1059, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-3416) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-77) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (77-165) - constructor(); - prop: string; - method(): void; - /*@internal*/ c: number; ----------------------------------------------------------------------- -text: (167-199) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (199-591) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (593-596) -} - ----------------------------------------------------------------------- -internal: (596-1009) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (1011-1059) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -2611,20 +2368,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 3416, "kind": "text" } ] @@ -2633,12 +2389,37 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 77, + "kind": "text" + }, + { + "pos": 77, + "end": 165, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 167, + "end": 199, + "kind": "text" + }, + { + "pos": 199, + "end": 591, + "kind": "internal" + }, + { + "pos": 593, + "end": 596, + "kind": "text" + }, + { + "pos": 596, + "end": 1009, + "kind": "internal" + }, + { + "pos": 1011, + "end": 1059, "kind": "text" } ] @@ -2646,33 +2427,187 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-3416) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; +text: (0-77) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (77-165) + constructor(); + prop: string; + method(): void; + /*@internal*/ c: number; +---------------------------------------------------------------------- +text: (167-199) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (199-591) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (593-596) +} + +---------------------------------------------------------------------- +internal: (596-1009) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 } ---------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +text: (1011-1059) +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -2976,6 +2911,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -3069,247 +3069,6 @@ namespace normalN { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3526, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 3526, - "kind": "text" - } - ] - }, - { - "pos": 3526, - "end": 3562, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 116, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 116, - "kind": "text" - } - ] - }, - { - "pos": 116, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 116, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-3526):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-3526) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = /** @class */ (function () { - /*@internal*/ function normalC() { - } - /*@internal*/ normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - /*@internal*/ get: function () { return 10; }, - /*@internal*/ set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - /*@internal*/ var C = /** @class */ (function () { - function C() { - } - return C; - }()); - normalN.C = C; - /*@internal*/ function foo() { } - normalN.foo = foo; - /*@internal*/ var someNamespace; - (function (someNamespace) { - var C = /** @class */ (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - /*@internal*/ var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - /*@internal*/ normalN.someImport = someNamespace.C; - /*@internal*/ normalN.internalConst = 10; - /*@internal*/ var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -/*@internal*/ var internalC = /** @class */ (function () { - function internalC() { - } - return internalC; -}()); -/*@internal*/ function internalfoo() { } -/*@internal*/ var internalNamespace; -(function (internalNamespace) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -/*@internal*/ var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -/*@internal*/ var internalImport = internalNamespace.someClass; -/*@internal*/ var internalConst = 10; -/*@internal*/ var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = /** @class */ (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3526-3562) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-116) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (116-276) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5446,6 +5205,247 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3526, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 3526, + "kind": "text" + } + ] + }, + { + "pos": 3526, + "end": 3562, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 116, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 116, + "kind": "text" + } + ] + }, + { + "pos": 116, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 116, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-3526):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-3526) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = /** @class */ (function () { + /*@internal*/ function normalC() { + } + /*@internal*/ normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + /*@internal*/ get: function () { return 10; }, + /*@internal*/ set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + /*@internal*/ var C = /** @class */ (function () { + function C() { + } + return C; + }()); + normalN.C = C; + /*@internal*/ function foo() { } + normalN.foo = foo; + /*@internal*/ var someNamespace; + (function (someNamespace) { + var C = /** @class */ (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + /*@internal*/ var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + /*@internal*/ normalN.someImport = someNamespace.C; + /*@internal*/ normalN.internalConst = 10; + /*@internal*/ var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +/*@internal*/ var internalC = /** @class */ (function () { + function internalC() { + } + return internalC; +}()); +/*@internal*/ function internalfoo() { } +/*@internal*/ var internalNamespace; +(function (internalNamespace) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +/*@internal*/ var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +/*@internal*/ var internalImport = internalNamespace.someClass; +/*@internal*/ var internalConst = 10; +/*@internal*/ var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = /** @class */ (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3526-3562) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-116) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (116-276) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal.js index 2d001445348..c9a7394d28b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/stripInternal.js @@ -1,246 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 3052, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 77, - "kind": "text" - }, - { - "pos": 77, - "end": 151, - "kind": "internal" - }, - { - "pos": 153, - "end": 185, - "kind": "text" - }, - { - "pos": 185, - "end": 577, - "kind": "internal" - }, - { - "pos": 579, - "end": 582, - "kind": "text" - }, - { - "pos": 582, - "end": 995, - "kind": "internal" - }, - { - "pos": 997, - "end": 1045, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-3052) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-77) -declare namespace N { -} -declare namespace N { -} -declare class normalC { - ----------------------------------------------------------------------- -internal: (77-151) - constructor(); - prop: string; - method(): void; - c: number; ----------------------------------------------------------------------- -text: (153-185) -} -declare namespace normalN { - ----------------------------------------------------------------------- -internal: (185-577) - class C { - } - function foo(): void; - namespace someNamespace { - class C { - } - } - namespace someOther.something { - class someClass { - } - } - export import someImport = someNamespace.C; - type internalType = internalC; - const internalConst = 10; - enum internalEnum { - a = 0, - b = 1, - c = 2 - } ----------------------------------------------------------------------- -text: (579-582) -} - ----------------------------------------------------------------------- -internal: (582-995) -declare class internalC { -} -declare function internalfoo(): void; -declare namespace internalNamespace { - class someClass { - } -} -declare namespace internalOther.something { - class someClass { - } -} -import internalImport = internalNamespace.someClass; -declare type internalType = internalC; -declare const internalConst = 10; -declare enum internalEnum { - a = 0, - b = 1, - c = 2 -} ----------------------------------------------------------------------- -text: (997-1045) -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -2511,20 +2268,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 3052, "kind": "text" } ] @@ -2533,12 +2289,37 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 39, + "end": 77, + "kind": "text" + }, + { + "pos": 77, + "end": 151, "kind": "internal" }, { - "pos": 41, - "end": 157, + "pos": 153, + "end": 185, + "kind": "text" + }, + { + "pos": 185, + "end": 577, + "kind": "internal" + }, + { + "pos": 579, + "end": 582, + "kind": "text" + }, + { + "pos": 582, + "end": 995, + "kind": "internal" + }, + { + "pos": 997, + "end": 1045, "kind": "text" } ] @@ -2546,33 +2327,187 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-3052) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -internal: (0-39) -interface TheFirst { - none: any; +text: (0-77) +declare namespace N { +} +declare namespace N { +} +declare class normalC { + +---------------------------------------------------------------------- +internal: (77-151) + constructor(); + prop: string; + method(): void; + c: number; +---------------------------------------------------------------------- +text: (153-185) +} +declare namespace normalN { + +---------------------------------------------------------------------- +internal: (185-577) + class C { + } + function foo(): void; + namespace someNamespace { + class C { + } + } + namespace someOther.something { + class someClass { + } + } + export import someImport = someNamespace.C; + type internalType = internalC; + const internalConst = 10; + enum internalEnum { + a = 0, + b = 1, + c = 2 + } +---------------------------------------------------------------------- +text: (579-582) +} + +---------------------------------------------------------------------- +internal: (582-995) +declare class internalC { +} +declare function internalfoo(): void; +declare namespace internalNamespace { + class someClass { + } +} +declare namespace internalOther.something { + class someClass { + } +} +import internalImport = internalNamespace.someClass; +declare type internalType = internalC; +declare const internalConst = 10; +declare enum internalEnum { + a = 0, + b = 1, + c = 2 } ---------------------------------------------------------------------- -text: (41-157) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +text: (997-1045) +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -2876,6 +2811,71 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 39, + "kind": "internal" + }, + { + "pos": 41, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +internal: (0-39) +interface TheFirst { + none: any; +} +---------------------------------------------------------------------- +text: (41-157) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/first/first_PART1.ts] /*@internal*/ interface TheFirst { none: any; @@ -2929,247 +2929,6 @@ namespace normalN { /*@internal*/ const internalConst = 10; /*@internal*/ enum internalEnum { a, b, c } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 3162, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 3162, - "kind": "text" - } - ] - }, - { - "pos": 3162, - "end": 3198, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 116, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 116, - "kind": "text" - } - ] - }, - { - "pos": 116, - "end": 276, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 116, - "end": 276, - "kind": "text" - } - ] - }, - { - "pos": 276, - "end": 295, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-3162):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-3162) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var normalC = (function () { - function normalC() { - } - normalC.prototype.method = function () { }; - Object.defineProperty(normalC.prototype, "c", { - get: function () { return 10; }, - set: function (val) { }, - enumerable: true, - configurable: true - }); - return normalC; -}()); -var normalN; -(function (normalN) { - var C = (function () { - function C() { - } - return C; - }()); - normalN.C = C; - function foo() { } - normalN.foo = foo; - var someNamespace; - (function (someNamespace) { - var C = (function () { - function C() { - } - return C; - }()); - someNamespace.C = C; - })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); - var someOther; - (function (someOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = someOther.something || (someOther.something = {})); - })(someOther = normalN.someOther || (normalN.someOther = {})); - normalN.someImport = someNamespace.C; - normalN.internalConst = 10; - var internalEnum; - (function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; - })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); -})(normalN || (normalN = {})); -var internalC = (function () { - function internalC() { - } - return internalC; -}()); -function internalfoo() { } -var internalNamespace; -(function (internalNamespace) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - internalNamespace.someClass = someClass; -})(internalNamespace || (internalNamespace = {})); -var internalOther; -(function (internalOther) { - var something; - (function (something) { - var someClass = (function () { - function someClass() { - } - return someClass; - }()); - something.someClass = someClass; - })(something = internalOther.something || (internalOther.something = {})); -})(internalOther || (internalOther = {})); -var internalImport = internalNamespace.someClass; -var internalConst = 10; -var internalEnum; -(function (internalEnum) { - internalEnum[internalEnum["a"] = 0] = "a"; - internalEnum[internalEnum["b"] = 1] = "b"; - internalEnum[internalEnum["c"] = 2] = "c"; -})(internalEnum || (internalEnum = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (3162-3198) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-116) -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (116-276) -declare namespace N { -} -declare namespace N { -} -declare class normalC { -} -declare namespace normalN { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (276-295) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5206,6 +4965,247 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 3162, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 3162, + "kind": "text" + } + ] + }, + { + "pos": 3162, + "end": 3198, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 116, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 116, + "kind": "text" + } + ] + }, + { + "pos": 116, + "end": 276, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 116, + "end": 276, + "kind": "text" + } + ] + }, + { + "pos": 276, + "end": 295, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-3162):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-3162) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var normalC = (function () { + function normalC() { + } + normalC.prototype.method = function () { }; + Object.defineProperty(normalC.prototype, "c", { + get: function () { return 10; }, + set: function (val) { }, + enumerable: true, + configurable: true + }); + return normalC; +}()); +var normalN; +(function (normalN) { + var C = (function () { + function C() { + } + return C; + }()); + normalN.C = C; + function foo() { } + normalN.foo = foo; + var someNamespace; + (function (someNamespace) { + var C = (function () { + function C() { + } + return C; + }()); + someNamespace.C = C; + })(someNamespace = normalN.someNamespace || (normalN.someNamespace = {})); + var someOther; + (function (someOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = someOther.something || (someOther.something = {})); + })(someOther = normalN.someOther || (normalN.someOther = {})); + normalN.someImport = someNamespace.C; + normalN.internalConst = 10; + var internalEnum; + (function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; + })(internalEnum = normalN.internalEnum || (normalN.internalEnum = {})); +})(normalN || (normalN = {})); +var internalC = (function () { + function internalC() { + } + return internalC; +}()); +function internalfoo() { } +var internalNamespace; +(function (internalNamespace) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + internalNamespace.someClass = someClass; +})(internalNamespace || (internalNamespace = {})); +var internalOther; +(function (internalOther) { + var something; + (function (something) { + var someClass = (function () { + function someClass() { + } + return someClass; + }()); + something.someClass = someClass; + })(something = internalOther.something || (internalOther.something = {})); +})(internalOther || (internalOther = {})); +var internalImport = internalNamespace.someClass; +var internalConst = 10; +var internalEnum; +(function (internalEnum) { + internalEnum[internalEnum["a"] = 0] = "a"; + internalEnum[internalEnum["b"] = 1] = "b"; + internalEnum[internalEnum["c"] = 2] = "c"; +})(internalEnum || (internalEnum = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (3162-3198) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-116):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-116) +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (116-276):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (116-276) +declare namespace N { +} +declare namespace N { +} +declare class normalC { +} +declare namespace normalN { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (276-295) +declare var c: C; + +====================================================================== + //// [/src/third/tsconfig.json] { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/triple-slash-refs-in-all-projects.js index 53e74f7637e..71d985bca54 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/triple-slash-refs-in-all-projects.js @@ -1,79 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 336, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 49, - "kind": "reference", - "data": "../second/tripleRef.d.ts" - }, - { - "pos": 51, - "end": 205, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-336) -var second_part1Const = new secondsecond_part1(); -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -reference: (0-49):: ../second/tripleRef.d.ts -/// ----------------------------------------------------------------------- -text: (51-205) -declare const second_part1Const: secondsecond_part1; -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] /// declare const second_part1Const: secondsecond_part1; @@ -513,20 +437,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 158, + "end": 336, "kind": "text" } ] @@ -535,13 +458,13 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 42, + "end": 49, "kind": "reference", - "data": "../tripleRef.d.ts" + "data": "../second/tripleRef.d.ts" }, { - "pos": 44, - "end": 252, + "pos": 51, + "end": 205, "kind": "text" } ] @@ -549,36 +472,44 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-158) -var s = "Hello, world"; -console.log(s); -var first_part2Const = new firstfirst_part2(); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-336) +var second_part1Const = new secondsecond_part1(); +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -reference: (0-42):: ../tripleRef.d.ts -/// +reference: (0-49):: ../second/tripleRef.d.ts +/// ---------------------------------------------------------------------- -text: (44-252) -interface TheFirst { - none: any; +text: (51-205) +declare const second_part1Const: secondsecond_part1; +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare const first_part2Const: firstfirst_part2; -declare function f(): string; ====================================================================== @@ -939,6 +870,75 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 158, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 42, + "kind": "reference", + "data": "../tripleRef.d.ts" + }, + { + "pos": 44, + "end": 252, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-158) +var s = "Hello, world"; +console.log(s); +var first_part2Const = new firstfirst_part2(); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +reference: (0-42):: ../tripleRef.d.ts +/// +---------------------------------------------------------------------- +text: (44-252) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare const first_part2Const: firstfirst_part2; +declare function f(): string; + +====================================================================== + //// [/src/first/first_part2.ts] /// const first_part2Const = new firstfirst_part2(); @@ -967,192 +967,6 @@ namespace N { //// [/src/second/tripleRef.d.ts] declare class secondsecond_part1 { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 158, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 158, - "kind": "text" - } - ] - }, - { - "pos": 158, - "end": 494, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 158, - "end": 494, - "kind": "text" - } - ] - }, - { - "pos": 494, - "end": 578, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 45, - "kind": "reference", - "data": "../../tripleRef.d.ts" - }, - { - "pos": 47, - "end": 101, - "kind": "reference", - "data": "../../../first/tripleRef.d.ts" - }, - { - "pos": 103, - "end": 158, - "kind": "reference", - "data": "../../../second/tripleRef.d.ts" - }, - { - "pos": 160, - "end": 368, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 160, - "end": 368, - "kind": "text" - } - ] - }, - { - "pos": 368, - "end": 522, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 368, - "end": 522, - "kind": "text" - } - ] - }, - { - "pos": 522, - "end": 592, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-158):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-158) -var s = "Hello, world"; -console.log(s); -var first_part2Const = new firstfirst_part2(); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (158-494):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (158-494) -var second_part1Const = new secondsecond_part1(); -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (494-578) -var third_part1Const = new thirdthird_part1(); -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -reference: (0-45):: ../../tripleRef.d.ts -/// ----------------------------------------------------------------------- -reference: (47-101):: ../../../first/tripleRef.d.ts -/// ----------------------------------------------------------------------- -reference: (103-158):: ../../../second/tripleRef.d.ts -/// ----------------------------------------------------------------------- -prepend: (160-368):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (160-368) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare const first_part2Const: firstfirst_part2; -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (368-522):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (368-522) -declare const second_part1Const: secondsecond_part1; -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (522-592) -declare const third_part1Const: thirdthird_part1; -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] /// /// @@ -2054,6 +1868,192 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 158, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 158, + "kind": "text" + } + ] + }, + { + "pos": 158, + "end": 494, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 158, + "end": 494, + "kind": "text" + } + ] + }, + { + "pos": 494, + "end": 578, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 45, + "kind": "reference", + "data": "../../tripleRef.d.ts" + }, + { + "pos": 47, + "end": 101, + "kind": "reference", + "data": "../../../first/tripleRef.d.ts" + }, + { + "pos": 103, + "end": 158, + "kind": "reference", + "data": "../../../second/tripleRef.d.ts" + }, + { + "pos": 160, + "end": 368, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 160, + "end": 368, + "kind": "text" + } + ] + }, + { + "pos": 368, + "end": 522, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 368, + "end": 522, + "kind": "text" + } + ] + }, + { + "pos": 522, + "end": 592, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-158):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-158) +var s = "Hello, world"; +console.log(s); +var first_part2Const = new firstfirst_part2(); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (158-494):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (158-494) +var second_part1Const = new secondsecond_part1(); +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (494-578) +var third_part1Const = new thirdthird_part1(); +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +reference: (0-45):: ../../tripleRef.d.ts +/// +---------------------------------------------------------------------- +reference: (47-101):: ../../../first/tripleRef.d.ts +/// +---------------------------------------------------------------------- +reference: (103-158):: ../../../second/tripleRef.d.ts +/// +---------------------------------------------------------------------- +prepend: (160-368):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (160-368) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare const first_part2Const: firstfirst_part2; +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (368-522):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (368-522) +declare const second_part1Const: secondsecond_part1; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (522-592) +declare const third_part1Const: thirdthird_part1; +declare var c: C; + +====================================================================== + //// [/src/third/third_part1.ts] /// const third_part1Const = new thirdthird_part1(); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/triple-slash-refs-in-one-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/triple-slash-refs-in-one-project.js index ce160084baf..d36d911b903 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/triple-slash-refs-in-one-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/triple-slash-refs-in-one-project.js @@ -1,79 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 336, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 49, - "kind": "reference", - "data": "../second/tripleRef.d.ts" - }, - { - "pos": 51, - "end": 205, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-336) -var second_part1Const = new secondsecond_part1(); -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -reference: (0-49):: ../second/tripleRef.d.ts -/// ----------------------------------------------------------------------- -text: (51-205) -declare const second_part1Const: secondsecond_part1; -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] /// declare const second_part1Const: secondsecond_part1; @@ -513,20 +437,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 336, "kind": "text" } ] @@ -535,7 +458,13 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 157, + "end": 49, + "kind": "reference", + "data": "../second/tripleRef.d.ts" + }, + { + "pos": 51, + "end": 205, "kind": "text" } ] @@ -543,31 +472,44 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-336) +var second_part1Const = new secondsecond_part1(); +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +reference: (0-49):: ../second/tripleRef.d.ts +/// +---------------------------------------------------------------------- +text: (51-205) +declare const second_part1Const: secondsecond_part1; +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -871,6 +813,64 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/first/", + "sourceFiles": [ + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + } +} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + //// [/src/second/second_part1.ts] /// const second_part1Const = new secondsecond_part1(); @@ -890,170 +890,6 @@ namespace N { //// [/src/second/tripleRef.d.ts] declare class secondsecond_part1 { } -//// [/src/third/thirdjs/output/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/third/", - "sourceFiles": [ - "/src/third/third_part1.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 446, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 446, - "kind": "text" - } - ] - }, - { - "pos": 446, - "end": 482, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 55, - "kind": "reference", - "data": "../../../second/tripleRef.d.ts" - }, - { - "pos": 57, - "end": 214, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 57, - "end": 214, - "kind": "text" - } - ] - }, - { - "pos": 214, - "end": 368, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 214, - "end": 368, - "kind": "text" - } - ] - }, - { - "pos": 368, - "end": 387, - "kind": "text" - } - ] - } - } -} - -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/third/thirdjs/output/third-output.js ----------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - ----------------------------------------------------------------------- -prepend: (110-446):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-446) -var second_part1Const = new secondsecond_part1(); -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (446-482) -var c = new C(); -c.doSomething(); - -====================================================================== -====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts ----------------------------------------------------------------------- -reference: (0-55):: ../../../second/tripleRef.d.ts -/// ----------------------------------------------------------------------- -prepend: (57-214):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (57-214) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - ----------------------------------------------------------------------- -prepend: (214-368):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (214-368) -declare const second_part1Const: secondsecond_part1; -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (368-387) -declare var c: C; - -====================================================================== - //// [/src/third/thirdjs/output/third-output.d.ts] /// interface TheFirst { @@ -1844,3 +1680,167 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 446, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 446, + "kind": "text" + } + ] + }, + { + "pos": 446, + "end": 482, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 55, + "kind": "reference", + "data": "../../../second/tripleRef.d.ts" + }, + { + "pos": 57, + "end": 214, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 57, + "end": 214, + "kind": "text" + } + ] + }, + { + "pos": 214, + "end": 368, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 214, + "end": 368, + "kind": "text" + } + ] + }, + { + "pos": 368, + "end": 387, + "kind": "text" + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-446):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-446) +var second_part1Const = new secondsecond_part1(); +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (446-482) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +reference: (0-55):: ../../../second/tripleRef.d.ts +/// +---------------------------------------------------------------------- +prepend: (57-214):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (57-214) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (214-368):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (214-368) +declare const second_part1Const: secondsecond_part1; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (368-387) +declare var c: C; + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/when-final-project-is-not-composite-but-uses-project-references.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/when-final-project-is-not-composite-but-uses-project-references.js index e0433945669..47995a0c128 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/when-final-project-is-not-composite-but-uses-project-references.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/when-final-project-is-not-composite-but-uses-project-references.js @@ -1,68 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 285, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-285) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -448,20 +383,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 285, "kind": "text" } ] @@ -470,7 +404,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 157, + "end": 100, "kind": "text" } ] @@ -478,31 +412,39 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (0-100) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -806,44 +748,20 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 395, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 395, - "kind": "text" - } - ] - }, - { - "pos": 395, - "end": 431, "kind": "text" } ] @@ -853,32 +771,6 @@ sourceFile:../first_part3.ts { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] - }, - { - "pos": 257, - "end": 276, "kind": "text" } ] @@ -886,12 +778,10 @@ sourceFile:../first_part3.ts } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -900,37 +790,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (110-395):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-395) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ----------------------------------------------------------------------- -text: (395-431) -var c = new C(); -c.doSomething(); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -941,22 +804,6 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ----------------------------------------------------------------------- -text: (257-276) -declare var c: C; - ====================================================================== //// [/src/third/thirdjs/output/third-output.d.ts] diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/when-source-files-are-empty-in-the-own-file.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/when-source-files-are-empty-in-the-own-file.js index c3d54068bf9..bfb8406f74a 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/when-source-files-are-empty-in-the-own-file.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-Build/buildInfo/when-source-files-are-empty-in-the-own-file.js @@ -1,68 +1,3 @@ -//// [/src/2/.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "/src/second/", - "sourceFiles": [ - "/src/second/second_part1.ts", - "/src/second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 285, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - } -} - -//// [/src/2/.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-285) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - -====================================================================== - //// [/src/2/second-output.d.ts] declare namespace N { } @@ -448,20 +383,19 @@ sourceFile:../second/second_part2.ts --- >>>//# sourceMappingURL=second-output.js.map -//// [/src/first/bin/.tsbuildinfo] +//// [/src/2/second-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/first/", + "commonSourceDirectory": "/src/second/", "sourceFiles": [ - "/src/first/first_PART1.ts", - "/src/first/first_part2.ts", - "/src/first/first_part3.ts" + "/src/second/second_part1.ts", + "/src/second/second_part2.ts" ], "js": { "sections": [ { "pos": 0, - "end": 110, + "end": 285, "kind": "text" } ] @@ -470,7 +404,7 @@ sourceFile:../second/second_part2.ts "sections": [ { "pos": 0, - "end": 157, + "end": 100, "kind": "text" } ] @@ -478,31 +412,39 @@ sourceFile:../second/second_part2.ts } } -//// [/src/first/bin/.tsbuildinfo.baseline.txt] +//// [/src/2/second-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/first/bin/first-output.js +File:: /src/2/second-output.js ---------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); ====================================================================== ====================================================================== -File:: /src/first/bin/first-output.d.ts +File:: /src/2/second-output.d.ts ---------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; +text: (0-100) +declare namespace N { } -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; +declare namespace N { +} +declare class C { + doSomething(): void; } -declare function f(): string; ====================================================================== @@ -806,40 +748,21 @@ sourceFile:../first_part3.ts --- >>>//# sourceMappingURL=first-output.js.map -//// [/src/third/thirdjs/output/.tsbuildinfo] +//// [/src/first/bin/first-output.tsbuildinfo] { "bundle": { - "commonSourceDirectory": "/src/third/", + "commonSourceDirectory": "/src/first/", "sourceFiles": [ - "/src/third/third_part1.ts" + "/src/first/first_PART1.ts", + "/src/first/first_part2.ts", + "/src/first/first_part3.ts" ], "js": { "sections": [ { "pos": 0, "end": 110, - "kind": "prepend", - "data": "/src/first/bin/first-output.js", - "texts": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - { - "pos": 110, - "end": 395, - "kind": "prepend", - "data": "/src/2/second-output.js", - "texts": [ - { - "pos": 110, - "end": 395, - "kind": "text" - } - ] + "kind": "text" } ] }, @@ -848,40 +771,17 @@ sourceFile:../first_part3.ts { "pos": 0, "end": 157, - "kind": "prepend", - "data": "/src/first/bin/first-output.d.ts", - "texts": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - }, - { - "pos": 157, - "end": 257, - "kind": "prepend", - "data": "/src/2/second-output.d.ts", - "texts": [ - { - "pos": 157, - "end": 257, - "kind": "text" - } - ] + "kind": "text" } ] } } } -//// [/src/third/thirdjs/output/.tsbuildinfo.baseline.txt] +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== -File:: /src/third/thirdjs/output/third-output.js +File:: /src/first/bin/first-output.js ---------------------------------------------------------------------- -prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 ->>-------------------------------------------------------------------- text: (0-110) var s = "Hello, world"; console.log(s); @@ -890,32 +790,10 @@ function f() { return "JS does hoists"; } ----------------------------------------------------------------------- -prepend: (110-395):: /src/2/second-output.js texts:: 1 ->>-------------------------------------------------------------------- -text: (110-395) -var N; -(function (N) { - function f() { - console.log('testing'); - } - f(); -})(N || (N = {})); -var C = (function () { - function C() { - } - C.prototype.doSomething = function () { - console.log("something got done"); - }; - return C; -}()); - ====================================================================== ====================================================================== -File:: /src/third/thirdjs/output/third-output.d.ts +File:: /src/first/bin/first-output.d.ts ---------------------------------------------------------------------- -prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- text: (0-157) interface TheFirst { none: any; @@ -926,18 +804,6 @@ interface NoJsForHereEither { } declare function f(): string; ----------------------------------------------------------------------- -prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (157-257) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} - ====================================================================== //// [/src/third/thirdjs/output/third-output.d.ts] @@ -1594,6 +1460,140 @@ sourceFile:../../../second/second_part2.ts --- >>>//# sourceMappingURL=third-output.js.map +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "/src/third/", + "sourceFiles": [ + "/src/third/third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "/src/first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 395, + "kind": "prepend", + "data": "/src/2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 395, + "kind": "text" + } + ] + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "/src/first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "/src/2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + } + ] + } + } +} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: /src/first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-395):: /src/2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-395) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: /src/first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: /src/2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +====================================================================== + //// [/src/third/third_part1.ts] diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/buildInfo/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/buildInfo/sample.js index fee1115c61c..adc12a4db6e 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/buildInfo/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/buildInfo/sample.js @@ -1,62 +1,3 @@ -//// [/src/core/.tsbuildinfo] -{ - "program": { - "fileInfos": { - "/lib/lib.d.ts": { - "version": "/lib/lib.d.ts", - "signature": "/lib/lib.d.ts" - }, - "/lib/lib.es5.d.ts": { - "version": "/lib/lib.es5.d.ts", - "signature": "/lib/lib.es5.d.ts" - }, - "/lib/lib.dom.d.ts": { - "version": "/lib/lib.dom.d.ts", - "signature": "/lib/lib.dom.d.ts" - }, - "/lib/lib.webworker.importscripts.d.ts": { - "version": "/lib/lib.webworker.importscripts.d.ts", - "signature": "/lib/lib.webworker.importscripts.d.ts" - }, - "/lib/lib.scripthost.d.ts": { - "version": "/lib/lib.scripthost.d.ts", - "signature": "/lib/lib.scripthost.d.ts" - }, - "/src/core/anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" - }, - "/src/core/index.ts": { - "version": "-13387000654", - "signature": "12514354613" - }, - "/src/core/some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "configFilePath": "/src/core/tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "/lib/lib.d.ts", - "/lib/lib.dom.d.ts", - "/lib/lib.es5.d.ts", - "/lib/lib.scripthost.d.ts", - "/lib/lib.webworker.importscripts.d.ts", - "/src/core/anothermodule.ts", - "/src/core/index.ts", - "/src/core/some_decl.d.ts" - ] - } -} - //// [/src/core/index.d.ts] export declare const someString: string; export declare function leftPad(s: string, n: number): string; @@ -226,7 +167,66 @@ export function multiply(a: number, b: number) { return a * b; } export class someClass { } -//// [/src/logic/.tsbuildinfo] +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "/lib/lib.d.ts": { + "version": "/lib/lib.d.ts", + "signature": "/lib/lib.d.ts" + }, + "/lib/lib.es5.d.ts": { + "version": "/lib/lib.es5.d.ts", + "signature": "/lib/lib.es5.d.ts" + }, + "/lib/lib.dom.d.ts": { + "version": "/lib/lib.dom.d.ts", + "signature": "/lib/lib.dom.d.ts" + }, + "/lib/lib.webworker.importscripts.d.ts": { + "version": "/lib/lib.webworker.importscripts.d.ts", + "signature": "/lib/lib.webworker.importscripts.d.ts" + }, + "/lib/lib.scripthost.d.ts": { + "version": "/lib/lib.scripthost.d.ts", + "signature": "/lib/lib.scripthost.d.ts" + }, + "/src/core/anothermodule.ts": { + "version": "-2676574883", + "signature": "25219880154" + }, + "/src/core/index.ts": { + "version": "-13387000654", + "signature": "12514354613" + }, + "/src/core/some_decl.d.ts": { + "version": "-9253692965", + "signature": "-9253692965" + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "configFilePath": "/src/core/tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "/lib/lib.d.ts", + "/lib/lib.dom.d.ts", + "/lib/lib.es5.d.ts", + "/lib/lib.scripthost.d.ts", + "/lib/lib.webworker.importscripts.d.ts", + "/src/core/anothermodule.ts", + "/src/core/index.ts", + "/src/core/some_decl.d.ts" + ] + } +} + +//// [/src/logic/tsconfig.tsbuildinfo] { "program": { "fileInfos": { @@ -295,7 +295,7 @@ export class someClass { } } } -//// [/src/tests/.tsbuildinfo] +//// [/src/tests/tsconfig.tsbuildinfo] { "program": { "fileInfos": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/buildInfo/when-logic-config-changes-declaration-dir.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/buildInfo/when-logic-config-changes-declaration-dir.js index 6987e5776c2..6a9652a2eeb 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/buildInfo/when-logic-config-changes-declaration-dir.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/buildInfo/when-logic-config-changes-declaration-dir.js @@ -1,4 +1,26 @@ -//// [/src/logic/.tsbuildinfo] +//// [/src/logic/decls/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationDir": "decls", + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/logic/tsconfig.tsbuildinfo] { "program": { "fileInfos": { @@ -68,29 +90,7 @@ } } -//// [/src/logic/decls/index.d.ts] -export declare function getSecondsInDay(): number; -import * as mod from '../core/anotherModule'; -export declare const m: typeof mod; - - -//// [/src/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - "declarationDir": "decls", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - -//// [/src/tests/.tsbuildinfo] +//// [/src/tests/tsconfig.tsbuildinfo] { "program": { "fileInfos": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/buildInfo/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/buildInfo/sample.js index c9b8b2eb49b..c6b9d8cf068 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/buildInfo/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/buildInfo/sample.js @@ -1,4 +1,26 @@ -//// [/src/core/.tsbuildinfo] +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +class someClass { } + +//// [/src/core/tsconfig.tsbuildinfo] { "program": { "fileInfos": { @@ -57,25 +79,3 @@ } } -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); - - -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - diff --git a/tests/baselines/reference/tsbuild/sample1/initial-Build/buildInfo/sample.js b/tests/baselines/reference/tsbuild/sample1/initial-Build/buildInfo/sample.js index 1d4d718b29d..a4606c0f398 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-Build/buildInfo/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-Build/buildInfo/sample.js @@ -1,62 +1,3 @@ -//// [/src/core/.tsbuildinfo] -{ - "program": { - "fileInfos": { - "/lib/lib.d.ts": { - "version": "/lib/lib.d.ts", - "signature": "/lib/lib.d.ts" - }, - "/lib/lib.es5.d.ts": { - "version": "/lib/lib.es5.d.ts", - "signature": "/lib/lib.es5.d.ts" - }, - "/lib/lib.dom.d.ts": { - "version": "/lib/lib.dom.d.ts", - "signature": "/lib/lib.dom.d.ts" - }, - "/lib/lib.webworker.importscripts.d.ts": { - "version": "/lib/lib.webworker.importscripts.d.ts", - "signature": "/lib/lib.webworker.importscripts.d.ts" - }, - "/lib/lib.scripthost.d.ts": { - "version": "/lib/lib.scripthost.d.ts", - "signature": "/lib/lib.scripthost.d.ts" - }, - "/src/core/anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" - }, - "/src/core/index.ts": { - "version": "-18749805970", - "signature": "11051732871" - }, - "/src/core/some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "configFilePath": "/src/core/tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "/lib/lib.d.ts", - "/lib/lib.dom.d.ts", - "/lib/lib.es5.d.ts", - "/lib/lib.scripthost.d.ts", - "/lib/lib.webworker.importscripts.d.ts", - "/src/core/anothermodule.ts", - "/src/core/index.ts", - "/src/core/some_decl.d.ts" - ] - } -} - //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -239,7 +180,7 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/logic/.tsbuildinfo] +//// [/src/core/tsconfig.tsbuildinfo] { "program": { "fileInfos": { @@ -263,38 +204,28 @@ exports.multiply = multiply; "version": "/lib/lib.scripthost.d.ts", "signature": "/lib/lib.scripthost.d.ts" }, - "/src/core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" - }, "/src/core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "version": "-2676574883", + "signature": "25219880154" }, - "/src/logic/index.ts": { - "version": "-5786964698", - "signature": "-6548680073" + "/src/core/index.ts": { + "version": "-18749805970", + "signature": "11051732871" + }, + "/src/core/some_decl.d.ts": { + "version": "-9253692965", + "signature": "-9253692965" } }, "options": { "composite": true, "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, + "declarationMap": true, "skipDefaultLibCheck": true, - "configFilePath": "/src/logic/tsconfig.json" - }, - "referencedMap": { - "/src/logic/index.ts": [ - "/src/core/anothermodule.d.ts", - "/src/core/index.d.ts" - ] - }, - "exportedModulesMap": { - "/src/logic/index.ts": [ - "/src/core/anothermodule.d.ts" - ] + "configFilePath": "/src/core/tsconfig.json" }, + "referencedMap": {}, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "/lib/lib.d.ts", "/lib/lib.dom.d.ts", @@ -303,7 +234,7 @@ exports.multiply = multiply; "/lib/lib.webworker.importscripts.d.ts", "/src/core/anothermodule.ts", "/src/core/index.ts", - "/src/logic/index.ts" + "/src/core/some_decl.d.ts" ] } } @@ -453,7 +384,92 @@ sourceFile:index.ts --- >>>//# sourceMappingURL=index.js.map -//// [/src/tests/.tsbuildinfo] +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "/lib/lib.d.ts": { + "version": "/lib/lib.d.ts", + "signature": "/lib/lib.d.ts" + }, + "/lib/lib.es5.d.ts": { + "version": "/lib/lib.es5.d.ts", + "signature": "/lib/lib.es5.d.ts" + }, + "/lib/lib.dom.d.ts": { + "version": "/lib/lib.dom.d.ts", + "signature": "/lib/lib.dom.d.ts" + }, + "/lib/lib.webworker.importscripts.d.ts": { + "version": "/lib/lib.webworker.importscripts.d.ts", + "signature": "/lib/lib.webworker.importscripts.d.ts" + }, + "/lib/lib.scripthost.d.ts": { + "version": "/lib/lib.scripthost.d.ts", + "signature": "/lib/lib.scripthost.d.ts" + }, + "/src/core/index.ts": { + "version": "-13851440507", + "signature": "-13851440507" + }, + "/src/core/anothermodule.ts": { + "version": "7652028357", + "signature": "7652028357" + }, + "/src/logic/index.ts": { + "version": "-5786964698", + "signature": "-6548680073" + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "/src/logic/tsconfig.json" + }, + "referencedMap": { + "/src/logic/index.ts": [ + "/src/core/anothermodule.d.ts", + "/src/core/index.d.ts" + ] + }, + "exportedModulesMap": { + "/src/logic/index.ts": [ + "/src/core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "/lib/lib.d.ts", + "/lib/lib.dom.d.ts", + "/lib/lib.es5.d.ts", + "/lib/lib.scripthost.d.ts", + "/lib/lib.webworker.importscripts.d.ts", + "/src/core/anothermodule.ts", + "/src/core/index.ts", + "/src/logic/index.ts" + ] + } +} + +//// [/src/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; + + +//// [/src/tests/tsconfig.tsbuildinfo] { "program": { "fileInfos": { @@ -533,19 +549,3 @@ sourceFile:index.ts } } -//// [/src/tests/index.d.ts] -import * as mod from '../core/anotherModule'; -export declare const m: typeof mod; - - -//// [/src/tests/index.js] -"use strict"; -exports.__esModule = true; -var c = require("../core/index"); -var logic = require("../logic/index"); -c.leftPad("", 10); -logic.getSecondsInDay(); -var mod = require("../core/anotherModule"); -exports.m = mod; - - diff --git a/tests/baselines/reference/tsbuild/sample1/initial-Build/buildInfo/when-logic-config-changes-declaration-dir.js b/tests/baselines/reference/tsbuild/sample1/initial-Build/buildInfo/when-logic-config-changes-declaration-dir.js index 1d4d718b29d..a4606c0f398 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-Build/buildInfo/when-logic-config-changes-declaration-dir.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-Build/buildInfo/when-logic-config-changes-declaration-dir.js @@ -1,62 +1,3 @@ -//// [/src/core/.tsbuildinfo] -{ - "program": { - "fileInfos": { - "/lib/lib.d.ts": { - "version": "/lib/lib.d.ts", - "signature": "/lib/lib.d.ts" - }, - "/lib/lib.es5.d.ts": { - "version": "/lib/lib.es5.d.ts", - "signature": "/lib/lib.es5.d.ts" - }, - "/lib/lib.dom.d.ts": { - "version": "/lib/lib.dom.d.ts", - "signature": "/lib/lib.dom.d.ts" - }, - "/lib/lib.webworker.importscripts.d.ts": { - "version": "/lib/lib.webworker.importscripts.d.ts", - "signature": "/lib/lib.webworker.importscripts.d.ts" - }, - "/lib/lib.scripthost.d.ts": { - "version": "/lib/lib.scripthost.d.ts", - "signature": "/lib/lib.scripthost.d.ts" - }, - "/src/core/anothermodule.ts": { - "version": "-2676574883", - "signature": "25219880154" - }, - "/src/core/index.ts": { - "version": "-18749805970", - "signature": "11051732871" - }, - "/src/core/some_decl.d.ts": { - "version": "-9253692965", - "signature": "-9253692965" - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "configFilePath": "/src/core/tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "/lib/lib.d.ts", - "/lib/lib.dom.d.ts", - "/lib/lib.es5.d.ts", - "/lib/lib.scripthost.d.ts", - "/lib/lib.webworker.importscripts.d.ts", - "/src/core/anothermodule.ts", - "/src/core/index.ts", - "/src/core/some_decl.d.ts" - ] - } -} - //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -239,7 +180,7 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/logic/.tsbuildinfo] +//// [/src/core/tsconfig.tsbuildinfo] { "program": { "fileInfos": { @@ -263,38 +204,28 @@ exports.multiply = multiply; "version": "/lib/lib.scripthost.d.ts", "signature": "/lib/lib.scripthost.d.ts" }, - "/src/core/index.ts": { - "version": "-13851440507", - "signature": "-13851440507" - }, "/src/core/anothermodule.ts": { - "version": "7652028357", - "signature": "7652028357" + "version": "-2676574883", + "signature": "25219880154" }, - "/src/logic/index.ts": { - "version": "-5786964698", - "signature": "-6548680073" + "/src/core/index.ts": { + "version": "-18749805970", + "signature": "11051732871" + }, + "/src/core/some_decl.d.ts": { + "version": "-9253692965", + "signature": "-9253692965" } }, "options": { "composite": true, "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, + "declarationMap": true, "skipDefaultLibCheck": true, - "configFilePath": "/src/logic/tsconfig.json" - }, - "referencedMap": { - "/src/logic/index.ts": [ - "/src/core/anothermodule.d.ts", - "/src/core/index.d.ts" - ] - }, - "exportedModulesMap": { - "/src/logic/index.ts": [ - "/src/core/anothermodule.d.ts" - ] + "configFilePath": "/src/core/tsconfig.json" }, + "referencedMap": {}, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "/lib/lib.d.ts", "/lib/lib.dom.d.ts", @@ -303,7 +234,7 @@ exports.multiply = multiply; "/lib/lib.webworker.importscripts.d.ts", "/src/core/anothermodule.ts", "/src/core/index.ts", - "/src/logic/index.ts" + "/src/core/some_decl.d.ts" ] } } @@ -453,7 +384,92 @@ sourceFile:index.ts --- >>>//# sourceMappingURL=index.js.map -//// [/src/tests/.tsbuildinfo] +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "/lib/lib.d.ts": { + "version": "/lib/lib.d.ts", + "signature": "/lib/lib.d.ts" + }, + "/lib/lib.es5.d.ts": { + "version": "/lib/lib.es5.d.ts", + "signature": "/lib/lib.es5.d.ts" + }, + "/lib/lib.dom.d.ts": { + "version": "/lib/lib.dom.d.ts", + "signature": "/lib/lib.dom.d.ts" + }, + "/lib/lib.webworker.importscripts.d.ts": { + "version": "/lib/lib.webworker.importscripts.d.ts", + "signature": "/lib/lib.webworker.importscripts.d.ts" + }, + "/lib/lib.scripthost.d.ts": { + "version": "/lib/lib.scripthost.d.ts", + "signature": "/lib/lib.scripthost.d.ts" + }, + "/src/core/index.ts": { + "version": "-13851440507", + "signature": "-13851440507" + }, + "/src/core/anothermodule.ts": { + "version": "7652028357", + "signature": "7652028357" + }, + "/src/logic/index.ts": { + "version": "-5786964698", + "signature": "-6548680073" + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "/src/logic/tsconfig.json" + }, + "referencedMap": { + "/src/logic/index.ts": [ + "/src/core/anothermodule.d.ts", + "/src/core/index.d.ts" + ] + }, + "exportedModulesMap": { + "/src/logic/index.ts": [ + "/src/core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "/lib/lib.d.ts", + "/lib/lib.dom.d.ts", + "/lib/lib.es5.d.ts", + "/lib/lib.scripthost.d.ts", + "/lib/lib.webworker.importscripts.d.ts", + "/src/core/anothermodule.ts", + "/src/core/index.ts", + "/src/logic/index.ts" + ] + } +} + +//// [/src/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; + + +//// [/src/tests/tsconfig.tsbuildinfo] { "program": { "fileInfos": { @@ -533,19 +549,3 @@ sourceFile:index.ts } } -//// [/src/tests/index.d.ts] -import * as mod from '../core/anotherModule'; -export declare const m: typeof mod; - - -//// [/src/tests/index.js] -"use strict"; -exports.__esModule = true; -var c = require("../core/index"); -var logic = require("../logic/index"); -c.leftPad("", 10); -logic.getSecondsInDay(); -var mod = require("../core/anotherModule"); -exports.m = mod; - -