diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4f8a1e0253a91..9d241c680b82a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4299,6 +4299,7 @@ namespace ts { getProjectReferenceRedirect: fileName => host.getProjectReferenceRedirect(fileName), isSourceOfProjectReferenceRedirect: fileName => host.isSourceOfProjectReferenceRedirect(fileName), fileExists: fileName => host.fileExists(fileName), + getCompilerOptions: () => host.getCompilerOptions() } : undefined }, encounteredError: false, visitedTypes: undefined, @@ -5933,7 +5934,8 @@ namespace ts { const resolverHost = { getCanonicalFileName, getCurrentDirectory: () => context.tracker.moduleResolverHost!.getCurrentDirectory(), - getCommonSourceDirectory: () => context.tracker.moduleResolverHost!.getCommonSourceDirectory() + getCommonSourceDirectory: () => context.tracker.moduleResolverHost!.getCommonSourceDirectory(), + getCompilerOptions: () => context.tracker.moduleResolverHost!.getCompilerOptions() }; const newName = getResolvedExternalModuleName(resolverHost, targetFile); return factory.createStringLiteral(newName); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index fd0c64fb515f9..739da04398e3e 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1002,6 +1002,14 @@ namespace ts { category: Diagnostics.Advanced_Options, description: Diagnostics.Emit_class_fields_with_Define_instead_of_Set, }, + { + name: "bundledPackageName", + type: "string", + affectsEmit: true, + category: Diagnostics.Advanced_Options, + description: Diagnostics.Provides_a_root_package_name_when_using_outFile_with_declarations, + }, + { name: "keyofStringsOnly", type: "boolean", diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a2ec4587817d8..e044440e002ac 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1184,7 +1184,14 @@ "category": "Error", "code": 1389 }, - + "Provides a root package name when using outFile with declarations.": { + "category": "Message", + "code": 1390 + }, + "The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit.": { + "category": "Error", + "code": 1391 + }, "The types of '{0}' are incompatible between these types.": { "category": "Error", "code": 2200 diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index 680a30171a551..477e2b960d915 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -157,7 +157,7 @@ namespace ts.moduleSpecifiers { } function getLocalModuleSpecifier(moduleFileName: string, { getCanonicalFileName, sourceDirectory }: Info, compilerOptions: CompilerOptions, { ending, relativePreference }: Preferences): string { - const { baseUrl, paths, rootDirs } = compilerOptions; + const { baseUrl, paths, rootDirs, bundledPackageName } = compilerOptions; const relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions); @@ -170,8 +170,9 @@ namespace ts.moduleSpecifiers { return relativePath; } - const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions); - const fromPaths = paths && tryGetModuleNameFromPaths(removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); + const bundledPkgReference = bundledPackageName ? combinePaths(bundledPackageName, relativeToBaseUrl) : relativeToBaseUrl; + const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(bundledPkgReference, ending, compilerOptions); + const fromPaths = paths && tryGetModuleNameFromPaths(removeFileExtension(bundledPkgReference), importRelativeToBaseUrl, paths); const nonRelative = fromPaths === undefined ? importRelativeToBaseUrl : fromPaths; if (relativePreference === RelativePreference.NonRelative) { @@ -278,7 +279,7 @@ namespace ts.moduleSpecifiers { const isInNodeModules = pathContainsNodeModules(path); allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect, isInNodeModules }); importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; - // dont return value, so we collect everything + // don't return value, so we collect everything } ); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index d65b448a0952c..0255067fcb827 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -3139,6 +3139,11 @@ namespace ts { } } + // Without a package name, for multiple files being bundled into a .d.ts file you basically get a file which doesn't wrk + if (outputFile && getEmitDeclarations(options) && getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeJs && !options.bundledPackageName) { + createDiagnosticForOptionName(Diagnostics.The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit, options.out ? "out" : "outFile"); + } + if (options.resolveJsonModule) { if (getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeJs) { createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule"); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 14f5509f81fb0..51665756232a5 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5723,6 +5723,7 @@ namespace ts { /** An error if set - this should only go through the -b pipeline and not actually be observed */ /*@internal*/ build?: boolean; + bundledPackageName?: string; charset?: string; checkJs?: boolean; /* @internal */ configFilePath?: string; @@ -7843,6 +7844,7 @@ namespace ts { readonly redirectTargetsMap: RedirectTargetsMap; getProjectReferenceRedirect(fileName: string): string | undefined; isSourceOfProjectReferenceRedirect(fileName: string): boolean; + getCompilerOptions(): CompilerOptions; } // Note: this used to be deprecated in our public API, but is still used internally diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index c260619e0f32c..347ef95fafbb5 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4021,6 +4021,7 @@ namespace ts { getCanonicalFileName(p: string): string; getCommonSourceDirectory(): string; getCurrentDirectory(): string; + getCompilerOptions(): CompilerOptions; } export function getResolvedExternalModuleName(host: ResolveModuleNameResolutionHost, file: SourceFile, referenceFile?: SourceFile): string { @@ -4044,7 +4045,16 @@ namespace ts { const filePath = getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); const relativePath = getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); const extensionless = removeFileExtension(relativePath); - return referencePath ? ensurePathIsNonModuleName(extensionless) : extensionless; + if (referencePath) { + return ensurePathIsNonModuleName(extensionless); + } + const options = host.getCompilerOptions(); + const rootPkgName = options.bundledPackageName || ""; + const newPath = combinePaths(rootPkgName, extensionless); + if (rootPkgName && getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeJs && endsWith(newPath, "/index")) { + return newPath.slice(0, newPath.length - "/index".length); + } + return newPath; } export function getOwnEmitOutputFilePath(fileName: string, host: EmitHost, extension: string) { diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 70ccbb36b92c4..2e11835a3304c 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../tsconfig-base", "compilerOptions": { "outFile": "../../built/local/harness.js", + "moduleResolution": "node", "types": [ "node", "mocha", "chai" ], diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 7bfb55e8ce876..0a2572f4d79a9 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1773,6 +1773,7 @@ namespace ts { redirectTargetsMap: program.redirectTargetsMap, getProjectReferenceRedirect: fileName => program.getProjectReferenceRedirect(fileName), isSourceOfProjectReferenceRedirect: fileName => program.isSourceOfProjectReferenceRedirect(fileName), + getCompilerOptions: () => program.getCompilerOptions() }; } diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 7c07d226c077e..7ed0718f67ffc 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../tsconfig-noncomposite-base", "compilerOptions": { "outFile": "../../built/local/run.js", + "moduleResolution": "node", "composite": false, "declaration": false, "declarationMap": false, diff --git a/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts b/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts index 450da2cd14f92..058e5c0efb4fc 100644 --- a/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts +++ b/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts @@ -104,7 +104,8 @@ namespace ts { "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "common.js" + "outFile": "common.js", + "bundledPackageName": "common" }, "include": ["nominal.js"] }`, @@ -119,7 +120,8 @@ namespace ts { "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "sub-project.js" + "outFile": "sub-project.js", + "bundledPackageName": "sub" }, "references": [ { "path": "../common", "prepend": true } @@ -143,7 +145,8 @@ namespace ts { "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "sub-project-2.js" + "outFile": "sub-project-2.js", + "bundledPackageName": "sub-2" }, "references": [ { "path": "../sub-project", "prepend": true } diff --git a/src/testRunner/unittests/tsbuild/outFile.ts b/src/testRunner/unittests/tsbuild/outFile.ts index e1da4118599ec..1f6685c873e2b 100644 --- a/src/testRunner/unittests/tsbuild/outFile.ts +++ b/src/testRunner/unittests/tsbuild/outFile.ts @@ -658,7 +658,8 @@ ${internal} enum internalEnum { a, b, c }`); declarationMap: true, skipDefaultLibCheck: true, sourceMap: true, - outFile: "./bin/first-output.js" + outFile: "./bin/first-output.js", + bundledPackageName: "first" }, files: [sources[Project.first][Source.ts][Part.one]] })); @@ -669,7 +670,8 @@ ${internal} enum internalEnum { a, b, c }`); declarationMap: false, stripInternal: true, sourceMap: true, - outFile: "./thirdjs/output/third-output.js" + outFile: "./thirdjs/output/third-output.js", + bundledPackageName: "third" }, references: [{ path: "../first", prepend: true }], files: [sources[Project.third][Source.ts][Part.one]] diff --git a/src/testRunner/unittests/tsbuild/watchMode.ts b/src/testRunner/unittests/tsbuild/watchMode.ts index e04950cc42dea..a0442229ba817 100644 --- a/src/testRunner/unittests/tsbuild/watchMode.ts +++ b/src/testRunner/unittests/tsbuild/watchMode.ts @@ -326,13 +326,13 @@ export class someClass2 { }`), const coreTsConfig: File = { path: core[0].path, content: JSON.stringify({ - compilerOptions: { composite: true, declaration: true, outFile: "index.js" } + compilerOptions: { composite: true, declaration: true, outFile: "index.js", bundledPackageName: "core" } }) }; const logicTsConfig: File = { path: logic[0].path, content: JSON.stringify({ - compilerOptions: { composite: true, declaration: true, outFile: "index.js" }, + compilerOptions: { composite: true, declaration: true, outFile: "index.js", bundledPackageName: "logic" }, references: [{ path: "../core", prepend: true }] }) }; diff --git a/src/testRunner/unittests/tsserver/projectReferenceErrors.ts b/src/testRunner/unittests/tsserver/projectReferenceErrors.ts index 432cd81098128..371e0720eb767 100644 --- a/src/testRunner/unittests/tsserver/projectReferenceErrors.ts +++ b/src/testRunner/unittests/tsserver/projectReferenceErrors.ts @@ -193,7 +193,7 @@ let x: string = 10;` }; const dependencyConfig: File = { path: `${dependecyLocation}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { composite: true, outFile: "../dependency.js" } }) + content: JSON.stringify({ compilerOptions: { composite: true, outFile: "../dependency.js", bundledPackageName: "dep" } }) }; const usageTs: File = { path: `${usageLocation}/usage.ts`, @@ -205,7 +205,7 @@ fnErr(); const usageConfig: File = { path: `${usageLocation}/tsconfig.json`, content: JSON.stringify({ - compilerOptions: { composite: true, outFile: "../usage.js" }, + compilerOptions: { composite: true, outFile: "../usage.js", bundledPackageName: "usage" }, references: [{ path: "../dependency" }] }) }; diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index c1081ed18263f..b0515e0a023d6 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -3,6 +3,7 @@ "pretty": true, "lib": ["es2015.iterable", "es2015.generator", "es5"], "target": "es5", + "moduleResolution": "classic", "rootDir": ".", "declaration": true, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 145be9d0db39c..b82c6fca3a471 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2795,6 +2795,7 @@ declare namespace ts { allowUnusedLabels?: boolean; alwaysStrict?: boolean; baseUrl?: string; + bundledPackageName?: string; charset?: string; checkJs?: boolean; declaration?: boolean; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index ff03936881da3..9a088619c9d58 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2795,6 +2795,7 @@ declare namespace ts { allowUnusedLabels?: boolean; alwaysStrict?: boolean; baseUrl?: string; + bundledPackageName?: string; charset?: string; checkJs?: boolean; declaration?: boolean; diff --git a/tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt b/tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt new file mode 100644 index 0000000000000..4f96a9965ae4b --- /dev/null +++ b/tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt @@ -0,0 +1,30 @@ +error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. + + +!!! error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. +==== tests/cases/compiler/index.ts (0 errors) ==== + export * from "./nested"; + +==== tests/cases/compiler/nested/base.ts (0 errors) ==== + import { B } from "./shared"; + + export function f() { + return new B(); + } + +==== tests/cases/compiler/nested/derived.ts (0 errors) ==== + import { f } from "./base"; + + export function g() { + return f(); + } + +==== tests/cases/compiler/nested/index.ts (0 errors) ==== + export * from "./base"; + + export * from "./derived"; + export * from "./shared"; + +==== tests/cases/compiler/nested/shared.ts (0 errors) ==== + export class B {} + \ No newline at end of file diff --git a/tests/baselines/reference/bundledDtsLateExportRenaming.js b/tests/baselines/reference/bundledDtsLateExportRenaming.js new file mode 100644 index 0000000000000..52b642b655e1f --- /dev/null +++ b/tests/baselines/reference/bundledDtsLateExportRenaming.js @@ -0,0 +1,51 @@ +//// [tests/cases/compiler/bundledDtsLateExportRenaming.ts] //// + +//// [index.ts] +export * from "./nested"; + +//// [base.ts] +import { B } from "./shared"; + +export function f() { + return new B(); +} + +//// [derived.ts] +import { f } from "./base"; + +export function g() { + return f(); +} + +//// [index.ts] +export * from "./base"; + +export * from "./derived"; +export * from "./shared"; + +//// [shared.ts] +export class B {} + + + + +//// [out.d.ts] +declare module "nested/shared" { + export class B { + } +} +declare module "nested/base" { + import { B } from "nested/shared"; + export function f(): B; +} +declare module "nested/derived" { + export function g(): import("nested").B; +} +declare module "nested/index" { + export * from "nested/base"; + export * from "nested/derived"; + export * from "nested/shared"; +} +declare module "index" { + export * from "nested/index"; +} diff --git a/tests/baselines/reference/bundledDtsLateExportRenaming.symbols b/tests/baselines/reference/bundledDtsLateExportRenaming.symbols new file mode 100644 index 0000000000000..990b6ebebf7e3 --- /dev/null +++ b/tests/baselines/reference/bundledDtsLateExportRenaming.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/index.ts === +export * from "./nested"; +No type information for this code. +No type information for this code.=== tests/cases/compiler/nested/base.ts === +import { B } from "./shared"; +>B : Symbol(B, Decl(base.ts, 0, 8)) + +export function f() { +>f : Symbol(f, Decl(base.ts, 0, 29)) + + return new B(); +>B : Symbol(B, Decl(base.ts, 0, 8)) +} + +=== tests/cases/compiler/nested/derived.ts === +import { f } from "./base"; +>f : Symbol(f, Decl(derived.ts, 0, 8)) + +export function g() { +>g : Symbol(g, Decl(derived.ts, 0, 27)) + + return f(); +>f : Symbol(f, Decl(derived.ts, 0, 8)) +} + +=== tests/cases/compiler/nested/index.ts === +export * from "./base"; +No type information for this code. +No type information for this code.export * from "./derived"; +No type information for this code.export * from "./shared"; +No type information for this code. +No type information for this code.=== tests/cases/compiler/nested/shared.ts === +export class B {} +>B : Symbol(B, Decl(shared.ts, 0, 0)) + diff --git a/tests/baselines/reference/bundledDtsLateExportRenaming.types b/tests/baselines/reference/bundledDtsLateExportRenaming.types new file mode 100644 index 0000000000000..eacdf1823671f --- /dev/null +++ b/tests/baselines/reference/bundledDtsLateExportRenaming.types @@ -0,0 +1,37 @@ +=== tests/cases/compiler/index.ts === +export * from "./nested"; +No type information for this code. +No type information for this code.=== tests/cases/compiler/nested/base.ts === +import { B } from "./shared"; +>B : typeof B + +export function f() { +>f : () => B + + return new B(); +>new B() : B +>B : typeof B +} + +=== tests/cases/compiler/nested/derived.ts === +import { f } from "./base"; +>f : () => import("tests/cases/compiler/index").B + +export function g() { +>g : () => import("tests/cases/compiler/index").B + + return f(); +>f() : import("tests/cases/compiler/index").B +>f : () => import("tests/cases/compiler/index").B +} + +=== tests/cases/compiler/nested/index.ts === +export * from "./base"; +No type information for this code. +No type information for this code.export * from "./derived"; +No type information for this code.export * from "./shared"; +No type information for this code. +No type information for this code.=== tests/cases/compiler/nested/shared.ts === +export class B {} +>B : B + diff --git a/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.errors.txt b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.errors.txt new file mode 100644 index 0000000000000..33c7b6a659d42 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.errors.txt @@ -0,0 +1,29 @@ +error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. + + +!!! error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. +==== tests/cases/conformance/declarationEmit/index.ts (0 errors) ==== + export * from "./nested"; + +==== tests/cases/conformance/declarationEmit/nested/base.ts (0 errors) ==== + import { B } from "./shared"; + + export function f() { + return new B(); + } + +==== tests/cases/conformance/declarationEmit/nested/derived.ts (0 errors) ==== + import { f } from "./base"; + + export function g() { + return f(); + } + +==== tests/cases/conformance/declarationEmit/nested/index.ts (0 errors) ==== + export * from "./base"; + export * from "./derived"; + export * from "./shared"; + +==== tests/cases/conformance/declarationEmit/nested/shared.ts (0 errors) ==== + export class B {} + \ No newline at end of file diff --git a/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.js b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.js new file mode 100644 index 0000000000000..8a778916492b8 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.js @@ -0,0 +1,50 @@ +//// [tests/cases/conformance/declarationEmit/bundledNodeDTSFailsWithOutFlag.ts] //// + +//// [index.ts] +export * from "./nested"; + +//// [base.ts] +import { B } from "./shared"; + +export function f() { + return new B(); +} + +//// [derived.ts] +import { f } from "./base"; + +export function g() { + return f(); +} + +//// [index.ts] +export * from "./base"; +export * from "./derived"; +export * from "./shared"; + +//// [shared.ts] +export class B {} + + + + +//// [out.d.ts] +declare module "nested/shared" { + export class B { + } +} +declare module "nested/base" { + import { B } from "nested/shared"; + export function f(): B; +} +declare module "nested/derived" { + export function g(): import("nested").B; +} +declare module "nested/index" { + export * from "nested/base"; + export * from "nested/derived"; + export * from "nested/shared"; +} +declare module "index" { + export * from "nested/index"; +} diff --git a/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.symbols b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.symbols new file mode 100644 index 0000000000000..b4cce9a0da3f7 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/declarationEmit/index.ts === +export * from "./nested"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/base.ts === +import { B } from "./shared"; +>B : Symbol(B, Decl(base.ts, 0, 8)) + +export function f() { +>f : Symbol(f, Decl(base.ts, 0, 29)) + + return new B(); +>B : Symbol(B, Decl(base.ts, 0, 8)) +} + +=== tests/cases/conformance/declarationEmit/nested/derived.ts === +import { f } from "./base"; +>f : Symbol(f, Decl(derived.ts, 0, 8)) + +export function g() { +>g : Symbol(g, Decl(derived.ts, 0, 27)) + + return f(); +>f : Symbol(f, Decl(derived.ts, 0, 8)) +} + +=== tests/cases/conformance/declarationEmit/nested/index.ts === +export * from "./base"; +No type information for this code.export * from "./derived"; +No type information for this code.export * from "./shared"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/shared.ts === +export class B {} +>B : Symbol(B, Decl(shared.ts, 0, 0)) + diff --git a/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.types b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.types new file mode 100644 index 0000000000000..d9f39036baff5 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/declarationEmit/index.ts === +export * from "./nested"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/base.ts === +import { B } from "./shared"; +>B : typeof B + +export function f() { +>f : () => B + + return new B(); +>new B() : B +>B : typeof B +} + +=== tests/cases/conformance/declarationEmit/nested/derived.ts === +import { f } from "./base"; +>f : () => import("tests/cases/conformance/declarationEmit/index").B + +export function g() { +>g : () => import("tests/cases/conformance/declarationEmit/index").B + + return f(); +>f() : import("tests/cases/conformance/declarationEmit/index").B +>f : () => import("tests/cases/conformance/declarationEmit/index").B +} + +=== tests/cases/conformance/declarationEmit/nested/index.ts === +export * from "./base"; +No type information for this code.export * from "./derived"; +No type information for this code.export * from "./shared"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/shared.ts === +export class B {} +>B : B + diff --git a/tests/baselines/reference/bundledNodeDTSPassesWithFlag.js b/tests/baselines/reference/bundledNodeDTSPassesWithFlag.js new file mode 100644 index 0000000000000..d671430a28072 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSPassesWithFlag.js @@ -0,0 +1,50 @@ +//// [tests/cases/conformance/declarationEmit/bundledNodeDTSPassesWithFlag.ts] //// + +//// [index.ts] +export * from "./nested"; + +//// [base.ts] +import { B } from "./shared"; + +export function f() { + return new B(); +} + +//// [derived.ts] +import { f } from "./base"; + +export function g() { + return f(); +} + +//// [index.ts] +export * from "./base"; +export * from "./derived"; +export * from "./shared"; + +//// [shared.ts] +export class B {} + + + + +//// [out.d.ts] +declare module "my-pkg/nested/shared" { + export class B { + } +} +declare module "my-pkg/nested/base" { + import { B } from "my-pkg/nested/shared"; + export function f(): B; +} +declare module "my-pkg/nested/derived" { + export function g(): import("my-pkg").B; +} +declare module "my-pkg/nested" { + export * from "my-pkg/nested/base"; + export * from "my-pkg/nested/derived"; + export * from "my-pkg/nested/shared"; +} +declare module "my-pkg" { + export * from "my-pkg/nested"; +} diff --git a/tests/baselines/reference/bundledNodeDTSPassesWithFlag.symbols b/tests/baselines/reference/bundledNodeDTSPassesWithFlag.symbols new file mode 100644 index 0000000000000..b4cce9a0da3f7 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSPassesWithFlag.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/declarationEmit/index.ts === +export * from "./nested"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/base.ts === +import { B } from "./shared"; +>B : Symbol(B, Decl(base.ts, 0, 8)) + +export function f() { +>f : Symbol(f, Decl(base.ts, 0, 29)) + + return new B(); +>B : Symbol(B, Decl(base.ts, 0, 8)) +} + +=== tests/cases/conformance/declarationEmit/nested/derived.ts === +import { f } from "./base"; +>f : Symbol(f, Decl(derived.ts, 0, 8)) + +export function g() { +>g : Symbol(g, Decl(derived.ts, 0, 27)) + + return f(); +>f : Symbol(f, Decl(derived.ts, 0, 8)) +} + +=== tests/cases/conformance/declarationEmit/nested/index.ts === +export * from "./base"; +No type information for this code.export * from "./derived"; +No type information for this code.export * from "./shared"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/shared.ts === +export class B {} +>B : Symbol(B, Decl(shared.ts, 0, 0)) + diff --git a/tests/baselines/reference/bundledNodeDTSPassesWithFlag.types b/tests/baselines/reference/bundledNodeDTSPassesWithFlag.types new file mode 100644 index 0000000000000..d9f39036baff5 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSPassesWithFlag.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/declarationEmit/index.ts === +export * from "./nested"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/base.ts === +import { B } from "./shared"; +>B : typeof B + +export function f() { +>f : () => B + + return new B(); +>new B() : B +>B : typeof B +} + +=== tests/cases/conformance/declarationEmit/nested/derived.ts === +import { f } from "./base"; +>f : () => import("tests/cases/conformance/declarationEmit/index").B + +export function g() { +>g : () => import("tests/cases/conformance/declarationEmit/index").B + + return f(); +>f() : import("tests/cases/conformance/declarationEmit/index").B +>f : () => import("tests/cases/conformance/declarationEmit/index").B +} + +=== tests/cases/conformance/declarationEmit/nested/index.ts === +export * from "./base"; +No type information for this code.export * from "./derived"; +No type information for this code.export * from "./shared"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/shared.ts === +export class B {} +>B : B + diff --git a/tests/baselines/reference/bundledNodeDTSWithExports.js b/tests/baselines/reference/bundledNodeDTSWithExports.js new file mode 100644 index 0000000000000..69dc79e917da5 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSWithExports.js @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/declarationEmit/bundledNodeDTSWithExports.ts] //// + +//// [index.ts] +export {} + +//// [base.ts] +import { C } from "./"; + +export function f() { + return new C(); +} + +//// [derived.ts] +import { f } from "./base"; + +export function g() { + return f(); +} + +//// [index.ts] +export * from "./base"; +export * from "./derived"; +export class C {} + + + + +//// [out.d.ts] +declare module "my-pkg" { + export {}; +} +declare module "my-pkg/nested/derived" { + export function g(): import("my-pkg/nested").C; +} +declare module "my-pkg/nested" { + export * from "my-pkg/nested/base"; + export * from "my-pkg/nested/derived"; + export class C { + } +} +declare module "my-pkg/nested/base" { + import { C } from "my-pkg/nested"; + export function f(): C; +} diff --git a/tests/baselines/reference/bundledNodeDTSWithExports.symbols b/tests/baselines/reference/bundledNodeDTSWithExports.symbols new file mode 100644 index 0000000000000..29721558317ee --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSWithExports.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/declarationEmit/index.ts === +export {} +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/base.ts === +import { C } from "./"; +>C : Symbol(C, Decl(base.ts, 0, 8)) + +export function f() { +>f : Symbol(f, Decl(base.ts, 0, 23)) + + return new C(); +>C : Symbol(C, Decl(base.ts, 0, 8)) +} + +=== tests/cases/conformance/declarationEmit/nested/derived.ts === +import { f } from "./base"; +>f : Symbol(f, Decl(derived.ts, 0, 8)) + +export function g() { +>g : Symbol(g, Decl(derived.ts, 0, 27)) + + return f(); +>f : Symbol(f, Decl(derived.ts, 0, 8)) +} + +=== tests/cases/conformance/declarationEmit/nested/index.ts === +export * from "./base"; +export * from "./derived"; +export class C {} +>C : Symbol(C, Decl(index.ts, 1, 26)) + diff --git a/tests/baselines/reference/bundledNodeDTSWithExports.types b/tests/baselines/reference/bundledNodeDTSWithExports.types new file mode 100644 index 0000000000000..8442637f11fc7 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSWithExports.types @@ -0,0 +1,33 @@ +=== tests/cases/conformance/declarationEmit/index.ts === +export {} +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/base.ts === +import { C } from "./"; +>C : typeof C + +export function f() { +>f : () => C + + return new C(); +>new C() : C +>C : typeof C +} + +=== tests/cases/conformance/declarationEmit/nested/derived.ts === +import { f } from "./base"; +>f : () => import("tests/cases/conformance/declarationEmit/nested/index").C + +export function g() { +>g : () => import("tests/cases/conformance/declarationEmit/nested/index").C + + return f(); +>f() : import("tests/cases/conformance/declarationEmit/nested/index").C +>f : () => import("tests/cases/conformance/declarationEmit/nested/index").C +} + +=== tests/cases/conformance/declarationEmit/nested/index.ts === +export * from "./base"; +export * from "./derived"; +export class C {} +>C : C + diff --git a/tests/baselines/reference/bundledNodeDTSWithScopedPackage.js b/tests/baselines/reference/bundledNodeDTSWithScopedPackage.js new file mode 100644 index 0000000000000..7feb7b4f8051c --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSWithScopedPackage.js @@ -0,0 +1,50 @@ +//// [tests/cases/conformance/declarationEmit/bundledNodeDTSWithScopedPackage.ts] //// + +//// [index.ts] +export * from "./nested"; + +//// [base.ts] +import { B } from "./shared"; + +export function f() { + return new B(); +} + +//// [derived.ts] +import { f } from "./base"; + +export function g() { + return f(); +} + +//// [index.ts] +export * from "./base"; +export * from "./derived"; +export * from "./shared"; + +//// [shared.ts] +export class B {} + + + + +//// [out.d.ts] +declare module "@test/my-pkg/nested/shared" { + export class B { + } +} +declare module "@test/my-pkg/nested/base" { + import { B } from "@test/my-pkg/nested/shared"; + export function f(): B; +} +declare module "@test/my-pkg/nested/derived" { + export function g(): import("@test/my-pkg").B; +} +declare module "@test/my-pkg/nested" { + export * from "@test/my-pkg/nested/base"; + export * from "@test/my-pkg/nested/derived"; + export * from "@test/my-pkg/nested/shared"; +} +declare module "@test/my-pkg" { + export * from "@test/my-pkg/nested"; +} diff --git a/tests/baselines/reference/bundledNodeDTSWithScopedPackage.symbols b/tests/baselines/reference/bundledNodeDTSWithScopedPackage.symbols new file mode 100644 index 0000000000000..b4cce9a0da3f7 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSWithScopedPackage.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/declarationEmit/index.ts === +export * from "./nested"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/base.ts === +import { B } from "./shared"; +>B : Symbol(B, Decl(base.ts, 0, 8)) + +export function f() { +>f : Symbol(f, Decl(base.ts, 0, 29)) + + return new B(); +>B : Symbol(B, Decl(base.ts, 0, 8)) +} + +=== tests/cases/conformance/declarationEmit/nested/derived.ts === +import { f } from "./base"; +>f : Symbol(f, Decl(derived.ts, 0, 8)) + +export function g() { +>g : Symbol(g, Decl(derived.ts, 0, 27)) + + return f(); +>f : Symbol(f, Decl(derived.ts, 0, 8)) +} + +=== tests/cases/conformance/declarationEmit/nested/index.ts === +export * from "./base"; +No type information for this code.export * from "./derived"; +No type information for this code.export * from "./shared"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/shared.ts === +export class B {} +>B : Symbol(B, Decl(shared.ts, 0, 0)) + diff --git a/tests/baselines/reference/bundledNodeDTSWithScopedPackage.types b/tests/baselines/reference/bundledNodeDTSWithScopedPackage.types new file mode 100644 index 0000000000000..d9f39036baff5 --- /dev/null +++ b/tests/baselines/reference/bundledNodeDTSWithScopedPackage.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/declarationEmit/index.ts === +export * from "./nested"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/base.ts === +import { B } from "./shared"; +>B : typeof B + +export function f() { +>f : () => B + + return new B(); +>new B() : B +>B : typeof B +} + +=== tests/cases/conformance/declarationEmit/nested/derived.ts === +import { f } from "./base"; +>f : () => import("tests/cases/conformance/declarationEmit/index").B + +export function g() { +>g : () => import("tests/cases/conformance/declarationEmit/index").B + + return f(); +>f() : import("tests/cases/conformance/declarationEmit/index").B +>f : () => import("tests/cases/conformance/declarationEmit/index").B +} + +=== tests/cases/conformance/declarationEmit/nested/index.ts === +export * from "./base"; +No type information for this code.export * from "./derived"; +No type information for this code.export * from "./shared"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/declarationEmit/nested/shared.ts === +export class B {} +>B : B + diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt index 3e43a21f51dbc..d58378fa9b0d8 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt @@ -10,4 +10,5 @@ error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would ==== tests/cases/compiler/a.ts (0 errors) ==== class d { - } \ No newline at end of file + } + \ No newline at end of file diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js index fda8b290e8268..1400e371c75ef 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.js @@ -6,7 +6,8 @@ declare class c { //// [a.ts] class d { -} +} + //// [out.js] var d = /** @class */ (function () { diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.symbols b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.symbols index d4dd460df9fed..31607388f7b9e 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.symbols +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.symbols @@ -7,3 +7,4 @@ declare class c { class d { >d : Symbol(d, Decl(a.ts, 0, 0)) } + diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.types b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.types index aa64be40dbe12..431781bbca42c 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.types +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.types @@ -7,3 +7,4 @@ declare class c { class d { >d : d } + diff --git a/tests/baselines/reference/declarationFilesGeneratingTypeReferences.js b/tests/baselines/reference/declarationFilesGeneratingTypeReferences.js index f928b06466771..bbcd9f7f69b36 100644 --- a/tests/baselines/reference/declarationFilesGeneratingTypeReferences.js +++ b/tests/baselines/reference/declarationFilesGeneratingTypeReferences.js @@ -9,7 +9,8 @@ interface JQuery { /// namespace Test { export var x: JQuery; -} +} + //// [out.js] /// diff --git a/tests/baselines/reference/declarationFilesGeneratingTypeReferences.symbols b/tests/baselines/reference/declarationFilesGeneratingTypeReferences.symbols index 28ae63fa4a90d..83692e9ef6aae 100644 --- a/tests/baselines/reference/declarationFilesGeneratingTypeReferences.symbols +++ b/tests/baselines/reference/declarationFilesGeneratingTypeReferences.symbols @@ -13,3 +13,4 @@ namespace Test { >x : Symbol(x, Decl(app.ts, 2, 14)) >JQuery : Symbol(JQuery, Decl(index.d.ts, 0, 0)) } + diff --git a/tests/baselines/reference/declarationFilesGeneratingTypeReferences.types b/tests/baselines/reference/declarationFilesGeneratingTypeReferences.types index eadf3b93faa89..0c31c9dac292b 100644 --- a/tests/baselines/reference/declarationFilesGeneratingTypeReferences.types +++ b/tests/baselines/reference/declarationFilesGeneratingTypeReferences.types @@ -11,3 +11,4 @@ namespace Test { export var x: JQuery; >x : JQuery } + diff --git a/tests/baselines/reference/declarationMapsOutFile.js b/tests/baselines/reference/declarationMapsOutFile.js index 47fb58fb98f93..fae211af71588 100644 --- a/tests/baselines/reference/declarationMapsOutFile.js +++ b/tests/baselines/reference/declarationMapsOutFile.js @@ -20,7 +20,7 @@ export { c, Foo }; //// [bundle.js] -define("a", ["require", "exports"], function (require, exports) { +define("example/a", ["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; exports.Foo = void 0; @@ -37,7 +37,7 @@ define("a", ["require", "exports"], function (require, exports) { }()); exports.Foo = Foo; }); -define("index", ["require", "exports", "a"], function (require, exports, a_1) { +define("example/index", ["require", "exports", "example/a"], function (require, exports, a_1) { "use strict"; exports.__esModule = true; exports.Foo = exports.c = exports.x = void 0; @@ -50,7 +50,7 @@ define("index", ["require", "exports", "a"], function (require, exports, a_1) { //// [bundle.d.ts] -declare module "a" { +declare module "example/a" { export class Foo { doThing(x: { a: number; @@ -60,8 +60,8 @@ declare module "a" { static make(): Foo; } } -declare module "index" { - import { Foo } from "a"; +declare module "example/index" { + import { Foo } from "example/a"; const c: Foo; export let x: { b: number; diff --git a/tests/baselines/reference/declarationMapsOutFile.js.map b/tests/baselines/reference/declarationMapsOutFile.js.map index 31ad85d665052..1bea630c38a7c 100644 --- a/tests/baselines/reference/declarationMapsOutFile.js.map +++ b/tests/baselines/reference/declarationMapsOutFile.js.map @@ -1,3 +1,3 @@ //// [bundle.d.ts.map] -{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/index.ts"],"names":[],"mappings":";IAAA,MAAM,OAAO,GAAG;QACZ,OAAO,CAAC,GAAG;YAAC,CAAC,EAAE,MAAM,CAAA;SAAC;;;QAGtB,MAAM,CAAC,IAAI;KAGd;;;ICPD,OAAO,EAAC,GAAG,EAAC,UAAY;IAExB,MAAM,CAAC,KAAY,CAAC;IAGpB,MAAM,CAAC,IAAI,CAAC;;KAAqB,CAAC;IAClC,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,ZGVjbGFyZSBtb2R1bGUgImEiIHsNCiAgICBleHBvcnQgY2xhc3MgRm9vIHsNCiAgICAgICAgZG9UaGluZyh4OiB7DQogICAgICAgICAgICBhOiBudW1iZXI7DQogICAgICAgIH0pOiB7DQogICAgICAgICAgICBiOiBudW1iZXI7DQogICAgICAgIH07DQogICAgICAgIHN0YXRpYyBtYWtlKCk6IEZvbzsNCiAgICB9DQp9DQpkZWNsYXJlIG1vZHVsZSAiaW5kZXgiIHsNCiAgICBpbXBvcnQgeyBGb28gfSBmcm9tICJhIjsNCiAgICBjb25zdCBjOiBGb287DQogICAgZXhwb3J0IGxldCB4OiB7DQogICAgICAgIGI6IG51bWJlcjsNCiAgICB9Ow0KICAgIGV4cG9ydCB7IGMsIEZvbyB9Ow0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9YnVuZGxlLmQudHMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ0ZXN0cy9jYXNlcy9jb21waWxlci9hLnRzIiwidGVzdHMvY2FzZXMvY29tcGlsZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtJQUFBLE1BQU0sT0FBTyxHQUFHO1FBQ1osT0FBTyxDQUFDLEdBQUc7WUFBQyxDQUFDLEVBQUUsTUFBTSxDQUFBO1NBQUM7OztRQUd0QixNQUFNLENBQUMsSUFBSTtLQUdkOzs7SUNQRCxPQUFPLEVBQUMsR0FBRyxFQUFDLFVBQVk7SUFFeEIsTUFBTSxDQUFDLEtBQVksQ0FBQztJQUdwQixNQUFNLENBQUMsSUFBSSxDQUFDOztLQUFxQixDQUFDO0lBQ2xDLE9BQU8sRUFBRSxDQUFDLEVBQUUsR0FBRyxFQUFFLENBQUMifQ==,ZXhwb3J0IGNsYXNzIEZvbyB7CiAgICBkb1RoaW5nKHg6IHthOiBudW1iZXJ9KSB7CiAgICAgICAgcmV0dXJuIHtiOiB4LmF9OwogICAgfQogICAgc3RhdGljIG1ha2UoKSB7CiAgICAgICAgcmV0dXJuIG5ldyBGb28oKTsKICAgIH0KfQ==,aW1wb3J0IHtGb299IGZyb20gIi4vYSI7Cgpjb25zdCBjID0gbmV3IEZvbygpOwpjLmRvVGhpbmcoe2E6IDQyfSk7CgpleHBvcnQgbGV0IHggPSBjLmRvVGhpbmcoe2E6IDEyfSk7CmV4cG9ydCB7IGMsIEZvbyB9Owo= +{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/index.ts"],"names":[],"mappings":";IAAA,MAAM,OAAO,GAAG;QACZ,OAAO,CAAC,GAAG;YAAC,CAAC,EAAE,MAAM,CAAA;SAAC;;;QAGtB,MAAM,CAAC,IAAI;KAGd;;;ICPD,OAAO,EAAC,GAAG,EAAC,kBAAY;IAExB,MAAM,CAAC,KAAY,CAAC;IAGpB,MAAM,CAAC,IAAI,CAAC;;KAAqB,CAAC;IAClC,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,ZGVjbGFyZSBtb2R1bGUgImV4YW1wbGUvYSIgew0KICAgIGV4cG9ydCBjbGFzcyBGb28gew0KICAgICAgICBkb1RoaW5nKHg6IHsNCiAgICAgICAgICAgIGE6IG51bWJlcjsNCiAgICAgICAgfSk6IHsNCiAgICAgICAgICAgIGI6IG51bWJlcjsNCiAgICAgICAgfTsNCiAgICAgICAgc3RhdGljIG1ha2UoKTogRm9vOw0KICAgIH0NCn0NCmRlY2xhcmUgbW9kdWxlICJleGFtcGxlL2luZGV4IiB7DQogICAgaW1wb3J0IHsgRm9vIH0gZnJvbSAiZXhhbXBsZS9hIjsNCiAgICBjb25zdCBjOiBGb287DQogICAgZXhwb3J0IGxldCB4OiB7DQogICAgICAgIGI6IG51bWJlcjsNCiAgICB9Ow0KICAgIGV4cG9ydCB7IGMsIEZvbyB9Ow0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9YnVuZGxlLmQudHMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ0ZXN0cy9jYXNlcy9jb21waWxlci9hLnRzIiwidGVzdHMvY2FzZXMvY29tcGlsZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtJQUFBLE1BQU0sT0FBTyxHQUFHO1FBQ1osT0FBTyxDQUFDLEdBQUc7WUFBQyxDQUFDLEVBQUUsTUFBTSxDQUFBO1NBQUM7OztRQUd0QixNQUFNLENBQUMsSUFBSTtLQUdkOzs7SUNQRCxPQUFPLEVBQUMsR0FBRyxFQUFDLGtCQUFZO0lBRXhCLE1BQU0sQ0FBQyxLQUFZLENBQUM7SUFHcEIsTUFBTSxDQUFDLElBQUksQ0FBQzs7S0FBcUIsQ0FBQztJQUNsQyxPQUFPLEVBQUUsQ0FBQyxFQUFFLEdBQUcsRUFBRSxDQUFDIn0=,ZXhwb3J0IGNsYXNzIEZvbyB7CiAgICBkb1RoaW5nKHg6IHthOiBudW1iZXJ9KSB7CiAgICAgICAgcmV0dXJuIHtiOiB4LmF9OwogICAgfQogICAgc3RhdGljIG1ha2UoKSB7CiAgICAgICAgcmV0dXJuIG5ldyBGb28oKTsKICAgIH0KfQ==,aW1wb3J0IHtGb299IGZyb20gIi4vYSI7Cgpjb25zdCBjID0gbmV3IEZvbygpOwpjLmRvVGhpbmcoe2E6IDQyfSk7CgpleHBvcnQgbGV0IHggPSBjLmRvVGhpbmcoe2E6IDEyfSk7CmV4cG9ydCB7IGMsIEZvbyB9Owo= diff --git a/tests/baselines/reference/declarationMapsOutFile.sourcemap.txt b/tests/baselines/reference/declarationMapsOutFile.sourcemap.txt index 26c730e30c4d3..277b08dda551c 100644 --- a/tests/baselines/reference/declarationMapsOutFile.sourcemap.txt +++ b/tests/baselines/reference/declarationMapsOutFile.sourcemap.txt @@ -8,7 +8,7 @@ sources: tests/cases/compiler/a.ts,tests/cases/compiler/index.ts emittedFile:bundle.d.ts sourceFile:tests/cases/compiler/a.ts ------------------------------------------------------------------- ->>>declare module "a" { +>>>declare module "example/a" { >>> export class Foo { 1 >^^^^ 2 > ^^^^^^ @@ -95,14 +95,14 @@ emittedFile:bundle.d.ts sourceFile:tests/cases/compiler/index.ts ------------------------------------------------------------------- >>>} ->>>declare module "index" { ->>> import { Foo } from "a"; +>>>declare module "example/index" { +>>> import { Foo } from "example/a"; 1 >^^^^ 2 > ^^^^^^^ 3 > ^^ 4 > ^^^ 5 > ^^ -6 > ^^^^^^^^^^ +6 > ^^^^^^^^^^^^^^^^^^ 1 > 2 > import 3 > { @@ -114,7 +114,7 @@ sourceFile:tests/cases/compiler/index.ts 3 >Emitted(12, 14) Source(1, 9) + SourceIndex(1) 4 >Emitted(12, 17) Source(1, 12) + SourceIndex(1) 5 >Emitted(12, 19) Source(1, 13) + SourceIndex(1) -6 >Emitted(12, 29) Source(1, 25) + SourceIndex(1) +6 >Emitted(12, 37) Source(1, 25) + SourceIndex(1) --- >>> const c: Foo; 1 >^^^^ diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariable.js b/tests/baselines/reference/jsFileCompilationDuplicateVariable.js index 549bd0dfe9a28..11416c427f7b1 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateVariable.js +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariable.js @@ -4,7 +4,8 @@ var x = 10; //// [b.js] -var x = "hello"; // Error is recorded here, but suppressed because the js file isn't checked +var x = "hello"; // Error is recorded here, but suppressed because the js file isn't checked + //// [out.js] var x = 10; diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt index 540970836d656..9bf2bcd60564e 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt @@ -8,4 +8,5 @@ tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations m var x = 10; // Error reported ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. -!!! related TS6203 tests/cases/compiler/b.js:1:5: 'x' was also declared here. \ No newline at end of file +!!! related TS6203 tests/cases/compiler/b.js:1:5: 'x' was also declared here. + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.js b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.js index 83b33fdd02b4d..61ce622c7cd98 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.js +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.js @@ -4,7 +4,8 @@ var x = "hello"; //// [a.ts] -var x = 10; // Error reported +var x = 10; // Error reported + //// [out.js] var x = "hello"; diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.js b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.js index 128ec0c3e357e..41f4513d4e6e0 100644 --- a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.js +++ b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.js @@ -11,7 +11,8 @@ function foo() { //// [c.js] function bar() { -} +} + //// [out.js] var c = /** @class */ (function () { diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.symbols b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.symbols index 805d202a14c20..4495e905264d3 100644 --- a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.symbols +++ b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.symbols @@ -13,3 +13,4 @@ function foo() { function bar() { >bar : Symbol(bar, Decl(c.js, 0, 0)) } + diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.types b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.types index b206a486351dc..70f47c0b9be23 100644 --- a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.types +++ b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.types @@ -13,3 +13,4 @@ function foo() { function bar() { >bar : () => void } + diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.js b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.js index 9c60af0c79c06..e91124d534fa6 100644 --- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.js +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.js @@ -11,7 +11,8 @@ function foo() { //// [c.js] function bar() { -} +} + //// [out.js] var c = /** @class */ (function () { diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.symbols b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.symbols index 967d023d2c2f8..ec32329ee2d50 100644 --- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.symbols +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.symbols @@ -13,3 +13,4 @@ function foo() { function bar() { >bar : Symbol(bar, Decl(c.js, 0, 0)) } + diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.types b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.types index b34de54d704f8..919fc99c18fc9 100644 --- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.types +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.types @@ -13,3 +13,4 @@ function foo() { function bar() { >bar : () => void } + diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt index e10ec91b4c55e..a566f8b0d0cf8 100644 --- a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt @@ -9,4 +9,5 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would o } ==== tests/cases/compiler/b.d.ts (0 errors) ==== - declare function foo(): boolean; \ No newline at end of file + declare function foo(): boolean; + \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js index 94da177e8e123..d87924e68add8 100644 --- a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js +++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.js @@ -5,7 +5,8 @@ class c { } //// [b.d.ts] -declare function foo(): boolean; +declare function foo(): boolean; + //// [b.js] var c = /** @class */ (function () { diff --git a/tests/baselines/reference/out-flag2.errors.txt b/tests/baselines/reference/out-flag2.errors.txt index 7ee3abe4c1316..f5908a7ec8fa5 100644 --- a/tests/baselines/reference/out-flag2.errors.txt +++ b/tests/baselines/reference/out-flag2.errors.txt @@ -6,4 +6,5 @@ error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. class A { } ==== tests/cases/compiler/b.ts (0 errors) ==== - class B { } \ No newline at end of file + class B { } + \ No newline at end of file diff --git a/tests/baselines/reference/out-flag2.js b/tests/baselines/reference/out-flag2.js index aa2f7e772a44b..96fa231a6d642 100644 --- a/tests/baselines/reference/out-flag2.js +++ b/tests/baselines/reference/out-flag2.js @@ -4,7 +4,8 @@ class A { } //// [b.ts] -class B { } +class B { } + //// [c.js] var A = /** @class */ (function () { diff --git a/tests/baselines/reference/out-flag2.js.map b/tests/baselines/reference/out-flag2.js.map index 6d38b7150bf90..090a43a6933cc 100644 --- a/tests/baselines/reference/out-flag2.js.map +++ b/tests/baselines/reference/out-flag2.js.map @@ -1,3 +1,3 @@ //// [c.js.map] {"version":3,"file":"c.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":"AAAA;IAAA;IAAU,CAAC;IAAD,QAAC;AAAD,CAAC,AAAX,IAAW;ACAX;IAAA;IAAU,CAAC;IAAD,QAAC;AAAD,CAAC,AAAX,IAAW"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIEEgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQSgpIHsNCiAgICB9DQogICAgcmV0dXJuIEE7DQp9KCkpOw0KdmFyIEIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQigpIHsNCiAgICB9DQogICAgcmV0dXJuIEI7DQp9KCkpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9Yy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2EudHMiLCJ0ZXN0cy9jYXNlcy9jb21waWxlci9iLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0lBQUE7SUFBVSxDQUFDO0lBQUQsUUFBQztBQUFELENBQUMsQUFBWCxJQUFXO0FDQVg7SUFBQTtJQUFVLENBQUM7SUFBRCxRQUFDO0FBQUQsQ0FBQyxBQUFYLElBQVcifQ==,Y2xhc3MgQSB7IH0K,Y2xhc3MgQiB7IH0= +//// https://sokra.github.io/source-map-visualization#base64,dmFyIEEgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQSgpIHsNCiAgICB9DQogICAgcmV0dXJuIEE7DQp9KCkpOw0KdmFyIEIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQigpIHsNCiAgICB9DQogICAgcmV0dXJuIEI7DQp9KCkpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9Yy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2EudHMiLCJ0ZXN0cy9jYXNlcy9jb21waWxlci9iLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0lBQUE7SUFBVSxDQUFDO0lBQUQsUUFBQztBQUFELENBQUMsQUFBWCxJQUFXO0FDQVg7SUFBQTtJQUFVLENBQUM7SUFBRCxRQUFDO0FBQUQsQ0FBQyxBQUFYLElBQVcifQ==,Y2xhc3MgQSB7IH0K,Y2xhc3MgQiB7IH0K diff --git a/tests/baselines/reference/out-flag3.errors.txt b/tests/baselines/reference/out-flag3.errors.txt index cb2c73c79d817..580fb552c43fc 100644 --- a/tests/baselines/reference/out-flag3.errors.txt +++ b/tests/baselines/reference/out-flag3.errors.txt @@ -10,4 +10,5 @@ error TS6082: Only 'amd' and 'system' modules are supported alongside --out. class A { } ==== tests/cases/compiler/b.ts (0 errors) ==== - class B { } \ No newline at end of file + class B { } + \ No newline at end of file diff --git a/tests/baselines/reference/out-flag3.js b/tests/baselines/reference/out-flag3.js index d00e4f7de530b..9eaa844f5ccb7 100644 --- a/tests/baselines/reference/out-flag3.js +++ b/tests/baselines/reference/out-flag3.js @@ -6,7 +6,8 @@ class A { } //// [b.ts] -class B { } +class B { } + //// [c.js] // --out and --outFile error diff --git a/tests/baselines/reference/out-flag3.js.map b/tests/baselines/reference/out-flag3.js.map index b2e5dc96455b1..3f4ef4645bbd9 100644 --- a/tests/baselines/reference/out-flag3.js.map +++ b/tests/baselines/reference/out-flag3.js.map @@ -1,3 +1,3 @@ //// [c.js.map] {"version":3,"file":"c.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B;IAAA;IAAU,CAAC;IAAD,QAAC;AAAD,CAAC,AAAX,IAAW;ACFX;IAAA;IAAU,CAAC;IAAD,QAAC;AAAD,CAAC,AAAX,IAAW"} -//// https://sokra.github.io/source-map-visualization#base64,Ly8gLS1vdXQgYW5kIC0tb3V0RmlsZSBlcnJvcg0KdmFyIEEgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQSgpIHsNCiAgICB9DQogICAgcmV0dXJuIEE7DQp9KCkpOw0KdmFyIEIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQigpIHsNCiAgICB9DQogICAgcmV0dXJuIEI7DQp9KCkpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9Yy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2EudHMiLCJ0ZXN0cy9jYXNlcy9jb21waWxlci9iLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRCQUE0QjtBQUU1QjtJQUFBO0lBQVUsQ0FBQztJQUFELFFBQUM7QUFBRCxDQUFDLEFBQVgsSUFBVztBQ0ZYO0lBQUE7SUFBVSxDQUFDO0lBQUQsUUFBQztBQUFELENBQUMsQUFBWCxJQUFXIn0=,Ly8gLS1vdXQgYW5kIC0tb3V0RmlsZSBlcnJvcgoKY2xhc3MgQSB7IH0K,Y2xhc3MgQiB7IH0= +//// https://sokra.github.io/source-map-visualization#base64,Ly8gLS1vdXQgYW5kIC0tb3V0RmlsZSBlcnJvcg0KdmFyIEEgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQSgpIHsNCiAgICB9DQogICAgcmV0dXJuIEE7DQp9KCkpOw0KdmFyIEIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQigpIHsNCiAgICB9DQogICAgcmV0dXJuIEI7DQp9KCkpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9Yy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2EudHMiLCJ0ZXN0cy9jYXNlcy9jb21waWxlci9iLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRCQUE0QjtBQUU1QjtJQUFBO0lBQVUsQ0FBQztJQUFELFFBQUM7QUFBRCxDQUFDLEFBQVgsSUFBVztBQ0ZYO0lBQUE7SUFBVSxDQUFDO0lBQUQsUUFBQztBQUFELENBQUMsQUFBWCxJQUFXIn0=,Ly8gLS1vdXQgYW5kIC0tb3V0RmlsZSBlcnJvcgoKY2xhc3MgQSB7IH0K,Y2xhc3MgQiB7IH0K diff --git a/tests/baselines/reference/outModuleConcatCommonjs.errors.txt b/tests/baselines/reference/outModuleConcatCommonjs.errors.txt index 0121cd9b9dfeb..44953c7332e15 100644 --- a/tests/baselines/reference/outModuleConcatCommonjs.errors.txt +++ b/tests/baselines/reference/outModuleConcatCommonjs.errors.txt @@ -9,4 +9,5 @@ error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. ==== tests/cases/compiler/b.ts (0 errors) ==== import {A} from "./ref/a"; - export class B extends A { } \ No newline at end of file + export class B extends A { } + \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatCommonjsDeclarationOnly.js b/tests/baselines/reference/outModuleConcatCommonjsDeclarationOnly.js index 93b94d9c2e2f6..e9aafab7d37cc 100644 --- a/tests/baselines/reference/outModuleConcatCommonjsDeclarationOnly.js +++ b/tests/baselines/reference/outModuleConcatCommonjsDeclarationOnly.js @@ -5,17 +5,18 @@ export class A { } //// [b.ts] import {A} from "./ref/a"; -export class B extends A { } +export class B extends A { } + //// [all.d.ts] -declare module "ref/a" { +declare module "out/ref/a" { export class A { } } -declare module "b" { - import { A } from "ref/a"; +declare module "out/b" { + import { A } from "out/ref/a"; export class B extends A { } } diff --git a/tests/baselines/reference/outModuleConcatUnspecifiedModuleKindDeclarationOnly.errors.txt b/tests/baselines/reference/outModuleConcatUnspecifiedModuleKindDeclarationOnly.errors.txt new file mode 100644 index 0000000000000..9fd55a097bdbb --- /dev/null +++ b/tests/baselines/reference/outModuleConcatUnspecifiedModuleKindDeclarationOnly.errors.txt @@ -0,0 +1,10 @@ +error TS5069: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration' or option 'composite'. + + +!!! error TS5069: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration' or option 'composite'. +==== tests/cases/compiler/a.ts (0 errors) ==== + export class A { } // module + +==== tests/cases/compiler/b.ts (0 errors) ==== + var x = 0; // global + \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatUnspecifiedModuleKindDeclarationOnly.js b/tests/baselines/reference/outModuleConcatUnspecifiedModuleKindDeclarationOnly.js deleted file mode 100644 index 43f944f6715df..0000000000000 --- a/tests/baselines/reference/outModuleConcatUnspecifiedModuleKindDeclarationOnly.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [tests/cases/compiler/outModuleConcatUnspecifiedModuleKindDeclarationOnly.ts] //// - -//// [a.ts] -export class A { } // module - -//// [b.ts] -var x = 0; // global - - - -//// [out.d.ts] -declare module "a" { - export class A { - } -} -declare var x: number; diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/bundledPackageName/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/bundledPackageName/tsconfig.json new file mode 100644 index 0000000000000..50946eae74b91 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/bundledPackageName/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "bundledPackageName": "someString" + } +} diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js index 189dd306ce5ee..25057b2c8afc1 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js @@ -16,7 +16,8 @@ Copyright ---------------------------------------------------------------------------*/ /// -var y = x; +var y = x; + //// [a.js] /*-------------------------------------------------------------------------- diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js.map b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js.map index 99527c20abbc7..183f55a83e12c 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js.map +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js.map @@ -1,3 +1,3 @@ //// [a.js.map] {"version":3,"file":"a.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":"AAAA;;6EAE6E;AAE7E,IAAI,CAAC,GAAG;IACJ,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;CACR,CAAC;ACPF;;6EAE6E;AAE7E,2BAA2B;AAC3B,IAAI,CAAC,GAAG,CAAC,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,LyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KQ29weXJpZ2h0DQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLw0KdmFyIHggPSB7DQogICAgYTogMTAsDQogICAgYjogMjANCn07DQovKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQpDb3B5cmlnaHQNCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovDQovLy88cmVmZXJlbmNlIHBhdGg9ImEudHMiLz4NCnZhciB5ID0geDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2EudHMiLCJ0ZXN0cy9jYXNlcy9jb21waWxlci9iLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs2RUFFNkU7QUFFN0UsSUFBSSxDQUFDLEdBQUc7SUFDSixDQUFDLEVBQUUsRUFBRTtJQUNMLENBQUMsRUFBRSxFQUFFO0NBQ1IsQ0FBQztBQ1BGOzs2RUFFNkU7QUFFN0UsMkJBQTJCO0FBQzNCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyJ9,LyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpDb3B5cmlnaHQgCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCgp2YXIgeCA9IHsKICAgIGE6IDEwLAogICAgYjogMjAKfTsK,LyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpDb3B5cmlnaHQgCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCgovLy88cmVmZXJlbmNlIHBhdGg9ImEudHMiLz4KdmFyIHkgPSB4Ow== +//// https://sokra.github.io/source-map-visualization#base64,LyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KQ29weXJpZ2h0DQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLw0KdmFyIHggPSB7DQogICAgYTogMTAsDQogICAgYjogMjANCn07DQovKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQpDb3B5cmlnaHQNCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovDQovLy88cmVmZXJlbmNlIHBhdGg9ImEudHMiLz4NCnZhciB5ID0geDsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2EudHMiLCJ0ZXN0cy9jYXNlcy9jb21waWxlci9iLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs2RUFFNkU7QUFFN0UsSUFBSSxDQUFDLEdBQUc7SUFDSixDQUFDLEVBQUUsRUFBRTtJQUNMLENBQUMsRUFBRSxFQUFFO0NBQ1IsQ0FBQztBQ1BGOzs2RUFFNkU7QUFFN0UsMkJBQTJCO0FBQzNCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyJ9,LyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpDb3B5cmlnaHQgCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCgp2YXIgeCA9IHsKICAgIGE6IDEwLAogICAgYjogMjAKfTsK,LyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpDb3B5cmlnaHQgCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCgovLy88cmVmZXJlbmNlIHBhdGg9ImEudHMiLz4KdmFyIHkgPSB4Owo= diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js index 6960991ab6a91..e95a85b307165 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js @@ -35,7 +35,8 @@ interface Symbol { "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "common.js" + "outFile": "common.js", + "bundledPackageName": "common" }, "include": ["nominal.js"] } @@ -52,7 +53,8 @@ const c = /** @type {*} */(null); "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "sub-project.js" + "outFile": "sub-project.js", + "bundledPackageName": "sub" }, "references": [ { "path": "../common", "prepend": true } @@ -78,7 +80,8 @@ function getVar() { "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "sub-project-2.js" + "outFile": "sub-project-2.js", + "bundledPackageName": "sub-2" }, "references": [ { "path": "../sub-project", "prepend": true } diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js index 83bfb329b9aa9..d386ee34b0792 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js @@ -35,7 +35,8 @@ interface Symbol { "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "common.js" + "outFile": "common.js", + "bundledPackageName": "common" }, "include": ["nominal.js"] } @@ -52,7 +53,8 @@ const c = /** @type {*} */(null); "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "sub-project.js" + "outFile": "sub-project.js", + "bundledPackageName": "sub" }, "references": [ { "path": "../common", "prepend": true } @@ -78,7 +80,8 @@ function getVar() { "extends": "../tsconfig.base.json", "compilerOptions": { "composite": true, - "outFile": "sub-project-2.js" + "outFile": "sub-project-2.js", + "bundledPackageName": "sub-2" }, "references": [ { "path": "../sub-project", "prepend": true } diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js b/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js index 0c604bb21b384..4169905f9a7c8 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js @@ -51,7 +51,8 @@ Input:: "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -79,6 +80,7 @@ Input:: "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -116,7 +118,8 @@ Input:: "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js b/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js index aa3a94fa1cbf7..a19a9148467c3 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "skipDefaultLibCheck": true }, @@ -115,7 +117,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" @@ -235,6 +238,7 @@ function f() { "sourceMap": true, "declarationMap": true, "skipDefaultLibCheck": true, + "bundledPackageName": "first", "configFilePath": "./tsconfig.json" }, "semanticDiagnosticsPerFile": [ @@ -322,6 +326,7 @@ var C = (function () { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "skipDefaultLibCheck": true, "configFilePath": "./tsconfig.json" }, @@ -399,6 +404,7 @@ c.doSomething(); "declarationMap": true, "declaration": true, "skipDefaultLibCheck": true, + "bundledPackageName": "third", "configFilePath": "./tsconfig.json" }, "semanticDiagnosticsPerFile": [ diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js b/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js index e1227348f0c87..fa2dbb5a8d179 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -115,7 +117,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js b/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js index 8c2acb2f7d5d2..c5570a7e8ef09 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js @@ -131,7 +131,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -159,6 +160,7 @@ function f() { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -313,7 +315,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js index 0847f3a0a31ee..cb033e5b0df9c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -115,7 +117,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js index edcd6e049c397..8bb1f2c6882aa 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -113,7 +115,8 @@ class C { "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js index 4071641ef473e..30f000d9a98ea 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js @@ -49,7 +49,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -95,6 +96,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -121,7 +123,8 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js index f44f525faccac..9c947a4793488 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -93,6 +94,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -117,7 +119,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js index c79711d5c6a15..3021e55807eb9 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js @@ -52,7 +52,8 @@ firstfirst_part3Spread(...[10, 20, 30]); "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -101,6 +102,7 @@ secondsecond_part2Spread(...[10, 20, 30]); "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -130,7 +132,8 @@ thirdthird_part1Spread(...[10, 20, 30]); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js index a25738af1de97..699c467ceb203 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js @@ -49,7 +49,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -96,6 +97,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -122,7 +124,8 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js index 15c99fb44246c..c107118b3f36b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js @@ -48,7 +48,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -94,6 +95,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -120,7 +122,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js index b724195549b48..028288aaac6f3 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -93,6 +94,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -117,7 +119,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js index 2c2c0ef14e563..fbeb489cee30f 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js @@ -49,7 +49,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -94,6 +95,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -119,7 +121,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js index 5038a130e3c30..5deb019aee2d3 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -92,6 +93,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -116,7 +118,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js index efcacf4962e47..1be8254490c26 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -115,7 +117,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js index 3de22165d36ee..a800f1d9cbe98 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -115,7 +117,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js index 22dc66e618dac..83dc640065574 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js @@ -74,7 +74,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -118,6 +119,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -143,7 +145,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index 0cbe00147124c..b33056d5772cb 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -116,6 +117,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -142,7 +144,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js index a5bf02c619829..dfc58c8d63287 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -116,6 +117,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -141,7 +143,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 826b0f65121d6..23dc29eeac7b7 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -116,6 +117,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -142,7 +144,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js index 93f781c02b9f8..5acedb0dbeb78 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -116,6 +117,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -141,7 +143,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js index b81b83505ad72..ffe6921b33444 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js @@ -69,7 +69,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -113,6 +114,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -138,7 +140,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js index 4ac5d22491475..812a307add2b9 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -116,6 +117,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -142,7 +144,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js index 04c58f90e11e2..a2f6f80cbb770 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js @@ -24,7 +24,7 @@ declare const console: { log(msg: any): void; }; //// [/src/first/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"sourceMap":true,"outFile":"./bin/first-output.js"},"files":["/src/first/first_PART1.ts"]} +{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"sourceMap":true,"outFile":"./bin/first-output.js","bundledPackageName":"first"},"files":["/src/first/first_PART1.ts"]} //// [/src/second/second_part1.ts] @@ -39,7 +39,7 @@ declare const console: { log(msg: any): void; }; const B = 2; //// [/src/third/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":false,"stripInternal":true,"sourceMap":true,"outFile":"./thirdjs/output/third-output.js"},"references":[{"path":"../first","prepend":true}],"files":["/src/third/third_part1.ts"]} +{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":false,"stripInternal":true,"sourceMap":true,"outFile":"./thirdjs/output/third-output.js","bundledPackageName":"third"},"references":[{"path":"../first","prepend":true}],"files":["/src/third/third_part1.ts"]} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 67c31ad38fd76..c36b89c2c6e64 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -116,6 +117,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -142,7 +144,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js index eef87379bc71c..1675d3b90c58c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -116,6 +117,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -141,7 +143,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js index e9b253dd41bf5..908424fc5fee1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -116,6 +117,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -141,7 +143,8 @@ c.doSomething(); "declaration": true, "stripInternal": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js index cad3db56ff2a1..5e64ec560bd26 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js @@ -52,7 +52,8 @@ declare class firstfirst_part2 { } "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -101,6 +102,7 @@ declare class secondsecond_part1 { } "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -130,7 +132,8 @@ declare class thirdthird_part1 { } "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js index 939185954d7ef..a73f4c1077776 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -96,6 +97,7 @@ declare class secondsecond_part1 { } "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -120,7 +122,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js index de5c71fc3e94b..b8b8f46a6fb7e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -115,7 +117,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js index 5ae9007d3c60d..5be8ceda59b4a 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -115,7 +117,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js index 6fed22e3f836d..ba6a309bb3884 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -116,7 +118,8 @@ c.doSomething(); "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js index facf822c736d6..52315c549d7ad 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js @@ -47,7 +47,8 @@ function f() { "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", @@ -91,6 +92,7 @@ class C { "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, @@ -113,7 +115,8 @@ class C { "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts" diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js index 07f697f9b41d7..aaab6b2ece835 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js @@ -13,13 +13,13 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } //// [/user/username/projects/sample1/core/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"outFile":"index.js"}} +{"compilerOptions":{"composite":true,"declaration":true,"outFile":"index.js","bundledPackageName":"core"}} //// [/user/username/projects/sample1/core/index.ts] function foo() { return 10; } //// [/user/username/projects/sample1/logic/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"outFile":"index.js"},"references":[{"path":"../core","prepend":true}]} +{"compilerOptions":{"composite":true,"declaration":true,"outFile":"index.js","bundledPackageName":"logic"},"references":[{"path":"../core","prepend":true}]} //// [/user/username/projects/sample1/logic/index.ts] function bar() { return foo() + 1 }; @@ -36,7 +36,7 @@ Output:: Program root files: ["/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","bundledPackageName":"core","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.ts @@ -44,7 +44,7 @@ Program files:: No cached semantic diagnostics in the builder:: Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","bundledPackageName":"logic","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts @@ -236,7 +236,7 @@ Output:: Program root files: ["/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","bundledPackageName":"core","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.ts @@ -331,7 +331,7 @@ Output:: Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","bundledPackageName":"logic","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts @@ -474,7 +474,7 @@ Output:: Program root files: ["/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","bundledPackageName":"core","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.ts diff --git a/tests/baselines/reference/typeReferenceDirectives11.errors.txt b/tests/baselines/reference/typeReferenceDirectives11.errors.txt index 658b64fbaff25..8ca23a2b6260f 100644 --- a/tests/baselines/reference/typeReferenceDirectives11.errors.txt +++ b/tests/baselines/reference/typeReferenceDirectives11.errors.txt @@ -4,6 +4,7 @@ ==== /mod2.ts (0 errors) ==== import {foo} from "./mod1"; export const bar = foo(); + ==== /types/lib/index.d.ts (0 errors) ==== interface Lib { x } diff --git a/tests/baselines/reference/typeReferenceDirectives12.errors.txt b/tests/baselines/reference/typeReferenceDirectives12.errors.txt index 20431e19d9a88..6fefacdf96f21 100644 --- a/tests/baselines/reference/typeReferenceDirectives12.errors.txt +++ b/tests/baselines/reference/typeReferenceDirectives12.errors.txt @@ -1,6 +1,8 @@ +error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. /main.ts(1,14): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. +!!! error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. ==== /mod2.ts (0 errors) ==== import { Cls } from "./main"; import "./mod1"; diff --git a/tests/cases/compiler/bundledDtsLateExportRenaming.ts b/tests/cases/compiler/bundledDtsLateExportRenaming.ts new file mode 100644 index 0000000000000..cc9f16f1f805e --- /dev/null +++ b/tests/cases/compiler/bundledDtsLateExportRenaming.ts @@ -0,0 +1,31 @@ +// @module: commonjs +// @declaration: true +// @moduleResolution: node +// @emitDeclarationOnly: true +// @outFile: ./dist/out.d.ts + +// @Filename: index.ts +export * from "./nested"; + +// @Filename: nested/base.ts +import { B } from "./shared"; + +export function f() { + return new B(); +} + +// @Filename: nested/derived.ts +import { f } from "./base"; + +export function g() { + return f(); +} + +// @Filename: nested/index.ts +export * from "./base"; + +export * from "./derived"; +export * from "./shared"; + +// @Filename: nested/shared.ts +export class B {} diff --git a/tests/cases/compiler/declFileWithErrorsInInputDeclarationFileWithOut.ts b/tests/cases/compiler/declFileWithErrorsInInputDeclarationFileWithOut.ts index 005b52d5bc9f6..0243f2168c65a 100644 --- a/tests/cases/compiler/declFileWithErrorsInInputDeclarationFileWithOut.ts +++ b/tests/cases/compiler/declFileWithErrorsInInputDeclarationFileWithOut.ts @@ -1,5 +1,6 @@ // @declaration: true // @out: out.js +// @bundledPackageName: "lib" // @Filename: declFile.d.ts declare module M { diff --git a/tests/cases/compiler/declarationEmitBundlePreservesHasNoDefaultLibDirective.ts b/tests/cases/compiler/declarationEmitBundlePreservesHasNoDefaultLibDirective.ts index 79ebb3c938733..3b2bbb5316703 100644 --- a/tests/cases/compiler/declarationEmitBundlePreservesHasNoDefaultLibDirective.ts +++ b/tests/cases/compiler/declarationEmitBundlePreservesHasNoDefaultLibDirective.ts @@ -1,5 +1,6 @@ // @declaration: true // @outFile: mylib.js +// @bundledPackageName: mylib // @filename: extensions.ts /// class Foo { diff --git a/tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts b/tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts index b43c9a8b2e04f..9fe02ae124685 100644 --- a/tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts +++ b/tests/cases/compiler/declarationFileOverwriteErrorWithOut.ts @@ -1,4 +1,5 @@ // @declaration: true +// @bundledPackageName: decl // @out: tests/cases/compiler/out.js // @Filename: out.d.ts @@ -7,4 +8,4 @@ declare class c { // @FileName: a.ts class d { -} \ No newline at end of file +} diff --git a/tests/cases/compiler/declarationFilesGeneratingTypeReferences.ts b/tests/cases/compiler/declarationFilesGeneratingTypeReferences.ts index 0d27ad5918b7b..d9a2a47aeff13 100644 --- a/tests/cases/compiler/declarationFilesGeneratingTypeReferences.ts +++ b/tests/cases/compiler/declarationFilesGeneratingTypeReferences.ts @@ -1,5 +1,6 @@ // @declaration: true // @outFile: out.js +// @bundledPackageName: decl // @filename: /a/node_modules/@types/jquery/index.d.ts interface JQuery { @@ -10,4 +11,4 @@ interface JQuery { /// namespace Test { export var x: JQuery; -} \ No newline at end of file +} diff --git a/tests/cases/compiler/declarationMapsOutFile.ts b/tests/cases/compiler/declarationMapsOutFile.ts index b388d567ef335..a7e60ee3bbe8d 100644 --- a/tests/cases/compiler/declarationMapsOutFile.ts +++ b/tests/cases/compiler/declarationMapsOutFile.ts @@ -1,5 +1,6 @@ // @declaration: true // @declarationMap: true +// @bundledPackageName: example // @module: amd // @outFile: bundle.js // @filename: a.ts diff --git a/tests/cases/compiler/declarationMapsOutFile2.ts b/tests/cases/compiler/declarationMapsOutFile2.ts index 713f6f5391044..e29debe6d5b9e 100644 --- a/tests/cases/compiler/declarationMapsOutFile2.ts +++ b/tests/cases/compiler/declarationMapsOutFile2.ts @@ -1,5 +1,6 @@ // @declaration: true // @declarationMap: true +// @bundledPackageName: "lib" // @outFile: bundle.js // @filename: a.ts class Foo { diff --git a/tests/cases/compiler/declarationMapsWithSourceMap.ts b/tests/cases/compiler/declarationMapsWithSourceMap.ts index 332ccb04fce36..7a1777dacc4fa 100644 --- a/tests/cases/compiler/declarationMapsWithSourceMap.ts +++ b/tests/cases/compiler/declarationMapsWithSourceMap.ts @@ -1,6 +1,7 @@ // @declaration: true // @declarationMap: true // @outFile: bundle.js +// @bundledPackageName: bundle // @sourceMap: true // @filename: a.ts class Foo { diff --git a/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts b/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts index 8517c9dbf8e6d..4d1a607b86535 100644 --- a/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts +++ b/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts @@ -1,6 +1,7 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: out // @filename: b.js function foo() { return 10; diff --git a/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts b/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts index a02b7d9d88a95..0e28d85bc8865 100644 --- a/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts +++ b/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts @@ -1,6 +1,7 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: jsfile // @filename: a.ts function foo() { return 30; diff --git a/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts b/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts index b100fc748c83d..b8e6ea125ab2b 100644 --- a/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts +++ b/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts @@ -1,8 +1,9 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: decl // @filename: a.ts var x = 10; // @filename: b.js -var x = "hello"; // Error is recorded here, but suppressed because the js file isn't checked \ No newline at end of file +var x = "hello"; // Error is recorded here, but suppressed because the js file isn't checked diff --git a/tests/cases/compiler/jsFileCompilationDuplicateVariableErrorReported.ts b/tests/cases/compiler/jsFileCompilationDuplicateVariableErrorReported.ts index 11b7711eb0eff..35e6611bc2985 100644 --- a/tests/cases/compiler/jsFileCompilationDuplicateVariableErrorReported.ts +++ b/tests/cases/compiler/jsFileCompilationDuplicateVariableErrorReported.ts @@ -1,8 +1,9 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: out // @filename: b.js var x = "hello"; // @filename: a.ts -var x = 10; // Error reported \ No newline at end of file +var x = 10; // Error reported diff --git a/tests/cases/compiler/jsFileCompilationEmitDeclarations.ts b/tests/cases/compiler/jsFileCompilationEmitDeclarations.ts index 9d6daeac6fa6c..92e7e058f6214 100644 --- a/tests/cases/compiler/jsFileCompilationEmitDeclarations.ts +++ b/tests/cases/compiler/jsFileCompilationEmitDeclarations.ts @@ -1,6 +1,7 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: decl // @filename: a.ts class c { } diff --git a/tests/cases/compiler/jsFileCompilationEmitTrippleSlashReference.ts b/tests/cases/compiler/jsFileCompilationEmitTrippleSlashReference.ts index 8d41ac2ef1336..b08524fa1581e 100644 --- a/tests/cases/compiler/jsFileCompilationEmitTrippleSlashReference.ts +++ b/tests/cases/compiler/jsFileCompilationEmitTrippleSlashReference.ts @@ -1,6 +1,7 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: out // @filename: a.ts class c { } @@ -12,4 +13,4 @@ function foo() { // @filename: c.js function bar() { -} \ No newline at end of file +} diff --git a/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.ts b/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.ts index d2173ba28ef8c..26d846844e994 100644 --- a/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.ts +++ b/tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.ts @@ -1,6 +1,7 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: out // @filename: a.ts class c { } @@ -12,4 +13,4 @@ function foo() { // @filename: c.js function bar() { -} \ No newline at end of file +} diff --git a/tests/cases/compiler/jsFileCompilationLetDeclarationOrder.ts b/tests/cases/compiler/jsFileCompilationLetDeclarationOrder.ts index 962267c5cabb3..f61ada82699b4 100644 --- a/tests/cases/compiler/jsFileCompilationLetDeclarationOrder.ts +++ b/tests/cases/compiler/jsFileCompilationLetDeclarationOrder.ts @@ -1,6 +1,7 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: out // @filename: b.js let a = 10; b = 30; diff --git a/tests/cases/compiler/jsFileCompilationLetDeclarationOrder2.ts b/tests/cases/compiler/jsFileCompilationLetDeclarationOrder2.ts index 8f89c57ade21e..2f72abb21fde4 100644 --- a/tests/cases/compiler/jsFileCompilationLetDeclarationOrder2.ts +++ b/tests/cases/compiler/jsFileCompilationLetDeclarationOrder2.ts @@ -1,6 +1,7 @@ // @allowJs: true // @out: out.js // @declaration: true +// @bundledPackageName: out // @filename: a.ts let b = 30; a = 10; diff --git a/tests/cases/compiler/jsFileCompilationWithEnabledCompositeOption.ts b/tests/cases/compiler/jsFileCompilationWithEnabledCompositeOption.ts index 90340ef5d3af2..4e5dfaa5da374 100644 --- a/tests/cases/compiler/jsFileCompilationWithEnabledCompositeOption.ts +++ b/tests/cases/compiler/jsFileCompilationWithEnabledCompositeOption.ts @@ -1,5 +1,6 @@ // @allowJs: true // @out: out.js +// @bundledPackageName: out // @composite: true // @filename: a.ts class c { diff --git a/tests/cases/compiler/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.ts b/tests/cases/compiler/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.ts index 1c6bb41de14db..ce6041cf5ccd7 100644 --- a/tests/cases/compiler/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.ts +++ b/tests/cases/compiler/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.ts @@ -1,8 +1,9 @@ // @declaration: true // @out: tests/cases/compiler/b.js +// @bundledPackageName: "lib" // @filename: a.ts class c { } // @filename: b.d.ts -declare function foo(): boolean; \ No newline at end of file +declare function foo(): boolean; diff --git a/tests/cases/compiler/out-flag2.ts b/tests/cases/compiler/out-flag2.ts index d3349563a9f44..8687a834194f8 100644 --- a/tests/cases/compiler/out-flag2.ts +++ b/tests/cases/compiler/out-flag2.ts @@ -3,9 +3,10 @@ // @declaration: true // @module: commonjs // @outFile: c.js +// @bundledPackageName: out // @Filename: a.ts class A { } // @Filename: b.ts -class B { } \ No newline at end of file +class B { } diff --git a/tests/cases/compiler/out-flag3.ts b/tests/cases/compiler/out-flag3.ts index cb3c6819811e1..71dcc68394388 100644 --- a/tests/cases/compiler/out-flag3.ts +++ b/tests/cases/compiler/out-flag3.ts @@ -1,6 +1,7 @@ // @target: ES5 // @sourcemap: true // @declaration: true +// @bundledPackageName: out // @module: commonjs // @outFile: c.js // @out: d.js @@ -11,4 +12,4 @@ class A { } // @Filename: b.ts -class B { } \ No newline at end of file +class B { } diff --git a/tests/cases/compiler/outModuleConcatCommonjs.ts b/tests/cases/compiler/outModuleConcatCommonjs.ts index 0cb57bd11e784..9e87cd8ea49c9 100644 --- a/tests/cases/compiler/outModuleConcatCommonjs.ts +++ b/tests/cases/compiler/outModuleConcatCommonjs.ts @@ -3,6 +3,7 @@ // @declaration: true // @module: commonjs // @outFile: all.js +// @bundledPackageName: "lib" // This should be an error @@ -11,4 +12,4 @@ export class A { } // @Filename: b.ts import {A} from "./ref/a"; -export class B extends A { } \ No newline at end of file +export class B extends A { } diff --git a/tests/cases/compiler/outModuleConcatCommonjsDeclarationOnly.ts b/tests/cases/compiler/outModuleConcatCommonjsDeclarationOnly.ts index aa662e337c9f4..8778764b88145 100644 --- a/tests/cases/compiler/outModuleConcatCommonjsDeclarationOnly.ts +++ b/tests/cases/compiler/outModuleConcatCommonjsDeclarationOnly.ts @@ -3,6 +3,7 @@ // @declaration: true // @emitDeclarationOnly: true // @module: commonjs +// @bundledPackageName: out // @outFile: all.js // @Filename: ref/a.ts @@ -10,4 +11,4 @@ export class A { } // @Filename: b.ts import {A} from "./ref/a"; -export class B extends A { } \ No newline at end of file +export class B extends A { } diff --git a/tests/cases/compiler/outModuleConcatUnspecifiedModuleKindDeclarationOnly.ts b/tests/cases/compiler/outModuleConcatUnspecifiedModuleKindDeclarationOnly.ts index 862f64507a243..5af8173fa7cc9 100644 --- a/tests/cases/compiler/outModuleConcatUnspecifiedModuleKindDeclarationOnly.ts +++ b/tests/cases/compiler/outModuleConcatUnspecifiedModuleKindDeclarationOnly.ts @@ -1,10 +1,11 @@ // @target: ES5 // @outFile: out.js -// @declaration: true +// @declaration: true, +// @bundledPackageName: lib // @emitDeclarationOnly: true // @Filename: a.ts export class A { } // module // @Filename: b.ts -var x = 0; // global \ No newline at end of file +var x = 0; // global diff --git a/tests/cases/compiler/sourceMapWithMultipleFilesWithCopyright.ts b/tests/cases/compiler/sourceMapWithMultipleFilesWithCopyright.ts index ac179835a0c5a..9d87916490fa0 100644 --- a/tests/cases/compiler/sourceMapWithMultipleFilesWithCopyright.ts +++ b/tests/cases/compiler/sourceMapWithMultipleFilesWithCopyright.ts @@ -1,6 +1,7 @@ // @out: a.js // @sourcemap: true // @declaration: true +// @bundledPackageName: out // @Filename: a.ts /*-------------------------------------------------------------------------- Copyright @@ -17,4 +18,4 @@ Copyright ---------------------------------------------------------------------------*/ /// -var y = x; \ No newline at end of file +var y = x; diff --git a/tests/cases/compiler/typeReferenceDirectives11.ts b/tests/cases/compiler/typeReferenceDirectives11.ts index 8763c9f0458e4..c4e9cd8d84d82 100644 --- a/tests/cases/compiler/typeReferenceDirectives11.ts +++ b/tests/cases/compiler/typeReferenceDirectives11.ts @@ -1,5 +1,6 @@ // @noImplicitReferences: true // @declaration: true +// @bundledPackageName: out // @typeRoots: /types // @traceResolution: true // @types: lib @@ -18,4 +19,4 @@ export function foo(): Lib { return {x: 1} } // @filename: /mod2.ts import {foo} from "./mod1"; -export const bar = foo(); \ No newline at end of file +export const bar = foo(); diff --git a/tests/cases/conformance/declarationEmit/bundledNodeDTSFailsWithOutFlag.ts b/tests/cases/conformance/declarationEmit/bundledNodeDTSFailsWithOutFlag.ts new file mode 100644 index 0000000000000..19445ea4103b7 --- /dev/null +++ b/tests/cases/conformance/declarationEmit/bundledNodeDTSFailsWithOutFlag.ts @@ -0,0 +1,29 @@ +// @module: commonjs +// @declaration: true +// @emitDeclarationOnly: true +// @outFile: ./dist/out.d.ts + +// @Filename: index.ts +export * from "./nested"; + +// @Filename: nested/base.ts +import { B } from "./shared"; + +export function f() { + return new B(); +} + +// @Filename: nested/derived.ts +import { f } from "./base"; + +export function g() { + return f(); +} + +// @Filename: nested/index.ts +export * from "./base"; +export * from "./derived"; +export * from "./shared"; + +// @Filename: nested/shared.ts +export class B {} diff --git a/tests/cases/conformance/declarationEmit/bundledNodeDTSPassesWithFlag.ts b/tests/cases/conformance/declarationEmit/bundledNodeDTSPassesWithFlag.ts new file mode 100644 index 0000000000000..7b40b45745de4 --- /dev/null +++ b/tests/cases/conformance/declarationEmit/bundledNodeDTSPassesWithFlag.ts @@ -0,0 +1,30 @@ +// @module: commonjs +// @declaration: true +// @emitDeclarationOnly: true +// @outFile: ./dist/out.d.ts +// @bundledPackageName: my-pkg + +// @Filename: index.ts +export * from "./nested"; + +// @Filename: nested/base.ts +import { B } from "./shared"; + +export function f() { + return new B(); +} + +// @Filename: nested/derived.ts +import { f } from "./base"; + +export function g() { + return f(); +} + +// @Filename: nested/index.ts +export * from "./base"; +export * from "./derived"; +export * from "./shared"; + +// @Filename: nested/shared.ts +export class B {} diff --git a/tests/cases/conformance/declarationEmit/bundledNodeDTSWithExports.ts b/tests/cases/conformance/declarationEmit/bundledNodeDTSWithExports.ts new file mode 100644 index 0000000000000..04bc127464182 --- /dev/null +++ b/tests/cases/conformance/declarationEmit/bundledNodeDTSWithExports.ts @@ -0,0 +1,27 @@ +// @module: commonjs +// @declaration: true +// @emitDeclarationOnly: true +// @outFile: ./dist/out.d.ts +// @bundledPackageName: my-pkg + +// @Filename: index.ts +export {} + +// @Filename: nested/base.ts +import { C } from "./"; + +export function f() { + return new C(); +} + +// @Filename: nested/derived.ts +import { f } from "./base"; + +export function g() { + return f(); +} + +// @Filename: nested/index.ts +export * from "./base"; +export * from "./derived"; +export class C {} diff --git a/tests/cases/conformance/declarationEmit/bundledNodeDTSWithScopedPackage.ts b/tests/cases/conformance/declarationEmit/bundledNodeDTSWithScopedPackage.ts new file mode 100644 index 0000000000000..1c29efba0bd67 --- /dev/null +++ b/tests/cases/conformance/declarationEmit/bundledNodeDTSWithScopedPackage.ts @@ -0,0 +1,30 @@ +// @module: commonjs +// @declaration: true +// @emitDeclarationOnly: true +// @outFile: ./dist/out.d.ts +// @bundledPackageName: @test/my-pkg + +// @Filename: index.ts +export * from "./nested"; + +// @Filename: nested/base.ts +import { B } from "./shared"; + +export function f() { + return new B(); +} + +// @Filename: nested/derived.ts +import { f } from "./base"; + +export function g() { + return f(); +} + +// @Filename: nested/index.ts +export * from "./base"; +export * from "./derived"; +export * from "./shared"; + +// @Filename: nested/shared.ts +export class B {} diff --git a/tests/projects/container/compositeExec/tsconfig.json b/tests/projects/container/compositeExec/tsconfig.json index 4f44b8a562d74..7bc3010d9376a 100644 --- a/tests/projects/container/compositeExec/tsconfig.json +++ b/tests/projects/container/compositeExec/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "outFile": "../built/local/compositeExec.js", "composite": true, - "declarationMap": true + "declarationMap": true, + "bundledPackageName": "compositeExec" }, "files": [ "index.ts" @@ -10,4 +11,4 @@ "references": [ { "path": "../lib", "prepend": true } ] -} \ No newline at end of file +} diff --git a/tests/projects/container/exec/tsconfig.json b/tests/projects/container/exec/tsconfig.json index 1a3a4c9edd179..77df9b2c0b9ad 100644 --- a/tests/projects/container/exec/tsconfig.json +++ b/tests/projects/container/exec/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "outFile": "../built/local/exec.js" + "outFile": "../built/local/exec.js", + "bundledPackageName": "exec" }, "files": [ "index.ts" @@ -8,4 +9,4 @@ "references": [ { "path": "../lib", "prepend": true } ] -} \ No newline at end of file +} diff --git a/tests/projects/container/lib/tsconfig.json b/tests/projects/container/lib/tsconfig.json index 15766e8372122..44d3ac56fefe7 100644 --- a/tests/projects/container/lib/tsconfig.json +++ b/tests/projects/container/lib/tsconfig.json @@ -2,10 +2,11 @@ "compilerOptions": { "outFile": "../built/local/lib.js", "composite": true, - "declarationMap": true + "declarationMap": true, + "bundledPackageName": "lib" }, "references": [], "files": [ "index.ts" ] -} \ No newline at end of file +} diff --git a/tests/projects/outfile-concat/first/tsconfig.json b/tests/projects/outfile-concat/first/tsconfig.json index 625e7a7d0388d..29ad28d3352af 100644 --- a/tests/projects/outfile-concat/first/tsconfig.json +++ b/tests/projects/outfile-concat/first/tsconfig.json @@ -7,7 +7,8 @@ "sourceMap": true, "declarationMap": true, "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "first", }, "files": [ "first_PART1.ts", diff --git a/tests/projects/outfile-concat/second/tsconfig.json b/tests/projects/outfile-concat/second/tsconfig.json index 7ea38db348624..5f0118593e7b6 100644 --- a/tests/projects/outfile-concat/second/tsconfig.json +++ b/tests/projects/outfile-concat/second/tsconfig.json @@ -7,6 +7,7 @@ "sourceMap": true, "declarationMap": true, "declaration": true, + "bundledPackageName": "second", "outFile": "../2/second-output.js", "skipDefaultLibCheck": true }, diff --git a/tests/projects/outfile-concat/third/tsconfig.json b/tests/projects/outfile-concat/third/tsconfig.json index efaea2dc60364..0ed8e23dec67b 100644 --- a/tests/projects/outfile-concat/third/tsconfig.json +++ b/tests/projects/outfile-concat/third/tsconfig.json @@ -8,7 +8,8 @@ "declarationMap": true, "declaration": true, "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true + "skipDefaultLibCheck": true, + "bundledPackageName": "third", }, "files": [ "third_part1.ts"