Skip to content

Commit c12cc53

Browse files
author
Orta Therox
authored
Remove bundledPackageName from release 4.1 (#41536)
* Merge release 4-1 * Remove unused tests
1 parent 612c19d commit c12cc53

File tree

103 files changed

+54
-674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+54
-674
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4360,7 +4360,6 @@ namespace ts {
43604360
getProjectReferenceRedirect: fileName => host.getProjectReferenceRedirect(fileName),
43614361
isSourceOfProjectReferenceRedirect: fileName => host.isSourceOfProjectReferenceRedirect(fileName),
43624362
fileExists: fileName => host.fileExists(fileName),
4363-
getCompilerOptions: () => host.getCompilerOptions()
43644363
} : undefined },
43654364
encounteredError: false,
43664365
visitedTypes: undefined,
@@ -6015,8 +6014,7 @@ namespace ts {
60156014
const resolverHost = {
60166015
getCanonicalFileName,
60176016
getCurrentDirectory: () => context.tracker.moduleResolverHost!.getCurrentDirectory(),
6018-
getCommonSourceDirectory: () => context.tracker.moduleResolverHost!.getCommonSourceDirectory(),
6019-
getCompilerOptions: () => context.tracker.moduleResolverHost!.getCompilerOptions()
6017+
getCommonSourceDirectory: () => context.tracker.moduleResolverHost!.getCommonSourceDirectory()
60206018
};
60216019
const newName = getResolvedExternalModuleName(resolverHost, targetFile);
60226020
return factory.createStringLiteral(newName);

src/compiler/commandLineParser.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,13 +1031,6 @@ namespace ts {
10311031
category: Diagnostics.Advanced_Options,
10321032
description: Diagnostics.Emit_class_fields_with_Define_instead_of_Set,
10331033
},
1034-
{
1035-
name: "bundledPackageName",
1036-
type: "string",
1037-
affectsEmit: true,
1038-
category: Diagnostics.Advanced_Options,
1039-
description: Diagnostics.Provides_a_root_package_name_when_using_outFile_with_declarations,
1040-
},
10411034

10421035
{
10431036
name: "keyofStringsOnly",

src/compiler/diagnosticMessages.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,14 +1188,6 @@
11881188
"category": "Error",
11891189
"code": 1389
11901190
},
1191-
"Provides a root package name when using outFile with declarations.": {
1192-
"category": "Message",
1193-
"code": 1390
1194-
},
1195-
"The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit.": {
1196-
"category": "Error",
1197-
"code": 1391
1198-
},
11991191
"The types of '{0}' are incompatible between these types.": {
12001192
"category": "Error",
12011193
"code": 2200

src/compiler/moduleSpecifiers.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ namespace ts.moduleSpecifiers {
157157
}
158158

159159
function getLocalModuleSpecifier(moduleFileName: string, { getCanonicalFileName, sourceDirectory }: Info, compilerOptions: CompilerOptions, host: ModuleSpecifierResolutionHost, { ending, relativePreference }: Preferences): string {
160-
const { baseUrl, paths, rootDirs, bundledPackageName } = compilerOptions;
160+
const { baseUrl, paths, rootDirs } = compilerOptions;
161161

162162
const relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) ||
163163
removeExtensionAndIndexPostFix(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions);
@@ -171,9 +171,8 @@ namespace ts.moduleSpecifiers {
171171
return relativePath;
172172
}
173173

174-
const bundledPkgReference = bundledPackageName ? combinePaths(bundledPackageName, relativeToBaseUrl) : relativeToBaseUrl;
175-
const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(bundledPkgReference, ending, compilerOptions);
176-
const fromPaths = paths && tryGetModuleNameFromPaths(removeFileExtension(bundledPkgReference), importRelativeToBaseUrl, paths);
174+
const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions);
175+
const fromPaths = paths && tryGetModuleNameFromPaths(removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
177176
const nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths;
178177
if (!nonRelative) {
179178
return relativePath;

src/compiler/program.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,11 +3224,6 @@ namespace ts {
32243224
}
32253225
}
32263226

3227-
// Without a package name, for multiple files being bundled into a .d.ts file you basically get a file which doesn't wrk
3228-
if (outputFile && getEmitDeclarations(options) && getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeJs && !options.bundledPackageName) {
3229-
createDiagnosticForOptionName(Diagnostics.The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit, options.out ? "out" : "outFile");
3230-
}
3231-
32323227
if (options.resolveJsonModule) {
32333228
if (getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeJs) {
32343229
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");

src/compiler/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5729,7 +5729,6 @@ namespace ts {
57295729
/** An error if set - this should only go through the -b pipeline and not actually be observed */
57305730
/*@internal*/
57315731
build?: boolean;
5732-
bundledPackageName?: string;
57335732
charset?: string;
57345733
checkJs?: boolean;
57355734
/* @internal */ configFilePath?: string;
@@ -7857,7 +7856,6 @@ namespace ts {
78577856
readonly redirectTargetsMap: RedirectTargetsMap;
78587857
getProjectReferenceRedirect(fileName: string): string | undefined;
78597858
isSourceOfProjectReferenceRedirect(fileName: string): boolean;
7860-
getCompilerOptions(): CompilerOptions;
78617859
}
78627860

78637861
// Note: this used to be deprecated in our public API, but is still used internally

src/compiler/utilities.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4069,7 +4069,6 @@ namespace ts {
40694069
getCanonicalFileName(p: string): string;
40704070
getCommonSourceDirectory(): string;
40714071
getCurrentDirectory(): string;
4072-
getCompilerOptions(): CompilerOptions;
40734072
}
40744073

40754074
export function getResolvedExternalModuleName(host: ResolveModuleNameResolutionHost, file: SourceFile, referenceFile?: SourceFile): string {
@@ -4093,16 +4092,7 @@ namespace ts {
40934092
const filePath = getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());
40944093
const relativePath = getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
40954094
const extensionless = removeFileExtension(relativePath);
4096-
if (referencePath) {
4097-
return ensurePathIsNonModuleName(extensionless);
4098-
}
4099-
const options = host.getCompilerOptions();
4100-
const rootPkgName = options.bundledPackageName || "";
4101-
const newPath = combinePaths(rootPkgName, extensionless);
4102-
if (rootPkgName && getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeJs && endsWith(newPath, "/index")) {
4103-
return newPath.slice(0, newPath.length - "/index".length);
4104-
}
4105-
return newPath;
4095+
return referencePath ? ensurePathIsNonModuleName(extensionless) : extensionless;
41064096
}
41074097

41084098
export function getOwnEmitOutputFilePath(fileName: string, host: EmitHost, extension: string) {

src/services/utilities.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,8 +1786,7 @@ namespace ts {
17861786
getSourceFiles: () => program.getSourceFiles(),
17871787
redirectTargetsMap: program.redirectTargetsMap,
17881788
getProjectReferenceRedirect: fileName => program.getProjectReferenceRedirect(fileName),
1789-
isSourceOfProjectReferenceRedirect: fileName => program.isSourceOfProjectReferenceRedirect(fileName),
1790-
getCompilerOptions: () => program.getCompilerOptions()
1789+
isSourceOfProjectReferenceRedirect: fileName => program.isSourceOfProjectReferenceRedirect(fileName)
17911790
};
17921791
}
17931792

src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ namespace ts {
105105
"compilerOptions": {
106106
"composite": true,
107107
"outFile": "common.js",
108-
"bundledPackageName": "common"
108+
109109
},
110110
"include": ["nominal.js"]
111111
}`,
@@ -121,7 +121,7 @@ namespace ts {
121121
"compilerOptions": {
122122
"composite": true,
123123
"outFile": "sub-project.js",
124-
"bundledPackageName": "sub"
124+
125125
},
126126
"references": [
127127
{ "path": "../common", "prepend": true }
@@ -146,7 +146,7 @@ namespace ts {
146146
"compilerOptions": {
147147
"composite": true,
148148
"outFile": "sub-project-2.js",
149-
"bundledPackageName": "sub-2"
149+
150150
},
151151
"references": [
152152
{ "path": "../sub-project", "prepend": true }

src/testRunner/unittests/tsbuild/outFile.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,7 @@ ${internal} enum internalEnum { a, b, c }`);
658658
declarationMap: true,
659659
skipDefaultLibCheck: true,
660660
sourceMap: true,
661-
outFile: "./bin/first-output.js",
662-
bundledPackageName: "first"
661+
outFile: "./bin/first-output.js"
663662
},
664663
files: [sources[Project.first][Source.ts][Part.one]]
665664
}));
@@ -671,7 +670,6 @@ ${internal} enum internalEnum { a, b, c }`);
671670
stripInternal: true,
672671
sourceMap: true,
673672
outFile: "./thirdjs/output/third-output.js",
674-
bundledPackageName: "third"
675673
},
676674
references: [{ path: "../first", prepend: true }],
677675
files: [sources[Project.third][Source.ts][Part.one]]

src/testRunner/unittests/tsbuild/watchMode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ export class someClass2 { }`),
326326
const coreTsConfig: File = {
327327
path: core[0].path,
328328
content: JSON.stringify({
329-
compilerOptions: { composite: true, declaration: true, outFile: "index.js", bundledPackageName: "core" }
329+
compilerOptions: { composite: true, declaration: true, outFile: "index.js" }
330330
})
331331
};
332332
const logicTsConfig: File = {
333333
path: logic[0].path,
334334
content: JSON.stringify({
335-
compilerOptions: { composite: true, declaration: true, outFile: "index.js", bundledPackageName: "logic" },
335+
compilerOptions: { composite: true, declaration: true, outFile: "index.js" },
336336
references: [{ path: "../core", prepend: true }]
337337
})
338338
};

src/testRunner/unittests/tsserver/projectReferenceErrors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ let x: string = 10;`
193193
};
194194
const dependencyConfig: File = {
195195
path: `${dependecyLocation}/tsconfig.json`,
196-
content: JSON.stringify({ compilerOptions: { composite: true, outFile: "../dependency.js", bundledPackageName: "dep" } })
196+
content: JSON.stringify({ compilerOptions: { composite: true, outFile: "../dependency.js" } })
197197
};
198198
const usageTs: File = {
199199
path: `${usageLocation}/usage.ts`,
@@ -205,7 +205,7 @@ fnErr();
205205
const usageConfig: File = {
206206
path: `${usageLocation}/tsconfig.json`,
207207
content: JSON.stringify({
208-
compilerOptions: { composite: true, outFile: "../usage.js", bundledPackageName: "usage" },
208+
compilerOptions: { composite: true, outFile: "../usage.js" },
209209
references: [{ path: "../dependency" }]
210210
})
211211
};

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2790,7 +2790,6 @@ declare namespace ts {
27902790
allowUnusedLabels?: boolean;
27912791
alwaysStrict?: boolean;
27922792
baseUrl?: string;
2793-
bundledPackageName?: string;
27942793
charset?: string;
27952794
checkJs?: boolean;
27962795
declaration?: boolean;

tests/baselines/reference/api/typescript.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2790,7 +2790,6 @@ declare namespace ts {
27902790
allowUnusedLabels?: boolean;
27912791
alwaysStrict?: boolean;
27922792
baseUrl?: string;
2793-
bundledPackageName?: string;
27942793
charset?: string;
27952794
checkJs?: boolean;
27962795
declaration?: boolean;

tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/baselines/reference/bundledDtsLateExportRenaming.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.errors.txt

Lines changed: 0 additions & 29 deletions
This file was deleted.

tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)