@typescript-deploys/pr-build 5.7.0-pr-59860-2 → 5.7.0-pr-59767-6

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.20240904`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240917`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -3854,6 +3854,42 @@ var EmitFlags = /* @__PURE__ */ ((EmitFlags3) => {
3854
3854
  EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping";
3855
3855
  return EmitFlags3;
3856
3856
  })(EmitFlags || {});
3857
+ var LanguageFeatureMinimumTarget = {
3858
+ Classes: 2 /* ES2015 */,
3859
+ ForOf: 2 /* ES2015 */,
3860
+ Generators: 2 /* ES2015 */,
3861
+ Iteration: 2 /* ES2015 */,
3862
+ SpreadElements: 2 /* ES2015 */,
3863
+ RestElements: 2 /* ES2015 */,
3864
+ TaggedTemplates: 2 /* ES2015 */,
3865
+ DestructuringAssignment: 2 /* ES2015 */,
3866
+ BindingPatterns: 2 /* ES2015 */,
3867
+ ArrowFunctions: 2 /* ES2015 */,
3868
+ BlockScopedVariables: 2 /* ES2015 */,
3869
+ ObjectAssign: 2 /* ES2015 */,
3870
+ RegularExpressionFlagsUnicode: 2 /* ES2015 */,
3871
+ RegularExpressionFlagsSticky: 2 /* ES2015 */,
3872
+ Exponentiation: 3 /* ES2016 */,
3873
+ AsyncFunctions: 4 /* ES2017 */,
3874
+ ForAwaitOf: 5 /* ES2018 */,
3875
+ AsyncGenerators: 5 /* ES2018 */,
3876
+ AsyncIteration: 5 /* ES2018 */,
3877
+ ObjectSpreadRest: 5 /* ES2018 */,
3878
+ RegularExpressionFlagsDotAll: 5 /* ES2018 */,
3879
+ BindinglessCatch: 6 /* ES2019 */,
3880
+ BigInt: 7 /* ES2020 */,
3881
+ NullishCoalesce: 7 /* ES2020 */,
3882
+ OptionalChaining: 7 /* ES2020 */,
3883
+ LogicalAssignment: 8 /* ES2021 */,
3884
+ TopLevelAwait: 9 /* ES2022 */,
3885
+ ClassFields: 9 /* ES2022 */,
3886
+ PrivateNamesAndClassStaticBlocks: 9 /* ES2022 */,
3887
+ RegularExpressionFlagsHasIndices: 9 /* ES2022 */,
3888
+ ShebangComments: 99 /* ESNext */,
3889
+ UsingAndAwaitUsing: 99 /* ESNext */,
3890
+ ClassAndClassElementDecorators: 99 /* ESNext */,
3891
+ RegularExpressionFlagsUnicodeSets: 99 /* ESNext */
3892
+ };
3857
3893
  var commentPragmas = {
3858
3894
  "reference": {
3859
3895
  args: [
@@ -6717,6 +6753,9 @@ var Diagnostics = {
6717
6753
  This_expression_is_always_nullish: diag(2871, 1 /* Error */, "This_expression_is_always_nullish_2871", "This expression is always nullish."),
6718
6754
  This_kind_of_expression_is_always_truthy: diag(2872, 1 /* Error */, "This_kind_of_expression_is_always_truthy_2872", "This kind of expression is always truthy."),
6719
6755
  This_kind_of_expression_is_always_falsy: diag(2873, 1 /* Error */, "This_kind_of_expression_is_always_falsy_2873", "This kind of expression is always falsy."),
6756
+ This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0: diag(2874, 1 /* Error */, "This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2874", 'This relative import path is unsafe to rewrite because it looks like a file name, but actually resolves to "{0}".'),
6757
+ This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2875, 1 /* Error */, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2875", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
6758
+ This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2876, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2876", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
6720
6759
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6721
6760
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
6722
6761
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -7274,6 +7313,7 @@ var Diagnostics = {
7274
7313
  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}."),
7275
7314
  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."),
7276
7315
  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}."),
7316
+ 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."),
7277
7317
  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}'"),
7278
7318
  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."),
7279
7319
  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."),
@@ -8070,11 +8110,11 @@ var charCodeToRegExpFlag = /* @__PURE__ */ new Map([
8070
8110
  [121 /* y */, 128 /* Sticky */]
8071
8111
  ]);
8072
8112
  var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
8073
- [1 /* HasIndices */, 9 /* RegularExpressionFlagsHasIndices */],
8074
- [16 /* DotAll */, 5 /* RegularExpressionFlagsDotAll */],
8075
- [32 /* Unicode */, 2 /* RegularExpressionFlagsUnicode */],
8076
- [64 /* UnicodeSets */, 99 /* RegularExpressionFlagsUnicodeSets */],
8077
- [128 /* Sticky */, 2 /* RegularExpressionFlagsSticky */]
8113
+ [1 /* HasIndices */, LanguageFeatureMinimumTarget.RegularExpressionFlagsHasIndices],
8114
+ [16 /* DotAll */, LanguageFeatureMinimumTarget.RegularExpressionFlagsDotAll],
8115
+ [32 /* Unicode */, LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicode],
8116
+ [64 /* UnicodeSets */, LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicodeSets],
8117
+ [128 /* Sticky */, LanguageFeatureMinimumTarget.RegularExpressionFlagsSticky]
8078
8118
  ]);
8079
8119
  var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
8080
8120
  var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
@@ -11799,6 +11839,9 @@ function isTypeOnlyExportDeclaration(node) {
11799
11839
  function isTypeOnlyImportOrExportDeclaration(node) {
11800
11840
  return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
11801
11841
  }
11842
+ function isPartOfTypeOnlyImportOrExportDeclaration(node) {
11843
+ return findAncestor(node, isTypeOnlyImportOrExportDeclaration) !== void 0;
11844
+ }
11802
11845
  function isImportAttributeName(node) {
11803
11846
  return isStringLiteral(node) || isIdentifier(node);
11804
11847
  }
@@ -14972,6 +15015,9 @@ function tryGetModuleSpecifierFromDeclaration(node) {
14972
15015
  Debug.assertNever(node);
14973
15016
  }
14974
15017
  }
15018
+ function shouldRewriteModuleSpecifier(specifier, compilerOptions) {
15019
+ return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier);
15020
+ }
14975
15021
  function getExternalModuleName(node) {
14976
15022
  switch (node.kind) {
14977
15023
  case 272 /* ImportDeclaration */:
@@ -15006,17 +15052,15 @@ function isDefaultImport(node) {
15006
15052
  return (node.kind === 272 /* ImportDeclaration */ || node.kind === 351 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name;
15007
15053
  }
15008
15054
  function hasQuestionToken(node) {
15009
- if (node) {
15010
- switch (node.kind) {
15011
- case 169 /* Parameter */:
15012
- case 174 /* MethodDeclaration */:
15013
- case 173 /* MethodSignature */:
15014
- case 304 /* ShorthandPropertyAssignment */:
15015
- case 303 /* PropertyAssignment */:
15016
- case 172 /* PropertyDeclaration */:
15017
- case 171 /* PropertySignature */:
15018
- return node.questionToken !== void 0;
15019
- }
15055
+ switch (node.kind) {
15056
+ case 169 /* Parameter */:
15057
+ case 174 /* MethodDeclaration */:
15058
+ case 173 /* MethodSignature */:
15059
+ case 304 /* ShorthandPropertyAssignment */:
15060
+ case 303 /* PropertyAssignment */:
15061
+ case 172 /* PropertyDeclaration */:
15062
+ case 171 /* PropertySignature */:
15063
+ return node.questionToken !== void 0;
15020
15064
  }
15021
15065
  return false;
15022
15066
  }
@@ -17106,6 +17150,12 @@ function getLinesBetweenPositionAndNextNonWhitespaceCharacter(pos, stopPos, sour
17106
17150
  );
17107
17151
  return getLinesBetweenPositions(sourceFile, pos, Math.min(stopPos, nextPos));
17108
17152
  }
17153
+ function rangeContainsRange(r1, r2) {
17154
+ return startEndContainsRange(r1.pos, r1.end, r2);
17155
+ }
17156
+ function startEndContainsRange(start, end, range) {
17157
+ return start <= range.pos && end >= range.end;
17158
+ }
17109
17159
  function getPreviousNonWhitespacePosition(pos, stopPos = 0, sourceFile) {
17110
17160
  while (pos-- > stopPos) {
17111
17161
  if (!isWhiteSpaceLike(sourceFile.text.charCodeAt(pos))) {
@@ -17697,7 +17747,13 @@ function importSyntaxAffectsModuleResolution(options) {
17697
17747
  function createComputedCompilerOptions(options) {
17698
17748
  return options;
17699
17749
  }
17700
- var computedOptions = createComputedCompilerOptions({
17750
+ var _computedOptions = createComputedCompilerOptions({
17751
+ allowImportingTsExtensions: {
17752
+ dependencies: ["rewriteRelativeImportExtensions"],
17753
+ computeValue: (compilerOptions) => {
17754
+ return !!(compilerOptions.allowImportingTsExtensions || compilerOptions.rewriteRelativeImportExtensions);
17755
+ }
17756
+ },
17701
17757
  target: {
17702
17758
  dependencies: ["module"],
17703
17759
  computeValue: (compilerOptions) => {
@@ -17708,7 +17764,7 @@ var computedOptions = createComputedCompilerOptions({
17708
17764
  module: {
17709
17765
  dependencies: ["target"],
17710
17766
  computeValue: (compilerOptions) => {
17711
- return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
17767
+ return typeof compilerOptions.module === "number" ? compilerOptions.module : _computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
17712
17768
  }
17713
17769
  },
17714
17770
  moduleResolution: {
@@ -17716,7 +17772,7 @@ var computedOptions = createComputedCompilerOptions({
17716
17772
  computeValue: (compilerOptions) => {
17717
17773
  let moduleResolution = compilerOptions.moduleResolution;
17718
17774
  if (moduleResolution === void 0) {
17719
- switch (computedOptions.module.computeValue(compilerOptions)) {
17775
+ switch (_computedOptions.module.computeValue(compilerOptions)) {
17720
17776
  case 1 /* CommonJS */:
17721
17777
  moduleResolution = 2 /* Node10 */;
17722
17778
  break;
@@ -17740,7 +17796,7 @@ var computedOptions = createComputedCompilerOptions({
17740
17796
  moduleDetection: {
17741
17797
  dependencies: ["module", "target"],
17742
17798
  computeValue: (compilerOptions) => {
17743
- return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
17799
+ return compilerOptions.moduleDetection || (_computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || _computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
17744
17800
  }
17745
17801
  },
17746
17802
  isolatedModules: {
@@ -17755,7 +17811,7 @@ var computedOptions = createComputedCompilerOptions({
17755
17811
  if (compilerOptions.esModuleInterop !== void 0) {
17756
17812
  return compilerOptions.esModuleInterop;
17757
17813
  }
17758
- switch (computedOptions.module.computeValue(compilerOptions)) {
17814
+ switch (_computedOptions.module.computeValue(compilerOptions)) {
17759
17815
  case 100 /* Node16 */:
17760
17816
  case 199 /* NodeNext */:
17761
17817
  case 200 /* Preserve */:
@@ -17770,13 +17826,13 @@ var computedOptions = createComputedCompilerOptions({
17770
17826
  if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
17771
17827
  return compilerOptions.allowSyntheticDefaultImports;
17772
17828
  }
17773
- return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
17829
+ return _computedOptions.esModuleInterop.computeValue(compilerOptions) || _computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || _computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
17774
17830
  }
17775
17831
  },
17776
17832
  resolvePackageJsonExports: {
17777
17833
  dependencies: ["moduleResolution"],
17778
17834
  computeValue: (compilerOptions) => {
17779
- const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
17835
+ const moduleResolution = _computedOptions.moduleResolution.computeValue(compilerOptions);
17780
17836
  if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
17781
17837
  return false;
17782
17838
  }
@@ -17795,7 +17851,7 @@ var computedOptions = createComputedCompilerOptions({
17795
17851
  resolvePackageJsonImports: {
17796
17852
  dependencies: ["moduleResolution", "resolvePackageJsonExports"],
17797
17853
  computeValue: (compilerOptions) => {
17798
- const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
17854
+ const moduleResolution = _computedOptions.moduleResolution.computeValue(compilerOptions);
17799
17855
  if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
17800
17856
  return false;
17801
17857
  }
@@ -17817,7 +17873,7 @@ var computedOptions = createComputedCompilerOptions({
17817
17873
  if (compilerOptions.resolveJsonModule !== void 0) {
17818
17874
  return compilerOptions.resolveJsonModule;
17819
17875
  }
17820
- return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
17876
+ return _computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
17821
17877
  }
17822
17878
  },
17823
17879
  declaration: {
@@ -17829,7 +17885,7 @@ var computedOptions = createComputedCompilerOptions({
17829
17885
  preserveConstEnums: {
17830
17886
  dependencies: ["isolatedModules", "verbatimModuleSyntax"],
17831
17887
  computeValue: (compilerOptions) => {
17832
- return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
17888
+ return !!(compilerOptions.preserveConstEnums || _computedOptions.isolatedModules.computeValue(compilerOptions));
17833
17889
  }
17834
17890
  },
17835
17891
  incremental: {
@@ -17841,7 +17897,7 @@ var computedOptions = createComputedCompilerOptions({
17841
17897
  declarationMap: {
17842
17898
  dependencies: ["declaration", "composite"],
17843
17899
  computeValue: (compilerOptions) => {
17844
- return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
17900
+ return !!(compilerOptions.declarationMap && _computedOptions.declaration.computeValue(compilerOptions));
17845
17901
  }
17846
17902
  },
17847
17903
  allowJs: {
@@ -17853,7 +17909,7 @@ var computedOptions = createComputedCompilerOptions({
17853
17909
  useDefineForClassFields: {
17854
17910
  dependencies: ["target", "module"],
17855
17911
  computeValue: (compilerOptions) => {
17856
- return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
17912
+ return compilerOptions.useDefineForClassFields === void 0 ? _computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
17857
17913
  }
17858
17914
  },
17859
17915
  noImplicitAny: {
@@ -17911,22 +17967,24 @@ var computedOptions = createComputedCompilerOptions({
17911
17967
  }
17912
17968
  }
17913
17969
  });
17914
- var getEmitScriptTarget = computedOptions.target.computeValue;
17915
- var getEmitModuleKind = computedOptions.module.computeValue;
17916
- var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
17917
- var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
17918
- var getIsolatedModules = computedOptions.isolatedModules.computeValue;
17919
- var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
17920
- var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
17921
- var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
17922
- var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
17923
- var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
17924
- var getEmitDeclarations = computedOptions.declaration.computeValue;
17925
- var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
17926
- var isIncrementalCompilation = computedOptions.incremental.computeValue;
17927
- var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
17928
- var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
17929
- var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
17970
+ var computedOptions = _computedOptions;
17971
+ var getAllowImportingTsExtensions = _computedOptions.allowImportingTsExtensions.computeValue;
17972
+ var getEmitScriptTarget = _computedOptions.target.computeValue;
17973
+ var getEmitModuleKind = _computedOptions.module.computeValue;
17974
+ var getEmitModuleResolutionKind = _computedOptions.moduleResolution.computeValue;
17975
+ var getEmitModuleDetectionKind = _computedOptions.moduleDetection.computeValue;
17976
+ var getIsolatedModules = _computedOptions.isolatedModules.computeValue;
17977
+ var getESModuleInterop = _computedOptions.esModuleInterop.computeValue;
17978
+ var getAllowSyntheticDefaultImports = _computedOptions.allowSyntheticDefaultImports.computeValue;
17979
+ var getResolvePackageJsonExports = _computedOptions.resolvePackageJsonExports.computeValue;
17980
+ var getResolvePackageJsonImports = _computedOptions.resolvePackageJsonImports.computeValue;
17981
+ var getResolveJsonModule = _computedOptions.resolveJsonModule.computeValue;
17982
+ var getEmitDeclarations = _computedOptions.declaration.computeValue;
17983
+ var shouldPreserveConstEnums = _computedOptions.preserveConstEnums.computeValue;
17984
+ var isIncrementalCompilation = _computedOptions.incremental.computeValue;
17985
+ var getAreDeclarationMapsEnabled = _computedOptions.declarationMap.computeValue;
17986
+ var getAllowJSCompilerOption = _computedOptions.allowJs.computeValue;
17987
+ var getUseDefineForClassFields = _computedOptions.useDefineForClassFields.computeValue;
17930
17988
  function emitModuleKindIsNonNodeESM(moduleKind) {
17931
17989
  return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
17932
17990
  }
@@ -27024,23 +27082,21 @@ function hasRecordedExternalHelpers(sourceFile) {
27024
27082
  }
27025
27083
  function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault) {
27026
27084
  if (compilerOptions.importHelpers && isEffectiveExternalModule(sourceFile, compilerOptions)) {
27027
- let namedBindings;
27028
27085
  const moduleKind = getEmitModuleKind(compilerOptions);
27029
- if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions) === 99 /* ESNext */) {
27030
- const helpers = getEmitHelpers(sourceFile);
27086
+ const impliedModuleKind = getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions);
27087
+ const helpers = getImportedHelpers(sourceFile);
27088
+ if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || impliedModuleKind === 99 /* ESNext */ || impliedModuleKind === void 0 && moduleKind === 200 /* Preserve */) {
27031
27089
  if (helpers) {
27032
27090
  const helperNames = [];
27033
27091
  for (const helper of helpers) {
27034
- if (!helper.scoped) {
27035
- const importName = helper.importName;
27036
- if (importName) {
27037
- pushIfUnique(helperNames, importName);
27038
- }
27092
+ const importName = helper.importName;
27093
+ if (importName) {
27094
+ pushIfUnique(helperNames, importName);
27039
27095
  }
27040
27096
  }
27041
27097
  if (some(helperNames)) {
27042
27098
  helperNames.sort(compareStringsCaseSensitive);
27043
- namedBindings = nodeFactory.createNamedImports(
27099
+ const namedBindings = nodeFactory.createNamedImports(
27044
27100
  map(helperNames, (name) => isFileLevelUniqueName(sourceFile, name) ? nodeFactory.createImportSpecifier(
27045
27101
  /*isTypeOnly*/
27046
27102
  false,
@@ -27057,57 +27113,54 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
27057
27113
  const parseNode = getOriginalNode(sourceFile, isSourceFile);
27058
27114
  const emitNode = getOrCreateEmitNode(parseNode);
27059
27115
  emitNode.externalHelpers = true;
27116
+ const externalHelpersImportDeclaration = nodeFactory.createImportDeclaration(
27117
+ /*modifiers*/
27118
+ void 0,
27119
+ nodeFactory.createImportClause(
27120
+ /*isTypeOnly*/
27121
+ false,
27122
+ /*name*/
27123
+ void 0,
27124
+ namedBindings
27125
+ ),
27126
+ nodeFactory.createStringLiteral(externalHelpersModuleNameText),
27127
+ /*attributes*/
27128
+ void 0
27129
+ );
27130
+ addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
27131
+ return externalHelpersImportDeclaration;
27060
27132
  }
27061
27133
  }
27062
27134
  } else {
27063
- const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar || hasImportDefault);
27135
+ const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, helpers, hasExportStarsToExportValues, hasImportStar || hasImportDefault);
27064
27136
  if (externalHelpersModuleName) {
27065
- namedBindings = nodeFactory.createNamespaceImport(externalHelpersModuleName);
27066
- }
27067
- }
27068
- if (namedBindings) {
27069
- const externalHelpersImportDeclaration = nodeFactory.createImportDeclaration(
27070
- /*modifiers*/
27071
- void 0,
27072
- nodeFactory.createImportClause(
27137
+ const externalHelpersImportDeclaration = nodeFactory.createImportEqualsDeclaration(
27138
+ /*modifiers*/
27139
+ void 0,
27073
27140
  /*isTypeOnly*/
27074
27141
  false,
27075
- /*name*/
27076
- void 0,
27077
- namedBindings
27078
- ),
27079
- nodeFactory.createStringLiteral(externalHelpersModuleNameText),
27080
- /*attributes*/
27081
- void 0
27082
- );
27083
- addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
27084
- return externalHelpersImportDeclaration;
27142
+ externalHelpersModuleName,
27143
+ nodeFactory.createExternalModuleReference(nodeFactory.createStringLiteral(externalHelpersModuleNameText))
27144
+ );
27145
+ addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
27146
+ return externalHelpersImportDeclaration;
27147
+ }
27085
27148
  }
27086
27149
  }
27087
27150
  }
27088
- function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) {
27089
- if (compilerOptions.importHelpers && isEffectiveExternalModule(node, compilerOptions)) {
27090
- const externalHelpersModuleName = getExternalHelpersModuleName(node);
27091
- if (externalHelpersModuleName) {
27092
- return externalHelpersModuleName;
27093
- }
27094
- let create = (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && getEmitModuleFormatOfFileWorker(node, compilerOptions) < 4 /* System */;
27095
- if (!create) {
27096
- const helpers = getEmitHelpers(node);
27097
- if (helpers) {
27098
- for (const helper of helpers) {
27099
- if (!helper.scoped) {
27100
- create = true;
27101
- break;
27102
- }
27103
- }
27104
- }
27105
- }
27106
- if (create) {
27107
- const parseNode = getOriginalNode(node, isSourceFile);
27108
- const emitNode = getOrCreateEmitNode(parseNode);
27109
- return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory2.createUniqueName(externalHelpersModuleNameText));
27110
- }
27151
+ function getImportedHelpers(sourceFile) {
27152
+ return filter(getEmitHelpers(sourceFile), (helper) => !helper.scoped);
27153
+ }
27154
+ function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOptions, helpers, hasExportStarsToExportValues, hasImportStarOrImportDefault) {
27155
+ const externalHelpersModuleName = getExternalHelpersModuleName(node);
27156
+ if (externalHelpersModuleName) {
27157
+ return externalHelpersModuleName;
27158
+ }
27159
+ const create = some(helpers) || (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && getEmitModuleFormatOfFileWorker(node, compilerOptions) < 4 /* System */;
27160
+ if (create) {
27161
+ const parseNode = getOriginalNode(node, isSourceFile);
27162
+ const emitNode = getOrCreateEmitNode(parseNode);
27163
+ return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory2.createUniqueName(externalHelpersModuleNameText));
27111
27164
  }
27112
27165
  }
27113
27166
  function getLocalNameForExternalImport(factory2, node, sourceFile) {
@@ -36265,15 +36318,6 @@ var commandOptionsWithoutBuild = [
36265
36318
  paramType: Diagnostics.FILE_OR_DIRECTORY,
36266
36319
  description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json
36267
36320
  },
36268
- {
36269
- name: "build",
36270
- type: "boolean",
36271
- shortName: "b",
36272
- showInSimplifiedHelpView: true,
36273
- category: Diagnostics.Command_line_Options,
36274
- description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
36275
- defaultValueDescription: false
36276
- },
36277
36321
  {
36278
36322
  name: "showConfig",
36279
36323
  type: "boolean",
@@ -36798,6 +36842,15 @@ var commandOptionsWithoutBuild = [
36798
36842
  defaultValueDescription: false,
36799
36843
  transpileOptionValue: void 0
36800
36844
  },
36845
+ {
36846
+ name: "rewriteRelativeImportExtensions",
36847
+ type: "boolean",
36848
+ affectsSemanticDiagnostics: true,
36849
+ affectsBuildInfo: true,
36850
+ category: Diagnostics.Modules,
36851
+ description: Diagnostics.Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files,
36852
+ defaultValueDescription: false
36853
+ },
36801
36854
  {
36802
36855
  name: "resolvePackageJsonExports",
36803
36856
  type: "boolean",
@@ -37258,7 +37311,17 @@ var commandLineOptionOfCustomType = optionDeclarations.filter(isCommandLineOptio
37258
37311
  function isCommandLineOptionOfCustomType(option) {
37259
37312
  return !isString(option.type);
37260
37313
  }
37314
+ var tscBuildOption = {
37315
+ name: "build",
37316
+ type: "boolean",
37317
+ shortName: "b",
37318
+ showInSimplifiedHelpView: true,
37319
+ category: Diagnostics.Command_line_Options,
37320
+ description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
37321
+ defaultValueDescription: false
37322
+ };
37261
37323
  var optionsForBuild = [
37324
+ tscBuildOption,
37262
37325
  {
37263
37326
  name: "verbose",
37264
37327
  shortName: "v",
@@ -37394,8 +37457,14 @@ function getOptionName(option) {
37394
37457
  }
37395
37458
  function createUnknownOptionError(unknownOption, diagnostics, unknownOptionErrorText, node, sourceFile) {
37396
37459
  var _a;
37397
- if ((_a = diagnostics.alternateMode) == null ? void 0 : _a.getOptionsNameMap().optionsNameMap.has(unknownOption.toLowerCase())) {
37398
- return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.alternateMode.diagnostic, unknownOption);
37460
+ const otherOption = (_a = diagnostics.alternateMode) == null ? void 0 : _a.getOptionsNameMap().optionsNameMap.get(unknownOption.toLowerCase());
37461
+ if (otherOption) {
37462
+ return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(
37463
+ sourceFile,
37464
+ node,
37465
+ otherOption !== tscBuildOption ? diagnostics.alternateMode.diagnostic : Diagnostics.Option_build_must_be_the_first_command_line_argument,
37466
+ unknownOption
37467
+ );
37399
37468
  }
37400
37469
  const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);
37401
37470
  return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption);
@@ -37581,10 +37650,10 @@ var buildOptionsDidYouMeanDiagnostics = {
37581
37650
  unknownDidYouMeanDiagnostic: Diagnostics.Unknown_build_option_0_Did_you_mean_1,
37582
37651
  optionTypeMismatchDiagnostic: Diagnostics.Build_option_0_requires_a_value_of_type_1
37583
37652
  };
37584
- function parseBuildCommand(args) {
37653
+ function parseBuildCommand(commandLine) {
37585
37654
  const { options, watchOptions, fileNames: projects, errors } = parseCommandLineWorker(
37586
37655
  buildOptionsDidYouMeanDiagnostics,
37587
- args
37656
+ commandLine
37588
37657
  );
37589
37658
  const buildOptions = options;
37590
37659
  if (projects.length === 0) {
@@ -38508,7 +38577,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
38508
38577
  if (ownConfig.raw.compileOnSave === void 0 && result.compileOnSave) ownConfig.raw.compileOnSave = result.compileOnSave;
38509
38578
  if (sourceFile && result.extendedSourceFiles) sourceFile.extendedSourceFiles = arrayFrom(result.extendedSourceFiles.keys());
38510
38579
  ownConfig.options = assign(result.options, ownConfig.options);
38511
- ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assign(result.watchOptions, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions;
38580
+ ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assignWatchOptions(result, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions;
38512
38581
  }
38513
38582
  return ownConfig;
38514
38583
  function applyExtendedConfig(result, extendedConfigPath) {
@@ -38532,9 +38601,14 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
38532
38601
  result.compileOnSave = extendsRaw.compileOnSave;
38533
38602
  }
38534
38603
  assign(result.options, extendedConfig.options);
38535
- result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assign({}, result.watchOptions, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions;
38604
+ result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assignWatchOptions(result, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions;
38536
38605
  }
38537
38606
  }
38607
+ function assignWatchOptions(result, watchOptions) {
38608
+ if (result.watchOptionsCopied) return assign(result.watchOptions, watchOptions);
38609
+ result.watchOptionsCopied = true;
38610
+ return assign({}, result.watchOptions, watchOptions);
38611
+ }
38538
38612
  }
38539
38613
  function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
38540
38614
  if (hasProperty(json, "excludes")) {
@@ -40407,10 +40481,11 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
40407
40481
  }
40408
40482
  return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state);
40409
40483
  }
40410
- function loadFileNameFromPackageJsonField(extensions, candidate, onlyRecordFailures, state) {
40484
+ function loadFileNameFromPackageJsonField(extensions, candidate, packageJsonValue, onlyRecordFailures, state) {
40411
40485
  if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
40412
40486
  const result = tryFile(candidate, onlyRecordFailures, state);
40413
- return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate), resolvedUsingTsExtension: void 0 } : void 0;
40487
+ const ext = tryExtractTSExtension(candidate);
40488
+ return result !== void 0 ? { path: candidate, ext, resolvedUsingTsExtension: packageJsonValue ? !endsWith(packageJsonValue, ext) : void 0 } : void 0;
40414
40489
  }
40415
40490
  if (state.isConfigLookup && extensions === 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
40416
40491
  const result = tryFile(candidate, onlyRecordFailures, state);
@@ -40502,7 +40577,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
40502
40577
  };
40503
40578
  }
40504
40579
  function getPackageScopeForPath(directory, state) {
40505
- return forEachAncestorDirectory(
40580
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
40581
+ state.host,
40506
40582
  directory,
40507
40583
  (dir) => getPackageJsonInfo(
40508
40584
  dir,
@@ -40598,7 +40674,14 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
40598
40674
  }
40599
40675
  }
40600
40676
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
40601
- const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
40677
+ const fromFile = loadFileNameFromPackageJsonField(
40678
+ extensions2,
40679
+ candidate2,
40680
+ /*packageJsonValue*/
40681
+ void 0,
40682
+ onlyRecordFailures2,
40683
+ state2
40684
+ );
40602
40685
  if (fromFile) {
40603
40686
  return noPackageId(fromFile);
40604
40687
  }
@@ -40807,13 +40890,13 @@ function comparePatternKeys(a, b) {
40807
40890
  const bPatternIndex = b.indexOf("*");
40808
40891
  const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
40809
40892
  const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
40810
- if (baseLenA > baseLenB) return -1;
40811
- if (baseLenB > baseLenA) return 1;
40812
- if (aPatternIndex === -1) return 1;
40813
- if (bPatternIndex === -1) return -1;
40814
- if (a.length > b.length) return -1;
40815
- if (b.length > a.length) return 1;
40816
- return 0;
40893
+ if (baseLenA > baseLenB) return -1 /* LessThan */;
40894
+ if (baseLenB > baseLenA) return 1 /* GreaterThan */;
40895
+ if (aPatternIndex === -1) return 1 /* GreaterThan */;
40896
+ if (bPatternIndex === -1) return -1 /* LessThan */;
40897
+ if (a.length > b.length) return -1 /* LessThan */;
40898
+ if (b.length > a.length) return 1 /* GreaterThan */;
40899
+ return 0 /* EqualTo */;
40817
40900
  }
40818
40901
  function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
40819
40902
  const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
@@ -40954,6 +41037,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
40954
41037
  return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
40955
41038
  extensions,
40956
41039
  finalPath,
41040
+ target,
40957
41041
  /*onlyRecordFailures*/
40958
41042
  false,
40959
41043
  state
@@ -41066,6 +41150,8 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
41066
41150
  return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
41067
41151
  extensions,
41068
41152
  possibleInputWithInputExtension,
41153
+ /*packageJsonValue*/
41154
+ void 0,
41069
41155
  /*onlyRecordFailures*/
41070
41156
  false,
41071
41157
  state
@@ -41141,17 +41227,30 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
41141
41227
  return lookup(secondaryExtensions);
41142
41228
  }
41143
41229
  function lookup(extensions2) {
41144
- return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
41145
- if (getBaseFileName(ancestorDirectory) !== "node_modules") {
41146
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
41147
- if (resolutionFromCache) {
41148
- return resolutionFromCache;
41230
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
41231
+ state.host,
41232
+ normalizeSlashes(directory),
41233
+ (ancestorDirectory) => {
41234
+ if (getBaseFileName(ancestorDirectory) !== "node_modules") {
41235
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
41236
+ if (resolutionFromCache) {
41237
+ return resolutionFromCache;
41238
+ }
41239
+ return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
41149
41240
  }
41150
- return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
41151
41241
  }
41152
- });
41242
+ );
41153
41243
  }
41154
41244
  }
41245
+ function forEachAncestorDirectoryStoppingAtGlobalCache(host, directory, callback) {
41246
+ var _a;
41247
+ const globalCache = (_a = host == null ? void 0 : host.getGlobalTypingsCacheLocation) == null ? void 0 : _a.call(host);
41248
+ return forEachAncestorDirectory(directory, (ancestorDirectory) => {
41249
+ const result = callback(ancestorDirectory);
41250
+ if (result !== void 0) return result;
41251
+ if (ancestorDirectory === globalCache) return false;
41252
+ }) || void 0;
41253
+ }
41155
41254
  function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
41156
41255
  const nodeModulesFolder = combinePaths(directory, "node_modules");
41157
41256
  const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host);
@@ -41347,28 +41446,32 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
41347
41446
  return { value: resolvedUsingSettings };
41348
41447
  }
41349
41448
  if (!isExternalModuleNameRelative(moduleName)) {
41350
- const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => {
41351
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
41352
- cache,
41353
- moduleName,
41354
- /*mode*/
41355
- void 0,
41356
- directory,
41357
- redirectedReference,
41358
- state
41359
- );
41360
- if (resolutionFromCache) {
41361
- return resolutionFromCache;
41362
- }
41363
- const searchName = normalizePath(combinePaths(directory, moduleName));
41364
- return toSearchResult(loadModuleFromFileNoPackageId(
41365
- extensions,
41366
- searchName,
41367
- /*onlyRecordFailures*/
41368
- false,
41369
- state
41370
- ));
41371
- });
41449
+ const resolved2 = forEachAncestorDirectoryStoppingAtGlobalCache(
41450
+ state.host,
41451
+ containingDirectory,
41452
+ (directory) => {
41453
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
41454
+ cache,
41455
+ moduleName,
41456
+ /*mode*/
41457
+ void 0,
41458
+ directory,
41459
+ redirectedReference,
41460
+ state
41461
+ );
41462
+ if (resolutionFromCache) {
41463
+ return resolutionFromCache;
41464
+ }
41465
+ const searchName = normalizePath(combinePaths(directory, moduleName));
41466
+ return toSearchResult(loadModuleFromFileNoPackageId(
41467
+ extensions,
41468
+ searchName,
41469
+ /*onlyRecordFailures*/
41470
+ false,
41471
+ state
41472
+ ));
41473
+ }
41474
+ );
41372
41475
  if (resolved2) return resolved2;
41373
41476
  if (extensions & (1 /* TypeScript */ | 4 /* Declaration */)) {
41374
41477
  let resolved3 = loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state);
@@ -41411,7 +41514,7 @@ function resolveFromTypeRoot(moduleName, state) {
41411
41514
  }
41412
41515
  }
41413
41516
  function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
41414
- return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName);
41517
+ return getAllowImportingTsExtensions(compilerOptions) || !!fromFileName && isDeclarationFileName(fromFileName);
41415
41518
  }
41416
41519
  function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
41417
41520
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -44890,9 +44993,11 @@ function getNearestAncestorDirectoryWithPackageJson(host, fileName) {
44890
44993
  if (host.getNearestAncestorDirectoryWithPackageJson) {
44891
44994
  return host.getNearestAncestorDirectoryWithPackageJson(fileName);
44892
44995
  }
44893
- return forEachAncestorDirectory(fileName, (directory) => {
44894
- return host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0;
44895
- });
44996
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
44997
+ host,
44998
+ fileName,
44999
+ (directory) => host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0
45000
+ );
44896
45001
  }
44897
45002
  function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) {
44898
45003
  var _a;
@@ -44910,25 +45015,29 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref
44910
45015
  }
44911
45016
  const symlinkedDirectories = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
44912
45017
  const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd);
44913
- const result = symlinkedDirectories && forEachAncestorDirectory(getDirectoryPath(fullImportedFileName), (realPathDirectory) => {
44914
- const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath(realPathDirectory, cwd, getCanonicalFileName)));
44915
- if (!symlinkDirectories) return void 0;
44916
- if (startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) {
44917
- return false;
44918
- }
44919
- return forEach(targets, (target) => {
44920
- if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
44921
- return;
44922
- }
44923
- const relative = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
44924
- for (const symlinkDirectory of symlinkDirectories) {
44925
- const option = resolvePath(symlinkDirectory, relative);
44926
- const result2 = cb(option, target === referenceRedirect);
44927
- shouldFilterIgnoredPaths = true;
44928
- if (result2) return result2;
45018
+ const result = symlinkedDirectories && forEachAncestorDirectoryStoppingAtGlobalCache(
45019
+ host,
45020
+ getDirectoryPath(fullImportedFileName),
45021
+ (realPathDirectory) => {
45022
+ const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath(realPathDirectory, cwd, getCanonicalFileName)));
45023
+ if (!symlinkDirectories) return void 0;
45024
+ if (startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) {
45025
+ return false;
44929
45026
  }
44930
- });
44931
- });
45027
+ return forEach(targets, (target) => {
45028
+ if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
45029
+ return;
45030
+ }
45031
+ const relative = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
45032
+ for (const symlinkDirectory of symlinkDirectories) {
45033
+ const option = resolvePath(symlinkDirectory, relative);
45034
+ const result2 = cb(option, target === referenceRedirect);
45035
+ shouldFilterIgnoredPaths = true;
45036
+ if (result2) return result2;
45037
+ }
45038
+ });
45039
+ }
45040
+ );
44932
45041
  return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
44933
45042
  }
44934
45043
  var runtimeDependencyFields = ["dependencies", "peerDependencies", "optionalDependencies"];
@@ -45812,6 +45921,7 @@ function createTypeChecker(host) {
45812
45921
  getBaseTypeOfLiteralType,
45813
45922
  getWidenedType,
45814
45923
  getWidenedLiteralType,
45924
+ fillMissingTypeArguments,
45815
45925
  getTypeFromTypeNode: (nodeIn) => {
45816
45926
  const node = getParseTreeNode(nodeIn, isTypeNode);
45817
45927
  return node ? getTypeFromTypeNode(node) : errorType;
@@ -48655,6 +48765,36 @@ function createTypeChecker(host) {
48655
48765
  const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
48656
48766
  error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
48657
48767
  }
48768
+ } else if (compilerOptions.rewriteRelativeImportExtensions && !(location.flags & 33554432 /* Ambient */) && !isDeclarationFileName(moduleReference) && !isLiteralImportTypeNode(location) && !isPartOfTypeOnlyImportOrExportDeclaration(location)) {
48769
+ const shouldRewrite = shouldRewriteModuleSpecifier(moduleReference, compilerOptions);
48770
+ if (!resolvedModule.resolvedUsingTsExtension && shouldRewrite) {
48771
+ error(
48772
+ errorNode,
48773
+ Diagnostics.This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0,
48774
+ getRelativePathFromFile(getNormalizedAbsolutePath(currentSourceFile.fileName, host.getCurrentDirectory()), resolvedModule.resolvedFileName, hostGetCanonicalFileName(host))
48775
+ );
48776
+ } else if (resolvedModule.resolvedUsingTsExtension && !shouldRewrite && sourceFileMayBeEmitted(sourceFile, host)) {
48777
+ error(
48778
+ errorNode,
48779
+ Diagnostics.This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path,
48780
+ getAnyExtensionFromPath(moduleReference)
48781
+ );
48782
+ } else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) {
48783
+ const redirect = host.getResolvedProjectReferenceToRedirect(sourceFile.path);
48784
+ if (redirect) {
48785
+ const ignoreCase = !host.useCaseSensitiveFileNames();
48786
+ const ownRootDir = host.getCommonSourceDirectory();
48787
+ const otherRootDir = getCommonSourceDirectoryOfConfig(redirect.commandLine, ignoreCase);
48788
+ const rootDirPath = getRelativePathFromDirectory(ownRootDir, otherRootDir, ignoreCase);
48789
+ const outDirPath = getRelativePathFromDirectory(compilerOptions.outDir || ownRootDir, redirect.commandLine.options.outDir || otherRootDir, ignoreCase);
48790
+ if (rootDirPath !== outDirPath) {
48791
+ error(
48792
+ errorNode,
48793
+ Diagnostics.This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files
48794
+ );
48795
+ }
48796
+ }
48797
+ }
48658
48798
  }
48659
48799
  if (sourceFile.symbol) {
48660
48800
  if (errorNode && resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
@@ -52466,7 +52606,7 @@ function createTypeChecker(host) {
52466
52606
  }
52467
52607
  return factory.updateImportTypeNode(
52468
52608
  node,
52469
- factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
52609
+ factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier2(node, node.argument.literal)),
52470
52610
  visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes),
52471
52611
  visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName),
52472
52612
  visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
@@ -52620,7 +52760,7 @@ function createTypeChecker(host) {
52620
52760
  function getNameForJSDocFunctionParameter(p, index) {
52621
52761
  return p.name && isIdentifier(p.name) && p.name.escapedText === "this" ? "this" : getEffectiveDotDotDotForParameter(p) ? `args` : `arg${index}`;
52622
52762
  }
52623
- function rewriteModuleSpecifier(parent, lit) {
52763
+ function rewriteModuleSpecifier2(parent, lit) {
52624
52764
  if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) {
52625
52765
  let name = lit.text;
52626
52766
  const nodeSymbol = getNodeLinks(node).resolvedSymbol;
@@ -56343,20 +56483,11 @@ function createTypeChecker(host) {
56343
56483
  return type;
56344
56484
  }
56345
56485
  function isLateBindableName(node) {
56346
- return isLateBindableAST(node) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression));
56347
- }
56348
- function isLateBindableIndexSignature(node) {
56349
- return isLateBindableAST(node) && isTypeUsableAsIndexSignature(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression));
56350
- }
56351
- function isLateBindableAST(node) {
56352
56486
  if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) {
56353
56487
  return false;
56354
56488
  }
56355
56489
  const expr = isComputedPropertyName(node) ? node.expression : node.argumentExpression;
56356
- return isEntityNameExpression(expr);
56357
- }
56358
- function isTypeUsableAsIndexSignature(type) {
56359
- return isTypeAssignableTo(type, stringNumberSymbolType);
56490
+ return isEntityNameExpression(expr) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr));
56360
56491
  }
56361
56492
  function isLateBoundName(name) {
56362
56493
  return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) === 64 /* at */;
@@ -56365,10 +56496,6 @@ function createTypeChecker(host) {
56365
56496
  const name = getNameOfDeclaration(node);
56366
56497
  return !!name && isLateBindableName(name);
56367
56498
  }
56368
- function hasLateBindableIndexSignature(node) {
56369
- const name = getNameOfDeclaration(node);
56370
- return !!name && isLateBindableIndexSignature(name);
56371
- }
56372
56499
  function hasBindableName(node) {
56373
56500
  return !hasDynamicName(node) || hasLateBindableName(node);
56374
56501
  }
@@ -56422,24 +56549,6 @@ function createTypeChecker(host) {
56422
56549
  }
56423
56550
  return links.resolvedSymbol;
56424
56551
  }
56425
- function lateBindIndexSignature(parent, earlySymbols, lateSymbols, decl) {
56426
- let indexSymbol = lateSymbols.get("__index" /* Index */);
56427
- if (!indexSymbol) {
56428
- const early = earlySymbols == null ? void 0 : earlySymbols.get("__index" /* Index */);
56429
- if (!early) {
56430
- indexSymbol = createSymbol(0 /* None */, "__index" /* Index */, 4096 /* Late */);
56431
- } else {
56432
- indexSymbol = cloneSymbol(early);
56433
- indexSymbol.links.checkFlags |= 4096 /* Late */;
56434
- }
56435
- lateSymbols.set("__index" /* Index */, indexSymbol);
56436
- }
56437
- if (!indexSymbol.declarations) {
56438
- indexSymbol.declarations = [decl];
56439
- } else if (!decl.symbol.isReplaceableByMethod) {
56440
- indexSymbol.declarations.push(decl);
56441
- }
56442
- }
56443
56552
  function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) {
56444
56553
  const links = getSymbolLinks(symbol);
56445
56554
  if (!links[resolutionKind]) {
@@ -56454,8 +56563,6 @@ function createTypeChecker(host) {
56454
56563
  if (isStatic2 === hasStaticModifier(member)) {
56455
56564
  if (hasLateBindableName(member)) {
56456
56565
  lateBindMember(symbol, earlySymbols, lateSymbols, member);
56457
- } else if (hasLateBindableIndexSignature(member)) {
56458
- lateBindIndexSignature(symbol, earlySymbols, lateSymbols, member);
56459
56566
  }
56460
56567
  }
56461
56568
  }
@@ -58719,7 +58826,7 @@ function createTypeChecker(host) {
58719
58826
  return signature.isolatedSignatureType;
58720
58827
  }
58721
58828
  function getIndexSymbol(symbol) {
58722
- return symbol.members ? getIndexSymbolFromSymbolTable(getMembersOfSymbol(symbol)) : void 0;
58829
+ return symbol.members ? getIndexSymbolFromSymbolTable(symbol.members) : void 0;
58723
58830
  }
58724
58831
  function getIndexSymbolFromSymbolTable(symbolTable) {
58725
58832
  return symbolTable.get("__index" /* Index */);
@@ -58735,25 +58842,15 @@ function createTypeChecker(host) {
58735
58842
  if (indexSymbol.declarations) {
58736
58843
  const indexInfos = [];
58737
58844
  for (const declaration of indexSymbol.declarations) {
58738
- if (isIndexSignatureDeclaration(declaration)) {
58739
- if (declaration.parameters.length === 1) {
58740
- const parameter = declaration.parameters[0];
58741
- if (parameter.type) {
58742
- forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
58743
- if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
58744
- indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
58745
- }
58746
- });
58747
- }
58845
+ if (declaration.parameters.length === 1) {
58846
+ const parameter = declaration.parameters[0];
58847
+ if (parameter.type) {
58848
+ forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
58849
+ if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
58850
+ indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
58851
+ }
58852
+ });
58748
58853
  }
58749
- } else if (hasLateBindableIndexSignature(declaration)) {
58750
- const declName = isBinaryExpression(declaration) ? declaration.left : declaration.name;
58751
- const keyType = isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName);
58752
- forEachType(keyType, (keyType2) => {
58753
- if (isValidIndexKeyType(keyType2) && !findIndexInfo(indexInfos, keyType2)) {
58754
- indexInfos.push(createIndexInfo(keyType2, getTypeOfVariableOrParameterOrProperty(declaration.symbol), hasEffectiveModifier(declaration, 8 /* Readonly */)));
58755
- }
58756
- });
58757
58854
  }
58758
58855
  }
58759
58856
  return indexInfos;
@@ -72486,7 +72583,7 @@ function createTypeChecker(host) {
72486
72583
  return globalRegExpType;
72487
72584
  }
72488
72585
  function checkSpreadExpression(node, checkMode) {
72489
- if (languageVersion < 2 /* SpreadElements */) {
72586
+ if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) {
72490
72587
  checkExternalEmitHelpers(node, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
72491
72588
  }
72492
72589
  const arrayOrIterableType = checkExpression(node.expression, checkMode);
@@ -72520,7 +72617,7 @@ function createTypeChecker(host) {
72520
72617
  for (let i = 0; i < elementCount; i++) {
72521
72618
  const e = elements[i];
72522
72619
  if (e.kind === 230 /* SpreadElement */) {
72523
- if (languageVersion < 2 /* SpreadElements */) {
72620
+ if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) {
72524
72621
  checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
72525
72622
  }
72526
72623
  const spreadType = checkExpression(e.expression, checkMode, forceTuple);
@@ -72745,7 +72842,7 @@ function createTypeChecker(host) {
72745
72842
  addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
72746
72843
  }
72747
72844
  } else if (memberDecl.kind === 305 /* SpreadAssignment */) {
72748
- if (languageVersion < 2 /* ObjectAssign */) {
72845
+ if (languageVersion < LanguageFeatureMinimumTarget.ObjectAssign) {
72749
72846
  checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
72750
72847
  }
72751
72848
  if (propertiesArray.length > 0) {
@@ -73722,7 +73819,7 @@ function createTypeChecker(host) {
73722
73819
  const isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType;
73723
73820
  let prop;
73724
73821
  if (isPrivateIdentifier(right)) {
73725
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
73822
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
73726
73823
  if (assignmentKind !== 0 /* None */) {
73727
73824
  checkExternalEmitHelpers(node, 1048576 /* ClassPrivateFieldSet */);
73728
73825
  }
@@ -76339,7 +76436,7 @@ function createTypeChecker(host) {
76339
76436
  }
76340
76437
  function checkTaggedTemplateExpression(node) {
76341
76438
  if (!checkGrammarTaggedTemplateChain(node)) checkGrammarTypeArguments(node, node.typeArguments);
76342
- if (languageVersion < 2 /* TaggedTemplates */) {
76439
+ if (languageVersion < LanguageFeatureMinimumTarget.TaggedTemplates) {
76343
76440
  checkExternalEmitHelpers(node, 262144 /* MakeTemplateObject */);
76344
76441
  }
76345
76442
  const signature = getResolvedSignature(node);
@@ -78051,7 +78148,7 @@ function createTypeChecker(host) {
78051
78148
  return silentNeverType;
78052
78149
  }
78053
78150
  if (isPrivateIdentifier(left)) {
78054
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
78151
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
78055
78152
  checkExternalEmitHelpers(left, 2097152 /* ClassPrivateFieldIn */);
78056
78153
  }
78057
78154
  if (!getNodeLinks(left).resolvedSymbol && getContainingClass(left)) {
@@ -78112,7 +78209,7 @@ function createTypeChecker(host) {
78112
78209
  if (propertyIndex < properties.length - 1) {
78113
78210
  error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
78114
78211
  } else {
78115
- if (languageVersion < 5 /* ObjectSpreadRest */) {
78212
+ if (languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) {
78116
78213
  checkExternalEmitHelpers(property, 4 /* Rest */);
78117
78214
  }
78118
78215
  const nonRestNames = [];
@@ -78133,7 +78230,7 @@ function createTypeChecker(host) {
78133
78230
  }
78134
78231
  function checkArrayLiteralAssignment(node, sourceType, checkMode) {
78135
78232
  const elements = node.elements;
78136
- if (languageVersion < 2 /* DestructuringAssignment */ && compilerOptions.downlevelIteration) {
78233
+ if (languageVersion < LanguageFeatureMinimumTarget.DestructuringAssignment && compilerOptions.downlevelIteration) {
78137
78234
  checkExternalEmitHelpers(node, 512 /* Read */);
78138
78235
  }
78139
78236
  const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;
@@ -78907,10 +79004,10 @@ function createTypeChecker(host) {
78907
79004
  }
78908
79005
  const isAsync = (functionFlags & 2 /* Async */) !== 0;
78909
79006
  if (node.asteriskToken) {
78910
- if (isAsync && languageVersion < 5 /* AsyncGenerators */) {
79007
+ if (isAsync && languageVersion < LanguageFeatureMinimumTarget.AsyncGenerators) {
78911
79008
  checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */);
78912
79009
  }
78913
- if (!isAsync && languageVersion < 2 /* Generators */ && compilerOptions.downlevelIteration) {
79010
+ if (!isAsync && languageVersion < LanguageFeatureMinimumTarget.Generators && compilerOptions.downlevelIteration) {
78914
79011
  checkExternalEmitHelpers(node, 256 /* Values */);
78915
79012
  }
78916
79013
  }
@@ -79740,13 +79837,13 @@ function createTypeChecker(host) {
79740
79837
  }
79741
79838
  const functionFlags = getFunctionFlags(node);
79742
79839
  if (!(functionFlags & 4 /* Invalid */)) {
79743
- if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 5 /* AsyncGenerators */) {
79840
+ if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < LanguageFeatureMinimumTarget.AsyncGenerators) {
79744
79841
  checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */);
79745
79842
  }
79746
- if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* AsyncFunctions */) {
79843
+ if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < LanguageFeatureMinimumTarget.AsyncFunctions) {
79747
79844
  checkExternalEmitHelpers(node, 64 /* Awaiter */);
79748
79845
  }
79749
- if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /* Generators */) {
79846
+ if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < LanguageFeatureMinimumTarget.Generators) {
79750
79847
  checkExternalEmitHelpers(node, 128 /* Generator */);
79751
79848
  }
79752
79849
  }
@@ -79929,17 +80026,15 @@ function createTypeChecker(host) {
79929
80026
  if (indexSymbol == null ? void 0 : indexSymbol.declarations) {
79930
80027
  const indexSignatureMap = /* @__PURE__ */ new Map();
79931
80028
  for (const declaration of indexSymbol.declarations) {
79932
- if (isIndexSignatureDeclaration(declaration)) {
79933
- if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
79934
- forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => {
79935
- const entry = indexSignatureMap.get(getTypeId(type));
79936
- if (entry) {
79937
- entry.declarations.push(declaration);
79938
- } else {
79939
- indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] });
79940
- }
79941
- });
79942
- }
80029
+ if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
80030
+ forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => {
80031
+ const entry = indexSignatureMap.get(getTypeId(type));
80032
+ if (entry) {
80033
+ entry.declarations.push(declaration);
80034
+ } else {
80035
+ indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] });
80036
+ }
80037
+ });
79943
80038
  }
79944
80039
  }
79945
80040
  indexSignatureMap.forEach((entry) => {
@@ -79981,7 +80076,7 @@ function createTypeChecker(host) {
79981
80076
  }
79982
80077
  function setNodeLinksForPrivateIdentifierScope(node) {
79983
80078
  if (isPrivateIdentifier(node.name)) {
79984
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
80079
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
79985
80080
  for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
79986
80081
  getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
79987
80082
  }
@@ -81121,7 +81216,7 @@ function createTypeChecker(host) {
81121
81216
  if (node.kind === 169 /* Parameter */) {
81122
81217
  checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
81123
81218
  }
81124
- } else if (languageVersion < 99 /* ClassAndClassElementDecorators */) {
81219
+ } else if (languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators) {
81125
81220
  checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */);
81126
81221
  if (isClassDeclaration(node)) {
81127
81222
  if (!node.name) {
@@ -81787,7 +81882,7 @@ function createTypeChecker(host) {
81787
81882
  potentialUnusedRenamedBindingElementsInTypes.push(node);
81788
81883
  return;
81789
81884
  }
81790
- if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ObjectSpreadRest */) {
81885
+ if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) {
81791
81886
  checkExternalEmitHelpers(node, 4 /* Rest */);
81792
81887
  }
81793
81888
  if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
@@ -81823,7 +81918,7 @@ function createTypeChecker(host) {
81823
81918
  }
81824
81919
  }
81825
81920
  if (isBindingPattern(node.name)) {
81826
- if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* BindingPatterns */ && compilerOptions.downlevelIteration) {
81921
+ if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < LanguageFeatureMinimumTarget.BindingPatterns && compilerOptions.downlevelIteration) {
81827
81922
  checkExternalEmitHelpers(node, 512 /* Read */);
81828
81923
  }
81829
81924
  forEach(node.name.elements, checkSourceElement);
@@ -81977,7 +82072,7 @@ function createTypeChecker(host) {
81977
82072
  }
81978
82073
  function checkVariableDeclarationList(node) {
81979
82074
  const blockScopeKind = getCombinedNodeFlags(node) & 7 /* BlockScoped */;
81980
- if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < 99 /* UsingAndAwaitUsing */) {
82075
+ if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < LanguageFeatureMinimumTarget.UsingAndAwaitUsing) {
81981
82076
  checkExternalEmitHelpers(node, 16777216 /* AddDisposableResourceAndDisposeResources */);
81982
82077
  }
81983
82078
  forEach(node.declarations, checkSourceElement);
@@ -82191,11 +82286,11 @@ function createTypeChecker(host) {
82191
82286
  grammarErrorOnNode(node.awaitModifier, Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block);
82192
82287
  } else {
82193
82288
  const functionFlags = getFunctionFlags(container);
82194
- if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 5 /* ForAwaitOf */) {
82289
+ if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < LanguageFeatureMinimumTarget.ForAwaitOf) {
82195
82290
  checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */);
82196
82291
  }
82197
82292
  }
82198
- } else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ForOf */) {
82293
+ } else if (compilerOptions.downlevelIteration && languageVersion < LanguageFeatureMinimumTarget.ForOf) {
82199
82294
  checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
82200
82295
  }
82201
82296
  if (node.initializer.kind === 261 /* VariableDeclarationList */) {
@@ -83236,12 +83331,12 @@ function createTypeChecker(host) {
83236
83331
  return true;
83237
83332
  }
83238
83333
  function getFirstTransformableStaticClassElement(node) {
83239
- const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */ && classOrConstructorParameterIsDecorated(
83334
+ const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators && classOrConstructorParameterIsDecorated(
83240
83335
  /*useLegacyDecorators*/
83241
83336
  false,
83242
83337
  node
83243
83338
  );
83244
- const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */;
83339
+ const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators;
83245
83340
  const willTransformInitializers = !emitStandardClassFields;
83246
83341
  if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
83247
83342
  for (const member of node.members) {
@@ -83268,7 +83363,7 @@ function createTypeChecker(host) {
83268
83363
  if (node.name) return;
83269
83364
  const parent = walkUpOuterExpressions(node);
83270
83365
  if (!isNamedEvaluationSource(parent)) return;
83271
- const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */;
83366
+ const willTransformESDecorators = !legacyDecorators && languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators;
83272
83367
  let location;
83273
83368
  if (willTransformESDecorators && classOrConstructorParameterIsDecorated(
83274
83369
  /*useLegacyDecorators*/
@@ -83328,7 +83423,7 @@ function createTypeChecker(host) {
83328
83423
  const baseTypeNode = getEffectiveBaseTypeNode(node);
83329
83424
  if (baseTypeNode) {
83330
83425
  forEach(baseTypeNode.typeArguments, checkSourceElement);
83331
- if (languageVersion < 2 /* Classes */) {
83426
+ if (languageVersion < LanguageFeatureMinimumTarget.Classes) {
83332
83427
  checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */);
83333
83428
  }
83334
83429
  const extendsNode = getClassExtendsHeritageElement(node);
@@ -86847,29 +86942,7 @@ function createTypeChecker(host) {
86847
86942
  return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, internalFlags, tracker);
86848
86943
  },
86849
86944
  isImportRequiredByAugmentation,
86850
- isDefinitelyReferenceToGlobalSymbolObject,
86851
- createLateBoundIndexSignatures: (cls, enclosing, flags, internalFlags, tracker) => {
86852
- const sym = cls.symbol;
86853
- const staticInfos = getIndexInfosOfType(getTypeOfSymbol(sym));
86854
- const instanceIndexSymbol = getIndexSymbol(sym);
86855
- const instanceInfos = instanceIndexSymbol && getIndexInfosOfIndexSymbol(instanceIndexSymbol);
86856
- let result;
86857
- for (const infoList of [staticInfos, instanceInfos]) {
86858
- if (!length(infoList)) continue;
86859
- result || (result = []);
86860
- for (const info of infoList) {
86861
- if (info.declaration) continue;
86862
- const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
86863
- if (node && infoList === staticInfos) {
86864
- (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
86865
- }
86866
- if (node) {
86867
- result.push(node);
86868
- }
86869
- }
86870
- }
86871
- return result;
86872
- }
86945
+ isDefinitelyReferenceToGlobalSymbolObject
86873
86946
  };
86874
86947
  function isImportRequiredByAugmentation(node) {
86875
86948
  const file = getSourceFileOfNode(node);
@@ -88761,7 +88834,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
88761
88834
  var _a;
88762
88835
  return (_a = host.getPackageJsonInfoCache) == null ? void 0 : _a.call(host);
88763
88836
  },
88764
- useCaseSensitiveFileNames: maybeBind(host, host.useCaseSensitiveFileNames),
88837
+ useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
88765
88838
  redirectTargetsMap: host.redirectTargetsMap,
88766
88839
  getProjectReferenceRedirect: (fileName) => host.getProjectReferenceRedirect(fileName),
88767
88840
  isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
@@ -88769,7 +88842,8 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
88769
88842
  getFileIncludeReasons: () => host.getFileIncludeReasons(),
88770
88843
  readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0,
88771
88844
  getDefaultResolutionModeForFile: (file) => host.getDefaultResolutionModeForFile(file),
88772
- getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index)
88845
+ getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index),
88846
+ getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
88773
88847
  };
88774
88848
  }
88775
88849
  var SymbolTrackerImpl = class _SymbolTrackerImpl {
@@ -91027,6 +91101,13 @@ function isSimpleParameter(node) {
91027
91101
  function isSimpleParameterList(nodes) {
91028
91102
  return every(nodes, isSimpleParameter);
91029
91103
  }
91104
+ function rewriteModuleSpecifier(node, compilerOptions) {
91105
+ if (!node || !isStringLiteral(node) || !shouldRewriteModuleSpecifier(node.text, compilerOptions)) {
91106
+ return node;
91107
+ }
91108
+ const updatedText = changeExtension(node.text, getOutputExtension(node.text, compilerOptions));
91109
+ return updatedText !== node.text ? setOriginalNode(setTextRange(factory.createStringLiteral(updatedText, node.singleQuote), node), node) : node;
91110
+ }
91030
91111
 
91031
91112
  // src/compiler/transformers/destructuring.ts
91032
91113
  function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) {
@@ -93345,7 +93426,14 @@ function transformTypeScript(context) {
93345
93426
  return void 0;
93346
93427
  }
93347
93428
  if (!node.exportClause || isNamespaceExport(node.exportClause)) {
93348
- return node;
93429
+ return factory2.updateExportDeclaration(
93430
+ node,
93431
+ node.modifiers,
93432
+ node.isTypeOnly,
93433
+ node.exportClause,
93434
+ node.moduleSpecifier,
93435
+ node.attributes
93436
+ );
93349
93437
  }
93350
93438
  const allowEmpty = !!compilerOptions.verbatimModuleSyntax;
93351
93439
  const exportClause = visitNode(
@@ -93384,8 +93472,10 @@ function transformTypeScript(context) {
93384
93472
  return void 0;
93385
93473
  }
93386
93474
  if (isExternalModuleImportEqualsDeclaration(node)) {
93387
- const isReferenced = shouldEmitAliasDeclaration(node);
93388
- return isReferenced ? visitEachChild(node, visitor, context) : void 0;
93475
+ if (!shouldEmitAliasDeclaration(node)) {
93476
+ return void 0;
93477
+ }
93478
+ return visitEachChild(node, visitor, context);
93389
93479
  }
93390
93480
  if (!shouldEmitImportEqualsDeclaration(node)) {
93391
93481
  return void 0;
@@ -108752,7 +108842,7 @@ function transformModule(context) {
108752
108842
  }
108753
108843
  const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions);
108754
108844
  const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression);
108755
- const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
108845
+ const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : rewriteModuleSpecifier(firstArgument, compilerOptions);
108756
108846
  const containsLexicalThis = !!(node.transformFlags & 16384 /* ContainsLexicalThis */);
108757
108847
  switch (compilerOptions.module) {
108758
108848
  case 2 /* AMD */:
@@ -109083,7 +109173,7 @@ function transformModule(context) {
109083
109173
  const moduleName = getExternalModuleNameLiteral(factory2, importNode, currentSourceFile, host, resolver, compilerOptions);
109084
109174
  const args = [];
109085
109175
  if (moduleName) {
109086
- args.push(moduleName);
109176
+ args.push(rewriteModuleSpecifier(moduleName, compilerOptions));
109087
109177
  }
109088
109178
  return factory2.createCallExpression(
109089
109179
  factory2.createIdentifier("require"),
@@ -111178,6 +111268,8 @@ function transformECMAScriptModule(context) {
111178
111268
  context.onSubstituteNode = onSubstituteNode;
111179
111269
  context.enableEmitNotification(307 /* SourceFile */);
111180
111270
  context.enableSubstitution(80 /* Identifier */);
111271
+ const noSubstitution = /* @__PURE__ */ new Set();
111272
+ let importCallsToRewrite;
111181
111273
  let helperNameSubstitutions;
111182
111274
  let currentSourceFile;
111183
111275
  let importRequireStatements;
@@ -111189,6 +111281,7 @@ function transformECMAScriptModule(context) {
111189
111281
  if (isExternalModule(node) || getIsolatedModules(compilerOptions)) {
111190
111282
  currentSourceFile = node;
111191
111283
  importRequireStatements = void 0;
111284
+ importCallsToRewrite = compilerOptions.rewriteRelativeImportExtensions ? mapDefined(node.imports, (name) => isImportCall(name.parent) && shouldRewriteModuleSpecifier(name.text, compilerOptions) ? name.parent : void 0) : void 0;
111192
111285
  let result = updateExternalModule(node);
111193
111286
  currentSourceFile = void 0;
111194
111287
  if (importRequireStatements) {
@@ -111212,7 +111305,7 @@ function transformECMAScriptModule(context) {
111212
111305
  if (externalHelpersImportDeclaration) {
111213
111306
  const statements = [];
111214
111307
  const statementOffset = factory2.copyPrologue(node.statements, statements);
111215
- append(statements, externalHelpersImportDeclaration);
111308
+ addRange(statements, visitArray([externalHelpersImportDeclaration], visitor, isStatement));
111216
111309
  addRange(statements, visitNodes2(node.statements, visitor, isStatement, statementOffset));
111217
111310
  return factory2.updateSourceFile(
111218
111311
  node,
@@ -111231,14 +111324,50 @@ function transformECMAScriptModule(context) {
111231
111324
  case 278 /* ExportDeclaration */:
111232
111325
  const exportDecl = node;
111233
111326
  return visitExportDeclaration(exportDecl);
111327
+ case 272 /* ImportDeclaration */:
111328
+ return visitImportDeclaration(node);
111329
+ case 213 /* CallExpression */:
111330
+ if (node === (importCallsToRewrite == null ? void 0 : importCallsToRewrite[0])) {
111331
+ importCallsToRewrite.shift();
111332
+ return visitImportCall(node);
111333
+ }
111334
+ break;
111335
+ default:
111336
+ if ((importCallsToRewrite == null ? void 0 : importCallsToRewrite.length) && rangeContainsRange(node, importCallsToRewrite[0])) {
111337
+ return visitEachChild(node, visitor, context);
111338
+ }
111234
111339
  }
111235
111340
  return node;
111236
111341
  }
111342
+ function visitImportDeclaration(node) {
111343
+ if (!compilerOptions.rewriteRelativeImportExtensions) {
111344
+ return node;
111345
+ }
111346
+ const updatedModuleSpecifier = rewriteModuleSpecifier(node.moduleSpecifier, compilerOptions);
111347
+ if (updatedModuleSpecifier === node.moduleSpecifier) {
111348
+ return node;
111349
+ }
111350
+ return factory2.updateImportDeclaration(
111351
+ node,
111352
+ node.modifiers,
111353
+ node.importClause,
111354
+ updatedModuleSpecifier,
111355
+ node.attributes
111356
+ );
111357
+ }
111358
+ function visitImportCall(node) {
111359
+ return factory2.updateCallExpression(
111360
+ node,
111361
+ node.expression,
111362
+ node.typeArguments,
111363
+ [rewriteModuleSpecifier(node.arguments[0], compilerOptions), ...node.arguments.slice(1)]
111364
+ );
111365
+ }
111237
111366
  function createRequireCall(importNode) {
111238
111367
  const moduleName = getExternalModuleNameLiteral(factory2, importNode, Debug.checkDefined(currentSourceFile), host, resolver, compilerOptions);
111239
111368
  const args = [];
111240
111369
  if (moduleName) {
111241
- args.push(moduleName);
111370
+ args.push(rewriteModuleSpecifier(moduleName, compilerOptions));
111242
111371
  }
111243
111372
  if (getEmitModuleKind(compilerOptions) === 200 /* Preserve */) {
111244
111373
  return factory2.createCallExpression(
@@ -111383,11 +111512,16 @@ function transformECMAScriptModule(context) {
111383
111512
  return node;
111384
111513
  }
111385
111514
  function visitExportDeclaration(node) {
111386
- if (compilerOptions.module !== void 0 && compilerOptions.module > 5 /* ES2015 */) {
111387
- return node;
111388
- }
111389
- if (!node.exportClause || !isNamespaceExport(node.exportClause) || !node.moduleSpecifier) {
111390
- return node;
111515
+ const updatedModuleSpecifier = rewriteModuleSpecifier(node.moduleSpecifier, compilerOptions);
111516
+ if (compilerOptions.module !== void 0 && compilerOptions.module > 5 /* ES2015 */ || !node.exportClause || !isNamespaceExport(node.exportClause) || !node.moduleSpecifier) {
111517
+ return !node.moduleSpecifier || updatedModuleSpecifier === node.moduleSpecifier ? node : factory2.updateExportDeclaration(
111518
+ node,
111519
+ node.modifiers,
111520
+ node.isTypeOnly,
111521
+ node.exportClause,
111522
+ updatedModuleSpecifier,
111523
+ node.attributes
111524
+ );
111391
111525
  }
111392
111526
  const oldIdentifier = node.exportClause.name;
111393
111527
  const synthName = factory2.getGeneratedNameForNode(oldIdentifier);
@@ -111403,7 +111537,7 @@ function transformECMAScriptModule(context) {
111403
111537
  synthName
111404
111538
  )
111405
111539
  ),
111406
- node.moduleSpecifier,
111540
+ updatedModuleSpecifier,
111407
111541
  node.attributes
111408
111542
  );
111409
111543
  setOriginalNode(importDecl, node.exportClause);
@@ -111427,7 +111561,9 @@ function transformECMAScriptModule(context) {
111427
111561
  if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) {
111428
111562
  helperNameSubstitutions = /* @__PURE__ */ new Map();
111429
111563
  }
111564
+ currentSourceFile = node;
111430
111565
  previousOnEmitNode(hint, node, emitCallback);
111566
+ currentSourceFile = void 0;
111431
111567
  helperNameSubstitutions = void 0;
111432
111568
  } else {
111433
111569
  previousOnEmitNode(hint, node, emitCallback);
@@ -111435,18 +111571,29 @@ function transformECMAScriptModule(context) {
111435
111571
  }
111436
111572
  function onSubstituteNode(hint, node) {
111437
111573
  node = previousOnSubstituteNode(hint, node);
111438
- if (helperNameSubstitutions && isIdentifier(node) && getEmitFlags(node) & 8192 /* HelperName */) {
111574
+ if (node.id && noSubstitution.has(node.id)) {
111575
+ return node;
111576
+ }
111577
+ if (isIdentifier(node) && getEmitFlags(node) & 8192 /* HelperName */) {
111439
111578
  return substituteHelperName(node);
111440
111579
  }
111441
111580
  return node;
111442
111581
  }
111443
111582
  function substituteHelperName(node) {
111444
- const name = idText(node);
111445
- let substitution = helperNameSubstitutions.get(name);
111446
- if (!substitution) {
111447
- helperNameSubstitutions.set(name, substitution = factory2.createUniqueName(name, 16 /* Optimistic */ | 32 /* FileLevel */));
111583
+ const externalHelpersModuleName = currentSourceFile && getExternalHelpersModuleName(currentSourceFile);
111584
+ if (externalHelpersModuleName) {
111585
+ noSubstitution.add(getNodeId(node));
111586
+ return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
111587
+ }
111588
+ if (helperNameSubstitutions) {
111589
+ const name = idText(node);
111590
+ let substitution = helperNameSubstitutions.get(name);
111591
+ if (!substitution) {
111592
+ helperNameSubstitutions.set(name, substitution = factory2.createUniqueName(name, 16 /* Optimistic */ | 32 /* FileLevel */));
111593
+ }
111594
+ return substitution;
111448
111595
  }
111449
- return substitution;
111596
+ return node;
111450
111597
  }
111451
111598
  }
111452
111599
 
@@ -112536,7 +112683,7 @@ function transformDeclarations(context) {
112536
112683
  }
112537
112684
  return setCommentRange(updated, getCommentRange(original));
112538
112685
  }
112539
- function rewriteModuleSpecifier(parent, input) {
112686
+ function rewriteModuleSpecifier2(parent, input) {
112540
112687
  if (!input) return void 0;
112541
112688
  resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 267 /* ModuleDeclaration */ && parent.kind !== 205 /* ImportType */;
112542
112689
  if (isStringLiteralLike(input)) {
@@ -112558,7 +112705,7 @@ function transformDeclarations(context) {
112558
112705
  decl.modifiers,
112559
112706
  decl.isTypeOnly,
112560
112707
  decl.name,
112561
- factory2.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier))
112708
+ factory2.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier2(decl, specifier))
112562
112709
  );
112563
112710
  } else {
112564
112711
  const oldDiag = getSymbolAccessibilityDiagnostic;
@@ -112574,7 +112721,7 @@ function transformDeclarations(context) {
112574
112721
  decl,
112575
112722
  decl.modifiers,
112576
112723
  decl.importClause,
112577
- rewriteModuleSpecifier(decl, decl.moduleSpecifier),
112724
+ rewriteModuleSpecifier2(decl, decl.moduleSpecifier),
112578
112725
  tryGetResolutionModeOverride(decl.attributes)
112579
112726
  );
112580
112727
  }
@@ -112590,7 +112737,7 @@ function transformDeclarations(context) {
112590
112737
  /*namedBindings*/
112591
112738
  void 0
112592
112739
  ),
112593
- rewriteModuleSpecifier(decl, decl.moduleSpecifier),
112740
+ rewriteModuleSpecifier2(decl, decl.moduleSpecifier),
112594
112741
  tryGetResolutionModeOverride(decl.attributes)
112595
112742
  );
112596
112743
  }
@@ -112608,7 +112755,7 @@ function transformDeclarations(context) {
112608
112755
  visibleDefaultBinding,
112609
112756
  namedBindings
112610
112757
  ),
112611
- rewriteModuleSpecifier(decl, decl.moduleSpecifier),
112758
+ rewriteModuleSpecifier2(decl, decl.moduleSpecifier),
112612
112759
  tryGetResolutionModeOverride(decl.attributes)
112613
112760
  ) : void 0;
112614
112761
  }
@@ -112623,7 +112770,7 @@ function transformDeclarations(context) {
112623
112770
  visibleDefaultBinding,
112624
112771
  bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
112625
112772
  ),
112626
- rewriteModuleSpecifier(decl, decl.moduleSpecifier),
112773
+ rewriteModuleSpecifier2(decl, decl.moduleSpecifier),
112627
112774
  tryGetResolutionModeOverride(decl.attributes)
112628
112775
  );
112629
112776
  }
@@ -112636,7 +112783,7 @@ function transformDeclarations(context) {
112636
112783
  decl.modifiers,
112637
112784
  /*importClause*/
112638
112785
  void 0,
112639
- rewriteModuleSpecifier(decl, decl.moduleSpecifier),
112786
+ rewriteModuleSpecifier2(decl, decl.moduleSpecifier),
112640
112787
  tryGetResolutionModeOverride(decl.attributes)
112641
112788
  );
112642
112789
  }
@@ -112950,7 +113097,7 @@ function transformDeclarations(context) {
112950
113097
  if (!isLiteralImportTypeNode(input)) return cleanup(input);
112951
113098
  return cleanup(factory2.updateImportTypeNode(
112952
113099
  input,
112953
- factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
113100
+ factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier2(input, input.argument.literal)),
112954
113101
  input.attributes,
112955
113102
  input.qualifier,
112956
113103
  visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
@@ -113003,7 +113150,7 @@ function transformDeclarations(context) {
113003
113150
  input.modifiers,
113004
113151
  input.isTypeOnly,
113005
113152
  input.exportClause,
113006
- rewriteModuleSpecifier(input, input.moduleSpecifier),
113153
+ rewriteModuleSpecifier2(input, input.moduleSpecifier),
113007
113154
  tryGetResolutionModeOverride(input.attributes)
113008
113155
  );
113009
113156
  }
@@ -113253,7 +113400,7 @@ function transformDeclarations(context) {
113253
113400
  return cleanup(updateModuleDeclarationAndKeyword(
113254
113401
  input,
113255
113402
  mods,
113256
- isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name,
113403
+ isExternalModuleAugmentation(input) ? rewriteModuleSpecifier2(input, input.name) : input.name,
113257
113404
  body
113258
113405
  ));
113259
113406
  } else {
@@ -113339,8 +113486,7 @@ function transformDeclarations(context) {
113339
113486
  void 0
113340
113487
  )
113341
113488
  ] : void 0;
113342
- const lateIndexes = resolver.createLateBoundIndexSignatures(input, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker);
113343
- const memberNodes = concatenate(concatenate(concatenate(privateIdentifier, lateIndexes), parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement));
113489
+ const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement));
113344
113490
  const members = factory2.createNodeArray(memberNodes);
113345
113491
  const extendsClause = getEffectiveBaseTypeNode(input);
113346
113492
  if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 106 /* NullKeyword */) {
@@ -114645,8 +114791,7 @@ var notImplementedResolver = {
114645
114791
  isBindingCapturedByNode: notImplemented,
114646
114792
  getDeclarationStatementsForSourceFile: notImplemented,
114647
114793
  isImportRequiredByAugmentation: notImplemented,
114648
- isDefinitelyReferenceToGlobalSymbolObject: notImplemented,
114649
- createLateBoundIndexSignatures: notImplemented
114794
+ isDefinitelyReferenceToGlobalSymbolObject: notImplemented
114650
114795
  };
114651
114796
  var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
114652
114797
  var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
@@ -120711,7 +120856,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
120711
120856
  getCanonicalFileName,
120712
120857
  getFileIncludeReasons: () => fileReasons,
120713
120858
  structureIsReused,
120714
- writeFile: writeFile2
120859
+ writeFile: writeFile2,
120860
+ getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
120715
120861
  };
120716
120862
  onProgramCreateComplete();
120717
120863
  verifyCompilerOptions();
@@ -121277,7 +121423,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121277
121423
  getFileIncludeReasons: program.getFileIncludeReasons,
121278
121424
  createHash: maybeBind(host, host.createHash),
121279
121425
  getModuleResolutionCache: () => program.getModuleResolutionCache(),
121280
- trace: maybeBind(host, host.trace)
121426
+ trace: maybeBind(host, host.trace),
121427
+ getGlobalTypingsCacheLocation: program.getGlobalTypingsCacheLocation
121281
121428
  };
121282
121429
  }
121283
121430
  function writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -122809,7 +122956,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
122809
122956
  createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax");
122810
122957
  }
122811
122958
  }
122812
- if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) {
122959
+ if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly || options.rewriteRelativeImportExtensions)) {
122813
122960
  createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);
122814
122961
  }
122815
122962
  const moduleResolution = getEmitModuleResolutionKind(options);
@@ -125583,6 +125730,9 @@ function canWatchDirectoryOrFile(pathComponents2, length2) {
125583
125730
  const perceivedOsRootLength = perceivedOsRootLengthForWatching(pathComponents2, length2);
125584
125731
  return length2 > perceivedOsRootLength + 1;
125585
125732
  }
125733
+ function canWatchDirectoryOrFilePath(path) {
125734
+ return canWatchDirectoryOrFile(getPathComponents(path));
125735
+ }
125586
125736
  function canWatchAtTypes(atTypes) {
125587
125737
  return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes));
125588
125738
  }
@@ -125594,12 +125744,12 @@ function isInDirectoryPath(dirComponents, fileOrDirComponents) {
125594
125744
  return true;
125595
125745
  }
125596
125746
  function canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(fileOrDirPath) {
125597
- return canWatchDirectoryOrFile(getPathComponents(fileOrDirPath));
125747
+ return canWatchDirectoryOrFilePath(fileOrDirPath);
125598
125748
  }
125599
125749
  function canWatchAffectingLocation(filePath) {
125600
125750
  return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(filePath);
125601
125751
  }
125602
- function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, getCurrentDirectory, preferNonRecursiveWatch) {
125752
+ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch) {
125603
125753
  const failedLookupPathComponents = getPathComponents(failedLookupLocationPath);
125604
125754
  failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
125605
125755
  const failedLookupComponents = getPathComponents(failedLookupLocation);
@@ -125608,7 +125758,7 @@ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLoo
125608
125758
  const nodeModulesIndex = failedLookupPathComponents.indexOf("node_modules");
125609
125759
  if (nodeModulesIndex !== -1 && nodeModulesIndex + 1 <= perceivedOsRootLength + 1) return void 0;
125610
125760
  const lastNodeModulesIndex = failedLookupPathComponents.lastIndexOf("node_modules");
125611
- if (isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) {
125761
+ if (isRootWatchable && isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) {
125612
125762
  if (failedLookupPathComponents.length > rootPathComponents.length + 1) {
125613
125763
  return getDirectoryOfFailedLookupWatch(
125614
125764
  failedLookupComponents,
@@ -125680,9 +125830,9 @@ function getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, lengt
125680
125830
  packageDirPath: packageDirLength !== void 0 ? getPathFromPathComponents(dirPathComponents, packageDirLength) : void 0
125681
125831
  };
125682
125832
  }
125683
- function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, getCurrentDirectory, preferNonRecursiveWatch, filterCustomPath) {
125833
+ function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch, filterCustomPath) {
125684
125834
  const typeRootPathComponents = getPathComponents(typeRootPath);
125685
- if (isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
125835
+ if (isRootWatchable && isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
125686
125836
  return rootPath;
125687
125837
  }
125688
125838
  typeRoot = isRootedDiskPath(typeRoot) ? normalizePath(typeRoot) : getNormalizedAbsolutePath(typeRoot, getCurrentDirectory());
@@ -125723,10 +125873,10 @@ function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirected
125723
125873
  function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
125724
125874
  const host = getModuleResolutionHost(resolutionHost);
125725
125875
  const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
125726
- if (!resolutionHost.getGlobalCache) {
125876
+ if (!resolutionHost.getGlobalTypingsCacheLocation) {
125727
125877
  return primaryResult;
125728
125878
  }
125729
- const globalCache = resolutionHost.getGlobalCache();
125879
+ const globalCache = resolutionHost.getGlobalTypingsCacheLocation();
125730
125880
  if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
125731
125881
  const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
125732
125882
  Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
@@ -125790,6 +125940,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
125790
125940
  const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory);
125791
125941
  const rootPath = resolutionHost.toPath(rootDir);
125792
125942
  const rootPathComponents = getPathComponents(rootPath);
125943
+ const isRootWatchable = canWatchDirectoryOrFile(rootPathComponents);
125793
125944
  const isSymlinkCache = /* @__PURE__ */ new Map();
125794
125945
  const packageDirWatchers = /* @__PURE__ */ new Map();
125795
125946
  const dirPathToSymlinkPackageRefCount = /* @__PURE__ */ new Map();
@@ -126201,6 +126352,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
126201
126352
  rootDir,
126202
126353
  rootPath,
126203
126354
  rootPathComponents,
126355
+ isRootWatchable,
126204
126356
  getCurrentDirectory,
126205
126357
  resolutionHost.preferNonRecursiveWatch
126206
126358
  );
@@ -126389,6 +126541,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
126389
126541
  rootDir,
126390
126542
  rootPath,
126391
126543
  rootPathComponents,
126544
+ isRootWatchable,
126392
126545
  getCurrentDirectory,
126393
126546
  resolutionHost.preferNonRecursiveWatch
126394
126547
  );
@@ -126532,6 +126685,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
126532
126685
  return false;
126533
126686
  }
126534
126687
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
126688
+ (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
126535
126689
  const packagePath = parseNodeModuleFromPath(
126536
126690
  fileOrDirectoryPath,
126537
126691
  /*isFolder*/
@@ -126613,6 +126767,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
126613
126767
  resolutionHost.toPath(typeRoot),
126614
126768
  rootPath,
126615
126769
  rootPathComponents,
126770
+ isRootWatchable,
126616
126771
  getCurrentDirectory,
126617
126772
  resolutionHost.preferNonRecursiveWatch,
126618
126773
  (dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2) || dirPathToSymlinkPackageRefCount.has(dirPath2)
@@ -127345,6 +127500,7 @@ function createWatchProgram(host) {
127345
127500
  let updateLevel;
127346
127501
  let missingFilesMap;
127347
127502
  let watchedWildcardDirectories;
127503
+ let staleWatches = /* @__PURE__ */ new Map([[void 0, void 0]]);
127348
127504
  let timerToUpdateProgram;
127349
127505
  let timerToInvalidateFailedLookupResolutions;
127350
127506
  let parsedConfigs;
@@ -127433,8 +127589,6 @@ function createWatchProgram(host) {
127433
127589
  const customHasInvalidLibResolutions = host.resolveLibrary ? maybeBind(host, host.hasInvalidatedLibResolutions) || returnTrue : returnFalse;
127434
127590
  builderProgram = readBuilderProgram(compilerOptions, compilerHost);
127435
127591
  synchronizeProgram();
127436
- watchConfigFileWildCardDirectories();
127437
- if (configFileName) updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
127438
127592
  return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
127439
127593
  function close() {
127440
127594
  clearInvalidateResolutionsOfFailedLookupLocations();
@@ -127537,6 +127691,16 @@ function createWatchProgram(host) {
127537
127691
  compilerHost.directoryExists = originalDirectoryExists;
127538
127692
  compilerHost.createDirectory = originalCreateDirectory;
127539
127693
  compilerHost.writeFile = originalWriteFile;
127694
+ staleWatches == null ? void 0 : staleWatches.forEach((configFile, configPath) => {
127695
+ if (!configPath) {
127696
+ watchConfigFileWildCardDirectories();
127697
+ if (configFileName) updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
127698
+ } else {
127699
+ const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
127700
+ if (config) watchReferencedProject(configFile, configPath, config);
127701
+ }
127702
+ });
127703
+ staleWatches = void 0;
127540
127704
  return builderProgram;
127541
127705
  }
127542
127706
  function createNewProgram(hasInvalidatedResolutions, hasInvalidatedLibResolutions) {
@@ -127743,9 +127907,8 @@ function createWatchProgram(host) {
127743
127907
  }
127744
127908
  parseConfigFile2();
127745
127909
  hasChangedCompilerOptions = true;
127910
+ (staleWatches ?? (staleWatches = /* @__PURE__ */ new Map())).set(void 0, void 0);
127746
127911
  synchronizeProgram();
127747
- watchConfigFileWildCardDirectories();
127748
- updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
127749
127912
  }
127750
127913
  function parseConfigFile2() {
127751
127914
  Debug.assert(configFileName);
@@ -127797,7 +127960,7 @@ function createWatchProgram(host) {
127797
127960
  } else {
127798
127961
  (parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
127799
127962
  }
127800
- watchReferencedProject(configFileName2, configPath, config);
127963
+ (staleWatches ?? (staleWatches = /* @__PURE__ */ new Map())).set(configPath, configFileName2);
127801
127964
  return parsedCommandLine;
127802
127965
  }
127803
127966
  function getParsedCommandLineFromConfigFileHost(configFileName2) {
@@ -129782,7 +129945,7 @@ function shouldBePretty(sys2, options) {
129782
129945
  return options.pretty;
129783
129946
  }
129784
129947
  function getOptionsForHelp(commandLine) {
129785
- return !!commandLine.options.all ? toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.slice(), (v) => !!v.showInSimplifiedHelpView);
129948
+ return !!commandLine.options.all ? toSorted(optionDeclarations.concat(tscBuildOption), (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.concat(tscBuildOption), (v) => !!v.showInSimplifiedHelpView);
129786
129949
  }
129787
129950
  function printVersion(sys2) {
129788
129951
  sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine);
@@ -130106,7 +130269,7 @@ function printAllHelp(sys2, compilerOptions, buildOptions, watchOptions) {
130106
130269
  output = [...output, ...generateSectionOptionsOutput(
130107
130270
  sys2,
130108
130271
  getDiagnosticText(Diagnostics.BUILD_OPTIONS),
130109
- buildOptions,
130272
+ filter(buildOptions, (option) => option !== tscBuildOption),
130110
130273
  /*subCategory*/
130111
130274
  false,
130112
130275
  formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")
@@ -130120,7 +130283,7 @@ function printBuildHelp(sys2, buildOptions) {
130120
130283
  output = [...output, ...generateSectionOptionsOutput(
130121
130284
  sys2,
130122
130285
  getDiagnosticText(Diagnostics.BUILD_OPTIONS),
130123
- buildOptions,
130286
+ filter(buildOptions, (option) => option !== tscBuildOption),
130124
130287
  /*subCategory*/
130125
130288
  false,
130126
130289
  formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")
@@ -130157,10 +130320,6 @@ function printHelp(sys2, commandLine) {
130157
130320
  }
130158
130321
  function executeCommandLineWorker(sys2, cb, commandLine) {
130159
130322
  let reportDiagnostic = createDiagnosticReporter(sys2);
130160
- if (commandLine.options.build) {
130161
- reportDiagnostic(createCompilerDiagnostic(Diagnostics.Option_build_must_be_the_first_command_line_argument));
130162
- return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */);
130163
- }
130164
130323
  let configFileName;
130165
130324
  if (commandLine.options.locale) {
130166
130325
  validateLocaleAndSetLanguage(commandLine.options.locale, sys2, commandLine.errors);
@@ -130306,16 +130465,16 @@ function executeCommandLineWorker(sys2, cb, commandLine) {
130306
130465
  }
130307
130466
  }
130308
130467
  }
130309
- function isBuild(commandLineArgs) {
130468
+ function isBuildCommand(commandLineArgs) {
130310
130469
  if (commandLineArgs.length > 0 && commandLineArgs[0].charCodeAt(0) === 45 /* minus */) {
130311
130470
  const firstOption = commandLineArgs[0].slice(commandLineArgs[0].charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase();
130312
- return firstOption === "build" || firstOption === "b";
130471
+ return firstOption === tscBuildOption.name || firstOption === tscBuildOption.shortName;
130313
130472
  }
130314
130473
  return false;
130315
130474
  }
130316
130475
  function executeCommandLine(system, cb, commandLineArgs) {
130317
- if (isBuild(commandLineArgs)) {
130318
- const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs.slice(1));
130476
+ if (isBuildCommand(commandLineArgs)) {
130477
+ const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs);
130319
130478
  if (buildOptions.generateCpuProfile && system.enableCPUProfiler) {
130320
130479
  system.enableCPUProfiler(buildOptions.generateCpuProfile, () => performBuild(
130321
130480
  system,