@typescript-deploys/pr-build 5.7.0-pr-59767-2 → 5.7.0-pr-59736-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.7";
21
- var version = `${versionMajorMinor}.0-insiders.20240826`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240827`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -7269,7 +7269,6 @@ var Diagnostics = {
7269
7269
  Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
7270
7270
  Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors: diag(6419, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419", "Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),
7271
7271
  Project_0_is_out_of_date_because_1: diag(6420, 3 /* Message */, "Project_0_is_out_of_date_because_1_6420", "Project '{0}' is out of date because {1}."),
7272
- Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files: diag(6421, 3 /* Message */, "Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421", "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),
7273
7272
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
7274
7273
  The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
7275
7274
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -17646,12 +17645,6 @@ function createComputedCompilerOptions(options) {
17646
17645
  return options;
17647
17646
  }
17648
17647
  var computedOptions = createComputedCompilerOptions({
17649
- allowImportingTsExtensions: {
17650
- dependencies: ["rewriteRelativeImportExtensions"],
17651
- computeValue: (compilerOptions) => {
17652
- return !!(compilerOptions.allowImportingTsExtensions || compilerOptions.rewriteRelativeImportExtensions);
17653
- }
17654
- },
17655
17648
  target: {
17656
17649
  dependencies: ["module"],
17657
17650
  computeValue: (compilerOptions) => {
@@ -17865,7 +17858,6 @@ var computedOptions = createComputedCompilerOptions({
17865
17858
  }
17866
17859
  }
17867
17860
  });
17868
- var getAllowImportingTsExtensions = computedOptions.allowImportingTsExtensions.computeValue;
17869
17861
  var getEmitScriptTarget = computedOptions.target.computeValue;
17870
17862
  var getEmitModuleKind = computedOptions.module.computeValue;
17871
17863
  var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
@@ -36659,15 +36651,6 @@ var commandOptionsWithoutBuild = [
36659
36651
  defaultValueDescription: false,
36660
36652
  transpileOptionValue: void 0
36661
36653
  },
36662
- {
36663
- name: "rewriteRelativeImportExtensions",
36664
- type: "boolean",
36665
- affectsSemanticDiagnostics: true,
36666
- affectsBuildInfo: true,
36667
- category: Diagnostics.Modules,
36668
- description: Diagnostics.Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files,
36669
- defaultValueDescription: false
36670
- },
36671
36654
  {
36672
36655
  name: "resolvePackageJsonExports",
36673
36656
  type: "boolean",
@@ -41301,7 +41284,7 @@ function resolveFromTypeRoot(moduleName, state) {
41301
41284
  }
41302
41285
  }
41303
41286
  function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
41304
- return getAllowImportingTsExtensions(compilerOptions) || fromFileName && isDeclarationFileName(fromFileName);
41287
+ return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName);
41305
41288
  }
41306
41289
  function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
41307
41290
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -93041,17 +93024,10 @@ function transformTypeScript(context) {
93041
93024
  /*modifiers*/
93042
93025
  void 0,
93043
93026
  importClause,
93044
- rewriteModuleSpecifier(node.moduleSpecifier),
93027
+ node.moduleSpecifier,
93045
93028
  node.attributes
93046
93029
  ) : void 0;
93047
93030
  }
93048
- function rewriteModuleSpecifier(node) {
93049
- if (!node || !compilerOptions.rewriteRelativeImportExtensions || !isStringLiteral(node) || !pathIsRelative(node.text) || isDeclarationFileName(node.text)) {
93050
- return node;
93051
- }
93052
- const updatedText = changeExtension(node.text, getOutputExtension(node.text, compilerOptions));
93053
- return updatedText !== node.text ? setOriginalNode(setTextRange(factory2.createStringLiteral(updatedText, node.singleQuote), node), node) : node;
93054
- }
93055
93031
  function visitImportClause(node) {
93056
93032
  Debug.assert(!node.isTypeOnly);
93057
93033
  const name = shouldEmitAliasDeclaration(node) ? node.name : void 0;
@@ -93084,14 +93060,7 @@ function transformTypeScript(context) {
93084
93060
  return void 0;
93085
93061
  }
93086
93062
  if (!node.exportClause || isNamespaceExport(node.exportClause)) {
93087
- return factory2.updateExportDeclaration(
93088
- node,
93089
- node.modifiers,
93090
- node.isTypeOnly,
93091
- node.exportClause,
93092
- rewriteModuleSpecifier(node.moduleSpecifier),
93093
- node.attributes
93094
- );
93063
+ return node;
93095
93064
  }
93096
93065
  const allowEmpty = !!compilerOptions.verbatimModuleSyntax;
93097
93066
  const exportClause = visitNode(
@@ -93105,7 +93074,7 @@ function transformTypeScript(context) {
93105
93074
  void 0,
93106
93075
  node.isTypeOnly,
93107
93076
  exportClause,
93108
- rewriteModuleSpecifier(node.moduleSpecifier),
93077
+ node.moduleSpecifier,
93109
93078
  node.attributes
93110
93079
  ) : void 0;
93111
93080
  }
@@ -93130,24 +93099,8 @@ function transformTypeScript(context) {
93130
93099
  return void 0;
93131
93100
  }
93132
93101
  if (isExternalModuleImportEqualsDeclaration(node)) {
93133
- if (!shouldEmitAliasDeclaration(node)) {
93134
- return void 0;
93135
- }
93136
- const updatedModuleSpecifier = rewriteModuleSpecifier(node.moduleReference.expression);
93137
- if (updatedModuleSpecifier !== node.moduleReference.expression) {
93138
- return visitEachChild(
93139
- factory2.updateImportEqualsDeclaration(
93140
- node,
93141
- node.modifiers,
93142
- node.isTypeOnly,
93143
- node.name,
93144
- factory2.updateExternalModuleReference(node.moduleReference, updatedModuleSpecifier)
93145
- ),
93146
- visitor,
93147
- context
93148
- );
93149
- }
93150
- return visitEachChild(node, visitor, context);
93102
+ const isReferenced = shouldEmitAliasDeclaration(node);
93103
+ return isReferenced ? visitEachChild(node, visitor, context) : void 0;
93151
93104
  }
93152
93105
  if (!shouldEmitImportEqualsDeclaration(node)) {
93153
93106
  return void 0;
@@ -122516,7 +122469,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
122516
122469
  createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax");
122517
122470
  }
122518
122471
  }
122519
- if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly || options.rewriteRelativeImportExtensions)) {
122472
+ if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) {
122520
122473
  createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);
122521
122474
  }
122522
122475
  const moduleResolution = getEmitModuleResolutionKind(options);
@@ -7021,7 +7021,6 @@ declare namespace ts {
7021
7021
  removeComments?: boolean;
7022
7022
  resolvePackageJsonExports?: boolean;
7023
7023
  resolvePackageJsonImports?: boolean;
7024
- rewriteRelativeImportExtensions?: boolean;
7025
7024
  rootDir?: string;
7026
7025
  rootDirs?: string[];
7027
7026
  skipLibCheck?: boolean;
package/lib/typescript.js CHANGED
@@ -633,7 +633,6 @@ __export(typescript_exports, {
633
633
  getAllKeys: () => getAllKeys,
634
634
  getAllProjectOutputs: () => getAllProjectOutputs,
635
635
  getAllSuperTypeNodes: () => getAllSuperTypeNodes,
636
- getAllowImportingTsExtensions: () => getAllowImportingTsExtensions,
637
636
  getAllowJSCompilerOption: () => getAllowJSCompilerOption,
638
637
  getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports,
639
638
  getAncestor: () => getAncestor,
@@ -2266,7 +2265,7 @@ module.exports = __toCommonJS(typescript_exports);
2266
2265
 
2267
2266
  // src/compiler/corePublic.ts
2268
2267
  var versionMajorMinor = "5.7";
2269
- var version = `${versionMajorMinor}.0-insiders.20240826`;
2268
+ var version = `${versionMajorMinor}.0-insiders.20240827`;
2270
2269
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2271
2270
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2272
2271
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10670,7 +10669,6 @@ var Diagnostics = {
10670
10669
  Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
10671
10670
  Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors: diag(6419, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419", "Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),
10672
10671
  Project_0_is_out_of_date_because_1: diag(6420, 3 /* Message */, "Project_0_is_out_of_date_because_1_6420", "Project '{0}' is out of date because {1}."),
10673
- Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files: diag(6421, 3 /* Message */, "Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421", "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),
10674
10672
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
10675
10673
  The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
10676
10674
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -21614,12 +21612,6 @@ function createComputedCompilerOptions(options) {
21614
21612
  return options;
21615
21613
  }
21616
21614
  var computedOptions = createComputedCompilerOptions({
21617
- allowImportingTsExtensions: {
21618
- dependencies: ["rewriteRelativeImportExtensions"],
21619
- computeValue: (compilerOptions) => {
21620
- return !!(compilerOptions.allowImportingTsExtensions || compilerOptions.rewriteRelativeImportExtensions);
21621
- }
21622
- },
21623
21615
  target: {
21624
21616
  dependencies: ["module"],
21625
21617
  computeValue: (compilerOptions) => {
@@ -21833,7 +21825,6 @@ var computedOptions = createComputedCompilerOptions({
21833
21825
  }
21834
21826
  }
21835
21827
  });
21836
- var getAllowImportingTsExtensions = computedOptions.allowImportingTsExtensions.computeValue;
21837
21828
  var getEmitScriptTarget = computedOptions.target.computeValue;
21838
21829
  var getEmitModuleKind = computedOptions.module.computeValue;
21839
21830
  var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
@@ -40933,15 +40924,6 @@ var commandOptionsWithoutBuild = [
40933
40924
  defaultValueDescription: false,
40934
40925
  transpileOptionValue: void 0
40935
40926
  },
40936
- {
40937
- name: "rewriteRelativeImportExtensions",
40938
- type: "boolean",
40939
- affectsSemanticDiagnostics: true,
40940
- affectsBuildInfo: true,
40941
- category: Diagnostics.Modules,
40942
- description: Diagnostics.Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files,
40943
- defaultValueDescription: false
40944
- },
40945
40927
  {
40946
40928
  name: "resolvePackageJsonExports",
40947
40929
  type: "boolean",
@@ -45806,7 +45788,7 @@ function resolveFromTypeRoot(moduleName, state) {
45806
45788
  }
45807
45789
  }
45808
45790
  function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
45809
- return getAllowImportingTsExtensions(compilerOptions) || fromFileName && isDeclarationFileName(fromFileName);
45791
+ return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName);
45810
45792
  }
45811
45793
  function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
45812
45794
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -97846,17 +97828,10 @@ function transformTypeScript(context) {
97846
97828
  /*modifiers*/
97847
97829
  void 0,
97848
97830
  importClause,
97849
- rewriteModuleSpecifier(node.moduleSpecifier),
97831
+ node.moduleSpecifier,
97850
97832
  node.attributes
97851
97833
  ) : void 0;
97852
97834
  }
97853
- function rewriteModuleSpecifier(node) {
97854
- if (!node || !compilerOptions.rewriteRelativeImportExtensions || !isStringLiteral(node) || !pathIsRelative(node.text) || isDeclarationFileName(node.text)) {
97855
- return node;
97856
- }
97857
- const updatedText = changeExtension(node.text, getOutputExtension(node.text, compilerOptions));
97858
- return updatedText !== node.text ? setOriginalNode(setTextRange(factory2.createStringLiteral(updatedText, node.singleQuote), node), node) : node;
97859
- }
97860
97835
  function visitImportClause(node) {
97861
97836
  Debug.assert(!node.isTypeOnly);
97862
97837
  const name = shouldEmitAliasDeclaration(node) ? node.name : void 0;
@@ -97889,14 +97864,7 @@ function transformTypeScript(context) {
97889
97864
  return void 0;
97890
97865
  }
97891
97866
  if (!node.exportClause || isNamespaceExport(node.exportClause)) {
97892
- return factory2.updateExportDeclaration(
97893
- node,
97894
- node.modifiers,
97895
- node.isTypeOnly,
97896
- node.exportClause,
97897
- rewriteModuleSpecifier(node.moduleSpecifier),
97898
- node.attributes
97899
- );
97867
+ return node;
97900
97868
  }
97901
97869
  const allowEmpty = !!compilerOptions.verbatimModuleSyntax;
97902
97870
  const exportClause = visitNode(
@@ -97910,7 +97878,7 @@ function transformTypeScript(context) {
97910
97878
  void 0,
97911
97879
  node.isTypeOnly,
97912
97880
  exportClause,
97913
- rewriteModuleSpecifier(node.moduleSpecifier),
97881
+ node.moduleSpecifier,
97914
97882
  node.attributes
97915
97883
  ) : void 0;
97916
97884
  }
@@ -97935,24 +97903,8 @@ function transformTypeScript(context) {
97935
97903
  return void 0;
97936
97904
  }
97937
97905
  if (isExternalModuleImportEqualsDeclaration(node)) {
97938
- if (!shouldEmitAliasDeclaration(node)) {
97939
- return void 0;
97940
- }
97941
- const updatedModuleSpecifier = rewriteModuleSpecifier(node.moduleReference.expression);
97942
- if (updatedModuleSpecifier !== node.moduleReference.expression) {
97943
- return visitEachChild(
97944
- factory2.updateImportEqualsDeclaration(
97945
- node,
97946
- node.modifiers,
97947
- node.isTypeOnly,
97948
- node.name,
97949
- factory2.updateExternalModuleReference(node.moduleReference, updatedModuleSpecifier)
97950
- ),
97951
- visitor,
97952
- context
97953
- );
97954
- }
97955
- return visitEachChild(node, visitor, context);
97906
+ const isReferenced = shouldEmitAliasDeclaration(node);
97907
+ return isReferenced ? visitEachChild(node, visitor, context) : void 0;
97956
97908
  }
97957
97909
  if (!shouldEmitImportEqualsDeclaration(node)) {
97958
97910
  return void 0;
@@ -127378,7 +127330,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
127378
127330
  createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax");
127379
127331
  }
127380
127332
  }
127381
- if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly || options.rewriteRelativeImportExtensions)) {
127333
+ if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) {
127382
127334
  createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);
127383
127335
  }
127384
127336
  const moduleResolution = getEmitModuleResolutionKind(options);
@@ -178751,6 +178703,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
178751
178703
  Debug.assert(rangeContainsRange(parent2, currentTokenInfo.token));
178752
178704
  const lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine();
178753
178705
  let indentToken = false;
178706
+ let isNewlineSemicolon = false;
178754
178707
  if (currentTokenInfo.leadingTrivia) {
178755
178708
  processTrivia(currentTokenInfo.leadingTrivia, parent2, childContextNode, dynamicIndentation);
178756
178709
  }
@@ -178765,6 +178718,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
178765
178718
  if (lineAction === 0 /* None */) {
178766
178719
  const prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line;
178767
178720
  indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine;
178721
+ isNewlineSemicolon = currentTokenInfo.token.kind === 27 /* SemicolonToken */;
178768
178722
  } else {
178769
178723
  indentToken = lineAction === 1 /* LineAdded */;
178770
178724
  }
@@ -178775,7 +178729,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
178775
178729
  processTrivia(currentTokenInfo.trailingTrivia, parent2, childContextNode, dynamicIndentation);
178776
178730
  }
178777
178731
  if (indentToken) {
178778
- const tokenIndentation = isTokenInRange && !rangeContainsError(currentTokenInfo.token) ? dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container, !!isListEndToken) : -1 /* Unknown */;
178732
+ const tokenIndentation = isTokenInRange && !rangeContainsError(currentTokenInfo.token) ? dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container, !!isListEndToken || isNewlineSemicolon) : -1 /* Unknown */;
178779
178733
  let indentNextTokenOrTrivia = true;
178780
178734
  if (currentTokenInfo.leadingTrivia) {
178781
178735
  const commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container);
@@ -180407,7 +180361,6 @@ __export(ts_exports2, {
180407
180361
  getAllKeys: () => getAllKeys,
180408
180362
  getAllProjectOutputs: () => getAllProjectOutputs,
180409
180363
  getAllSuperTypeNodes: () => getAllSuperTypeNodes,
180410
- getAllowImportingTsExtensions: () => getAllowImportingTsExtensions,
180411
180364
  getAllowJSCompilerOption: () => getAllowJSCompilerOption,
180412
180365
  getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports,
180413
180366
  getAncestor: () => getAncestor,
@@ -194766,7 +194719,6 @@ if (typeof console !== "undefined") {
194766
194719
  getAllKeys,
194767
194720
  getAllProjectOutputs,
194768
194721
  getAllSuperTypeNodes,
194769
- getAllowImportingTsExtensions,
194770
194722
  getAllowJSCompilerOption,
194771
194723
  getAllowSyntheticDefaultImports,
194772
194724
  getAncestor,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.7.0-pr-59767-2",
5
+ "version": "5.7.0-pr-59736-2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [