typescript 4.7.0-dev.20220506 → 4.8.0-dev.20220509

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.
@@ -575,9 +575,9 @@
575
575
  "Duplicate_label_0_1114": "'{0}' etiketi yineleniyor.",
576
576
  "Duplicate_property_0_2718": "'{0}' özelliğini yineleyin.",
577
577
  "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Dinamik içeri aktarmanın tanımlayıcısı 'string' türünde olmalıdır, ancak buradaki tür: '{0}'.",
578
- "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Dinamik içeri aktarmalar yalnızca '--module' bayrağı 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12' veya 'nodenext' olarak ayarlandığında desteklenir.",
578
+ "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "Dinamik içe aktarma yalnızca '--module' bayrağı 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16' veya 'nodenext' olarak ayarlandığında desteklenir.",
579
579
  "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "Dinamik içeri aktarmalar, bağımsız değişken olarak yalnızca bir modül tanımlayıcısı ve isteğe bağlı bir onay kabul edebilir",
580
- "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext_1324": "Dinamik içeri aktarmalar, yalnızca '--module' seçeneği 'esnext' veya 'nodenext' olarak ayarlandığında ikinci bir bağımsız değişkeni destekler.",
580
+ "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324": "Dinamik içe aktarma, yalnızca '--module' seçeneği 'esnext', 'node16' veya 'nodenext' olarak ayarlandığında ikinci bir argümanı destekler.",
581
581
  "Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762": "'{0}' birleşim türünün her bir üyesi yapı imzalarına sahip ancak bu imzaların hiçbiri birbiriyle uyumlu değil.",
582
582
  "Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758": "'{0}' birleşim türünün her bir üyesi imzalara sahip ancak bu imzaların hiçbiri birbiriyle uyumlu değil.",
583
583
  "Editor_Support_6249": "Düzenleyici Desteği",
@@ -856,7 +856,6 @@
856
856
  "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "JSDoc '@typedef' etiketi bir tür ek açıklamasına sahip olmalıdır veya sonrasında '@property' ya da '@member' etiketlerinden biri gelmelidir.",
857
857
  "JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc türleri yalnızca belge açıklamalarının içinde kullanılabilir.",
858
858
  "JSDoc_types_may_be_moved_to_TypeScript_types_80004": "JSDoc türleri TypeScript türlerine taşınabilir.",
859
- "JSON_imports_are_experimental_in_ES_module_mode_imports_7062": "JSON içeri aktarmaları, ES modül modu içeri aktarmaları için deneyseldir.",
860
859
  "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000": "JSX özniteliklerine yalnızca boş olmayan 'expression' ifadesi atanabilir.",
861
860
  "JSX_element_0_has_no_corresponding_closing_tag_17008": "'{0}' adlı JSX öğesine karşılık gelen bir kapatma etiketi yok.",
862
861
  "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607": "JSX öğe sınıfı, '{0}' özelliğine sahip olmadığı için öznitelikleri desteklemiyor.",
@@ -1160,8 +1159,8 @@
1160
1159
  "Referenced_project_0_may_not_disable_emit_6310": "Başvurulan '{0}' projesi, yayma özelliğini devre dışı bırakamaz.",
1161
1160
  "Referenced_project_0_must_have_setting_composite_Colon_true_6306": "Başvurulan proje '{0}' \"composite\": true ayarına sahip olmalıdır.",
1162
1161
  "Referenced_via_0_from_file_1_1400": "'{1}' dosyasından '{0}' aracılığıyla başvuruldu",
1163
- "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834": "'--moduleResolution' değeri 'node12' veya 'nodenext' olduğunda göreli içeri aktarma yolları EcmaScript içeri aktarmalarında açık dosya uzantılarını gerektirir. İçeri aktarma yoluna bir uzantı eklemeyi düşünün.",
1164
- "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835": "'--moduleResolution' değeri 'node12' veya 'nodenext' olduğunda göreli içeri aktarma yolları EcmaScript içeri aktarmalarında açık dosya uzantılarını gerektirir. Şunu mu demek istediniz: '{0}'?",
1162
+ "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834": "Göreli içe aktarma yolları, '--moduleResolution' 'node16' veya 'nodenext' olduğunda EcmaScript içe aktarmalarında açık dosya uzantılarına ihtiyaç duyar. İçe aktarma yoluna bir uzantı eklemeyi düşünün.",
1163
+ "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835": "Göreli içe aktarma yolları, '--moduleResolution' 'node16' veya 'nodenext' olduğunda EcmaScript içe aktarmalarında açık dosya uzantılarına ihtiyaç duyar. Şunu mu demek istediniz: '{0}'?",
1165
1164
  "Remove_a_list_of_directories_from_the_watch_process_6628": "İzleme işleminden dizinlerin listesini kaldırın.",
1166
1165
  "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629": "İzleme modu işlemesinden bir dosya listesini kaldırın.",
1167
1166
  "Remove_all_unnecessary_override_modifiers_95163": "Tüm gereksiz 'override' değiştiricilerini kaldır",
@@ -1200,7 +1199,7 @@
1200
1199
  "Required_type_parameters_may_not_follow_optional_type_parameters_2706": "Gerekli tür parametreleri, isteğe bağlı tür parametrelerini takip edemez.",
1201
1200
  "Resolution_for_module_0_was_found_in_cache_from_location_1_6147": "'{0}' modülünün çözümü '{1}' konumundaki önbellekte bulundu.",
1202
1201
  "Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241": "'{0}' tür başvurusu yönergesinin çözümlemesi '{1}' konumundaki önbellekte bulundu.",
1203
- "Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452": "Çözümleme modları yalnızca `moduleResolution` değeri `node12` veya `nodenext` olduğunda desteklenir.",
1202
+ "Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452": "Çözünürlük modları yalnızca `moduleResolution` değeri `node16` veya `nodenext` olduğunda desteklenir.",
1204
1203
  "Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195": "'Keyof' değerini yalnızca dize değerli özellik adlarına (sayılar veya simgeler olmadan) çözümleyin.",
1205
1204
  "Resolving_module_0_from_1_6086": "======== '{0}' modülü '{1}' öğesinden çözümleniyor. ========",
1206
1205
  "Resolving_module_name_0_relative_to_base_url_1_2_6094": "'{0}' modül adı, '{1}' - '{2}' temel url'sine göre çözümleniyor.",
@@ -1370,6 +1369,7 @@
1370
1369
  "The_character_set_of_the_input_files_6163": "Giriş dosyalarının karakter kümesi.",
1371
1370
  "The_containing_arrow_function_captures_the_global_value_of_this_7041": "Kapsayıcı ok işlevi, 'this' öğesinin genel değerini yakalar.",
1372
1371
  "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "İçeren işlev veya modül gövdesi, denetim akışı analizi için çok büyük.",
1372
+ "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309": "Geçerli dosya bir CommonJS modülüdür ve en üst düzeyde 'await'i kullanamaz.",
1373
1373
  "The_current_host_does_not_support_the_0_option_5001": "Mevcut ana bilgisayar '{0}' seçeneğini desteklemiyor.",
1374
1374
  "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018": "Büyük olasılıkla kullanmayı amaçladığınız '{0}' bildirimi burada tanımlanır",
1375
1375
  "The_declaration_was_marked_as_deprecated_here_2798": "Bildirim burada kullanım dışı olarak işaretlendi.",
@@ -1384,7 +1384,7 @@
1384
1384
  "The_global_type_JSX_0_may_not_have_more_than_one_property_2608": "'JSX.{0}' genel türü birden fazla özelliğe sahip olamaz.",
1385
1385
  "The_implementation_signature_is_declared_here_2750": "Uygulama imzası burada bildirilir.",
1386
1386
  "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470": "CommonJS çıkışında oluşturulacak dosyalarda 'import.meta' meta özelliğine izin verilmiyor.",
1387
- "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343": "'import.meta' meta özelliğine yalnızca '--module' seçeneği 'es2020', 'es2022', 'esnext', 'system', 'node12' veya 'nodenext' olduğunda izin verilir.",
1387
+ "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343": "'import.meta' meta özelliğine yalnızca '--module' seçeneği 'es2020', 'es2022', 'esnext', 'system', 'node16' veya 'nodenext' olduğunda izin verilir.",
1388
1388
  "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "'{0}' öğesinin çıkarsanan türü, '{1}' başvurusu olmadan adlandırılamaz. Bu büyük olasılıkla taşınabilir değildir. Tür ek açıklaması gereklidir.",
1389
1389
  "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "Çıkarsanan '{0}' türü, önemsiz olarak seri hale getirilemeyen döngüsel yapıya sahip bir türe başvurur. Tür ek açıklaması gerekir.",
1390
1390
  "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "Çıkarsanan '{0}' türü, erişilemeyen bir '{1}' türüne başvuruyor. Tür ek açıklaması gereklidir.",
@@ -1418,6 +1418,8 @@
1418
1418
  "The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777": "Artırma veya eksiltme operatörünün işleneni, isteğe bağlı bir özellik erişimi olamaz.",
1419
1419
  "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357": "Artırma veya eksiltme operatörünün işleneni, bir değişken veya özellik erişimi olmalıdır.",
1420
1420
  "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007": "Ayrıştırıcı, buradaki '{0}' belirteciyle eşleştirmek için bir '{1}' bulmayı bekliyordu.",
1421
+ "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209": "Proje kökü belirsizdir, ancak '{1}' dosyasındaki '{0}' dışa aktarma haritası girişini çözmek için gereklidir. Belirsizliği gidermek için `rootDir` derleyici seçeneğini sağlayın.",
1422
+ "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210": "Proje kökü belirsizdir, ancak '{1}' dosyasındaki '{0}' içe aktarma haritası girişini çözmek için gereklidir. Belirsizliği gidermek için `rootDir` derleme seçeneğini sağlayın.",
1421
1423
  "The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014": "'{0}' özelliği aynı yazımı içeren başka bir özel tanımlayıcı tarafından gölgelendiğinden bu sınıf içindeki '{1}' türü üzerinde bu özelliğe erişilemiyor.",
1422
1424
  "The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380": "'get' erişimcisinin dönüş türü, 'set' erişimcisinin türüne atanabilmelidir",
1423
1425
  "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237": "Parametre dekoratör işlevine ait dönüş türü 'void' veya 'any' olmalıdır.",
@@ -1483,11 +1485,10 @@
1483
1485
  "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Bu söz dizimi, içeri aktarılan bir yardımcı gerektiriyor ancak '{0}' modülü bulunamıyor.",
1484
1486
  "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Bu söz dizimi, '{0}' içinde bulunmayan '{1}' adlı içeri aktarılmış bir yardımcı gerektirir. '{0}' sürümünüzü yükseltmeyi deneyin.",
1485
1487
  "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Bu söz dizimi, '{0}' içindeki yardımcı ile uyumlu olmayan, {2} parametreye sahip '{1}' adlı içeri aktarılan yardımcıyı gerektiriyor. '{0}' sürümünüzü yükseltmeyi düşünün.",
1486
- "This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Bu tür parametresi için bir `nesneyi genişletir` kısıtlaması gerekiyor olabilir.",
1487
1488
  "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "'import' çağrısının bu kullanımı geçersiz. 'import()' çağrıları yazılabilir ancak ayraç içermeleri gerekir ve tür bağımsız değişkenleri içeremezler.",
1488
- "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Üst düzey 'await' ifadelerine yalnızca 'module' seçeneği 'es2022', 'esnext', 'system' veya 'nodenext' olarak ayarlandığında ve 'target' seçeneği 'es2017' veya üzeri olarak ayarlandığında izin verilir.",
1489
+ "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378": "Üst düzey 'await' ifadelerine yalnızca 'module' seçeneği 'es2022', 'esnext', 'system', 'node16' veya 'nodenext' olarak ayarlandığında ve 'target' seçeneği 'es2017' veya üzeri olarak ayarlandığında izin verilir.",
1489
1490
  "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts dosyalarındaki üst düzey bildirimler bir 'declare' veya 'export' değiştiricisi ile başlamalıdır.",
1490
- "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Üst düzey 'for await' döngülerine yalnızca 'module' seçeneği 'es2022', 'esnext', 'system' veya 'nodenext' olarak ayarlandığında ve 'target' seçeneği 'es2017' veya üzeri olarak ayarlandığında izin verilir.",
1491
+ "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432": "Üst düzey 'bekleme için' döngülerine yalnızca 'modül' seçeneği 'es2022', 'esnext', 'system', 'node16' veya 'nodenext' olarak ayarlandığında ve 'target' seçeneği 'es2017' veya üstü olarak ayarlandığında izin verilir.",
1491
1492
  "Trailing_comma_not_allowed_1009": "Sona eklenen virgüle izin verilmez.",
1492
1493
  "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Her dosyayı ayrı bir modül olarak derleyin ('ts.transpileModule' gibi).",
1493
1494
  "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Varsa `npm i --save-dev @types/{1}` deneyin veya `declare module '{0}';` deyimini içeren yeni bir bildirim (.d.ts) dosyası ekleyin",
@@ -1727,7 +1728,7 @@
1727
1728
  "abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "'abstract' değiştiricisi yalnızca sınıf, metot veya özellik bildiriminde görünebilir.",
1728
1729
  "and_here_6204": "ve buraya.",
1729
1730
  "arguments_cannot_be_referenced_in_property_initializers_2815": "Özellik başlatıcılarda 'arguments' öğesine başvurulamaz.",
1730
- "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": import, export, import.meta, jsx (jsx: react-jsx) veya esm biçimi (module: node12+) olan dosyaları modül olarak işle.",
1731
+ "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": İçe aktarma, dışa aktarma, import.meta, jsx (jsx: react-jsx ile) veya esm biçimi (modül: node16+ ile) içeren dosyaları modül olarak ele alın.",
1731
1732
  "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "'await' ifadelerine yalnızca dosya bir modül olduğunda dosyanın en üst düzeyinde izin verilir ancak bu dosyanın içeri veya dışarı aktarma işlemi yok. Bu dosyayı modül yapmak için boş bir 'export {}' eklemeyi deneyin.",
1732
1733
  "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308": "'await' ifadelerine yalnızca asenkron işlevler içinde ve modüllerin en üst düzeylerinde izin verilir.",
1733
1734
  "await_expressions_cannot_be_used_in_a_parameter_initializer_2524": "'await' ifadeleri bir parametre başlatıcısında kullanılamaz.",
package/lib/tsc.js CHANGED
@@ -68,8 +68,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
68
68
  };
69
69
  var ts;
70
70
  (function (ts) {
71
- ts.versionMajorMinor = "4.7";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220506";
71
+ ts.versionMajorMinor = "4.8";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220509";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -6184,6 +6184,7 @@ var ts;
6184
6184
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
6185
6185
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
6186
6186
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, ts.DiagnosticCategory.Error, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
6187
+ Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, ts.DiagnosticCategory.Error, "Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
6187
6188
  The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
6188
6189
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
6189
6190
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -14052,6 +14053,10 @@ var ts;
14052
14053
  return indentStrings[1].length;
14053
14054
  }
14054
14055
  ts.getIndentSize = getIndentSize;
14056
+ function isNightly() {
14057
+ return ts.stringContains(ts.version, "-dev") || ts.stringContains(ts.version, "-insiders");
14058
+ }
14059
+ ts.isNightly = isNightly;
14055
14060
  function createTextWriter(newLine) {
14056
14061
  var output;
14057
14062
  var indent;
@@ -26464,6 +26469,7 @@ var ts;
26464
26469
  var startPos = scanner.getStartPos();
26465
26470
  var result = parseListElement(kind, parseElement);
26466
26471
  if (!result) {
26472
+ parsingContext = saveParsingContext;
26467
26473
  return undefined;
26468
26474
  }
26469
26475
  list.push(result);
@@ -71207,6 +71213,9 @@ var ts;
71207
71213
  var validForTypeAssertions = ts.isExclusivelyTypeOnlyImportOrExport(declaration);
71208
71214
  var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
71209
71215
  if (validForTypeAssertions && override) {
71216
+ if (!ts.isNightly()) {
71217
+ grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
71218
+ }
71210
71219
  if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
71211
71220
  return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
71212
71221
  }
@@ -88856,23 +88865,33 @@ var ts;
88856
88865
  }
88857
88866
  function transformImportDeclaration(decl) {
88858
88867
  if (!decl.importClause) {
88859
- return factory.updateImportDeclaration(decl, undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
88868
+ return factory.updateImportDeclaration(decl, undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
88860
88869
  }
88861
88870
  var visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : undefined;
88862
88871
  if (!decl.importClause.namedBindings) {
88863
- return visibleDefaultBinding && factory.updateImportDeclaration(decl, undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
88872
+ return visibleDefaultBinding && factory.updateImportDeclaration(decl, undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
88864
88873
  }
88865
88874
  if (decl.importClause.namedBindings.kind === 268) {
88866
88875
  var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : undefined;
88867
- return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined) : undefined;
88876
+ return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)) : undefined;
88868
88877
  }
88869
88878
  var bindingList = ts.mapDefined(decl.importClause.namedBindings.elements, function (b) { return resolver.isDeclarationVisible(b) ? b : undefined; });
88870
88879
  if ((bindingList && bindingList.length) || visibleDefaultBinding) {
88871
- return factory.updateImportDeclaration(decl, undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
88880
+ return factory.updateImportDeclaration(decl, undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
88872
88881
  }
88873
88882
  if (resolver.isImportRequiredByAugmentation(decl)) {
88874
- return factory.updateImportDeclaration(decl, undefined, decl.modifiers, undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
88883
+ return factory.updateImportDeclaration(decl, undefined, decl.modifiers, undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
88884
+ }
88885
+ }
88886
+ function getResolutionModeOverrideForClauseInNightly(assertClause) {
88887
+ var mode = ts.getResolutionModeOverrideForClause(assertClause);
88888
+ if (mode !== undefined) {
88889
+ if (!ts.isNightly()) {
88890
+ context.addDiagnostic(ts.createDiagnosticForNode(assertClause, ts.Diagnostics.Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
88891
+ }
88892
+ return assertClause;
88875
88893
  }
88894
+ return undefined;
88876
88895
  }
88877
88896
  function transformAndReplaceLatePaintedStatements(statements) {
88878
88897
  while (ts.length(lateMarkedStatements)) {
@@ -100612,14 +100631,14 @@ var ts;
100612
100631
  if (options === void 0) { options = {}; }
100613
100632
  var info = getInfo(importingSourceFile.path, host);
100614
100633
  var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options);
100615
- return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, true, options.overrideImportMode); });
100634
+ return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, preferences, true, options.overrideImportMode); });
100616
100635
  }
100617
100636
  moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName;
100618
100637
  function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences, options) {
100619
100638
  if (options === void 0) { options = {}; }
100620
100639
  var info = getInfo(importingSourceFileName, host);
100621
100640
  var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options);
100622
- return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, undefined, options.overrideImportMode); }) ||
100641
+ return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, undefined, options.overrideImportMode); }) ||
100623
100642
  getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
100624
100643
  }
100625
100644
  function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options) {
@@ -100685,7 +100704,7 @@ var ts;
100685
100704
  var relativeSpecifiers;
100686
100705
  for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) {
100687
100706
  var modulePath = modulePaths_1[_i];
100688
- var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, undefined, options.overrideImportMode);
100707
+ var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, undefined, options.overrideImportMode);
100689
100708
  nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier);
100690
100709
  if (specifier && modulePath.isRedirect) {
100691
100710
  return nodeModulesSpecifiers;
@@ -101016,7 +101035,7 @@ var ts;
101016
101035
  ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
101017
101036
  : ts.removeFileExtension(relativePath);
101018
101037
  }
101019
- function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly, overrideMode) {
101038
+ function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
101020
101039
  var path = _a.path, isRedirect = _a.isRedirect;
101021
101040
  var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory;
101022
101041
  if (!host.fileExists || !host.readFile) {
@@ -101029,8 +101048,9 @@ var ts;
101029
101048
  var moduleSpecifier = path;
101030
101049
  var isPackageRootPath = false;
101031
101050
  if (!packageNameOnly) {
101051
+ var preferences = getPreferences(host, userPreferences, options, importingSourceFile);
101032
101052
  var packageRootIndex = parts.packageRootIndex;
101033
- var moduleFileNameForExtensionless = void 0;
101053
+ var moduleFileName = void 0;
101034
101054
  while (true) {
101035
101055
  var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath, blockedByExports = _c.blockedByExports, verbatimFromExports = _c.verbatimFromExports;
101036
101056
  if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Classic) {
@@ -101046,11 +101066,11 @@ var ts;
101046
101066
  isPackageRootPath = true;
101047
101067
  break;
101048
101068
  }
101049
- if (!moduleFileNameForExtensionless)
101050
- moduleFileNameForExtensionless = moduleFileToTry;
101069
+ if (!moduleFileName)
101070
+ moduleFileName = moduleFileToTry;
101051
101071
  packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1);
101052
101072
  if (packageRootIndex === -1) {
101053
- moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless);
101073
+ moduleSpecifier = removeExtensionAndIndexPostFix(moduleFileName, preferences.ending, options, host);
101054
101074
  break;
101055
101075
  }
101056
101076
  }
@@ -101099,7 +101119,7 @@ var ts;
101099
101119
  moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths);
101100
101120
  }
101101
101121
  }
101102
- var mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main;
101122
+ var mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js";
101103
101123
  if (ts.isString(mainFileRelative)) {
101104
101124
  var mainExportFile = ts.toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
101105
101125
  if (ts.removeFileExtension(mainExportFile) === ts.removeFileExtension(getCanonicalFileName(moduleFileToTry))) {
@@ -101107,14 +101127,13 @@ var ts;
101107
101127
  }
101108
101128
  }
101109
101129
  }
101110
- return { moduleFileToTry: moduleFileToTry };
101111
- }
101112
- function getExtensionlessFileName(path) {
101113
- var fullModulePathWithoutExtension = ts.removeFileExtension(path);
101114
- if (getCanonicalFileName(fullModulePathWithoutExtension.substring(parts.fileNameIndex)) === "/index" && !tryGetAnyFileFromPath(host, fullModulePathWithoutExtension.substring(0, parts.fileNameIndex))) {
101115
- return fullModulePathWithoutExtension.substring(0, parts.fileNameIndex);
101130
+ else {
101131
+ var fileName = getCanonicalFileName(moduleFileToTry.substring(parts.packageRootIndex + 1));
101132
+ if (fileName === "index.d.ts" || fileName === "index.js" || fileName === "index.ts" || fileName === "index.tsx") {
101133
+ return { moduleFileToTry: moduleFileToTry, packageRootPath: packageRootPath };
101134
+ }
101116
101135
  }
101117
- return fullModulePathWithoutExtension;
101136
+ return { moduleFileToTry: moduleFileToTry };
101118
101137
  }
101119
101138
  }
101120
101139
  function tryGetAnyFileFromPath(host, path) {
@@ -101135,7 +101154,7 @@ var ts;
101135
101154
  return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
101136
101155
  });
101137
101156
  }
101138
- function removeExtensionAndIndexPostFix(fileName, ending, options) {
101157
+ function removeExtensionAndIndexPostFix(fileName, ending, options, host) {
101139
101158
  if (ts.fileExtensionIsOneOf(fileName, [".json", ".mjs", ".cjs"]))
101140
101159
  return fileName;
101141
101160
  var noExtension = ts.removeFileExtension(fileName);
@@ -101143,7 +101162,11 @@ var ts;
101143
101162
  return noExtension + getJSExtensionForFile(fileName, options);
101144
101163
  switch (ending) {
101145
101164
  case 0:
101146
- return ts.removeSuffix(noExtension, "/index");
101165
+ var withoutIndex = ts.removeSuffix(noExtension, "/index");
101166
+ if (host && withoutIndex !== noExtension && tryGetAnyFileFromPath(host, withoutIndex)) {
101167
+ return noExtension;
101168
+ }
101169
+ return withoutIndex;
101147
101170
  case 1:
101148
101171
  return noExtension;
101149
101172
  case 2:
package/lib/tsserver.js CHANGED
@@ -96,11 +96,11 @@ var ts;
96
96
  (function (ts) {
97
97
  // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
98
98
  // If changing the text in this section, be sure to test `configurePrerelease` too.
99
- ts.versionMajorMinor = "4.7";
99
+ ts.versionMajorMinor = "4.8";
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20220506";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20220509";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -9000,6 +9000,7 @@ var ts;
9000
9000
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
9001
9001
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
9002
9002
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, ts.DiagnosticCategory.Error, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
9003
+ Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, ts.DiagnosticCategory.Error, "Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
9003
9004
  The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
9004
9005
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
9005
9006
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -18006,6 +18007,10 @@ var ts;
18006
18007
  return indentStrings[1].length;
18007
18008
  }
18008
18009
  ts.getIndentSize = getIndentSize;
18010
+ function isNightly() {
18011
+ return ts.stringContains(ts.version, "-dev") || ts.stringContains(ts.version, "-insiders");
18012
+ }
18013
+ ts.isNightly = isNightly;
18009
18014
  function createTextWriter(newLine) {
18010
18015
  var output;
18011
18016
  var indent;
@@ -32853,6 +32858,7 @@ var ts;
32853
32858
  var startPos = scanner.getStartPos();
32854
32859
  var result = parseListElement(kind, parseElement);
32855
32860
  if (!result) {
32861
+ parsingContext = saveParsingContext;
32856
32862
  return undefined;
32857
32863
  }
32858
32864
  list.push(result);
@@ -84995,6 +85001,9 @@ var ts;
84995
85001
  var validForTypeAssertions = ts.isExclusivelyTypeOnlyImportOrExport(declaration);
84996
85002
  var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
84997
85003
  if (validForTypeAssertions && override) {
85004
+ if (!ts.isNightly()) {
85005
+ grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
85006
+ }
84998
85007
  if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
84999
85008
  return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
85000
85009
  }
@@ -108393,34 +108402,44 @@ var ts;
108393
108402
  if (!decl.importClause) {
108394
108403
  // import "mod" - possibly needed for side effects? (global interface patches, module augmentations, etc)
108395
108404
  return factory.updateImportDeclaration(decl,
108396
- /*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
108405
+ /*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
108397
108406
  }
108398
108407
  // The `importClause` visibility corresponds to the default's visibility.
108399
108408
  var visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : undefined;
108400
108409
  if (!decl.importClause.namedBindings) {
108401
108410
  // No named bindings (either namespace or list), meaning the import is just default or should be elided
108402
108411
  return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding,
108403
- /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
108412
+ /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
108404
108413
  }
108405
108414
  if (decl.importClause.namedBindings.kind === 268 /* NamespaceImport */) {
108406
108415
  // Namespace import (optionally with visible default)
108407
108416
  var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined;
108408
- return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined) : undefined;
108417
+ return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)) : undefined;
108409
108418
  }
108410
108419
  // Named imports (optionally with visible default)
108411
108420
  var bindingList = ts.mapDefined(decl.importClause.namedBindings.elements, function (b) { return resolver.isDeclarationVisible(b) ? b : undefined; });
108412
108421
  if ((bindingList && bindingList.length) || visibleDefaultBinding) {
108413
108422
  return factory.updateImportDeclaration(decl,
108414
- /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
108423
+ /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
108415
108424
  }
108416
108425
  // Augmentation of export depends on import
108417
108426
  if (resolver.isImportRequiredByAugmentation(decl)) {
108418
108427
  return factory.updateImportDeclaration(decl,
108419
108428
  /*decorators*/ undefined, decl.modifiers,
108420
- /*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), ts.getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined);
108429
+ /*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause));
108421
108430
  }
108422
108431
  // Nothing visible
108423
108432
  }
108433
+ function getResolutionModeOverrideForClauseInNightly(assertClause) {
108434
+ var mode = ts.getResolutionModeOverrideForClause(assertClause);
108435
+ if (mode !== undefined) {
108436
+ if (!ts.isNightly()) {
108437
+ context.addDiagnostic(ts.createDiagnosticForNode(assertClause, ts.Diagnostics.Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
108438
+ }
108439
+ return assertClause;
108440
+ }
108441
+ return undefined;
108442
+ }
108424
108443
  function transformAndReplaceLatePaintedStatements(statements) {
108425
108444
  // This is a `while` loop because `handleSymbolAccessibilityError` can see additional import aliases marked as visible during
108426
108445
  // error handling which must now be included in the output and themselves checked for errors.
@@ -121728,14 +121747,14 @@ var ts;
121728
121747
  if (options === void 0) { options = {}; }
121729
121748
  var info = getInfo(importingSourceFile.path, host);
121730
121749
  var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options);
121731
- return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ true, options.overrideImportMode); });
121750
+ return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, preferences, /*packageNameOnly*/ true, options.overrideImportMode); });
121732
121751
  }
121733
121752
  moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName;
121734
121753
  function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences, options) {
121735
121754
  if (options === void 0) { options = {}; }
121736
121755
  var info = getInfo(importingSourceFileName, host);
121737
121756
  var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options);
121738
- return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode); }) ||
121757
+ return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, /*packageNameOnly*/ undefined, options.overrideImportMode); }) ||
121739
121758
  getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
121740
121759
  }
121741
121760
  function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options) {
@@ -121811,7 +121830,7 @@ var ts;
121811
121830
  var relativeSpecifiers;
121812
121831
  for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) {
121813
121832
  var modulePath = modulePaths_1[_i];
121814
- var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode);
121833
+ var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, /*packageNameOnly*/ undefined, options.overrideImportMode);
121815
121834
  nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier);
121816
121835
  if (specifier && modulePath.isRedirect) {
121817
121836
  // If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar",
@@ -122204,7 +122223,7 @@ var ts;
122204
122223
  ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
122205
122224
  : ts.removeFileExtension(relativePath);
122206
122225
  }
122207
- function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly, overrideMode) {
122226
+ function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
122208
122227
  var path = _a.path, isRedirect = _a.isRedirect;
122209
122228
  var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory;
122210
122229
  if (!host.fileExists || !host.readFile) {
@@ -122218,8 +122237,9 @@ var ts;
122218
122237
  var moduleSpecifier = path;
122219
122238
  var isPackageRootPath = false;
122220
122239
  if (!packageNameOnly) {
122240
+ var preferences = getPreferences(host, userPreferences, options, importingSourceFile);
122221
122241
  var packageRootIndex = parts.packageRootIndex;
122222
- var moduleFileNameForExtensionless = void 0;
122242
+ var moduleFileName = void 0;
122223
122243
  while (true) {
122224
122244
  // If the module could be imported by a directory name, use that directory's name
122225
122245
  var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath, blockedByExports = _c.blockedByExports, verbatimFromExports = _c.verbatimFromExports;
@@ -122236,12 +122256,12 @@ var ts;
122236
122256
  isPackageRootPath = true;
122237
122257
  break;
122238
122258
  }
122239
- if (!moduleFileNameForExtensionless)
122240
- moduleFileNameForExtensionless = moduleFileToTry;
122259
+ if (!moduleFileName)
122260
+ moduleFileName = moduleFileToTry;
122241
122261
  // try with next level of directory
122242
122262
  packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1);
122243
122263
  if (packageRootIndex === -1) {
122244
- moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless);
122264
+ moduleSpecifier = removeExtensionAndIndexPostFix(moduleFileName, preferences.ending, options, host);
122245
122265
  break;
122246
122266
  }
122247
122267
  }
@@ -122299,7 +122319,7 @@ var ts;
122299
122319
  }
122300
122320
  }
122301
122321
  // If the file is the main module, it can be imported by the package name
122302
- var mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main;
122322
+ var mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js";
122303
122323
  if (ts.isString(mainFileRelative)) {
122304
122324
  var mainExportFile = ts.toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
122305
122325
  if (ts.removeFileExtension(mainExportFile) === ts.removeFileExtension(getCanonicalFileName(moduleFileToTry))) {
@@ -122307,17 +122327,14 @@ var ts;
122307
122327
  }
122308
122328
  }
122309
122329
  }
122310
- return { moduleFileToTry: moduleFileToTry };
122311
- }
122312
- function getExtensionlessFileName(path) {
122313
- // We still have a file name - remove the extension
122314
- var fullModulePathWithoutExtension = ts.removeFileExtension(path);
122315
- // If the file is /index, it can be imported by its directory name
122316
- // IFF there is not _also_ a file by the same name
122317
- if (getCanonicalFileName(fullModulePathWithoutExtension.substring(parts.fileNameIndex)) === "/index" && !tryGetAnyFileFromPath(host, fullModulePathWithoutExtension.substring(0, parts.fileNameIndex))) {
122318
- return fullModulePathWithoutExtension.substring(0, parts.fileNameIndex);
122330
+ else {
122331
+ // No package.json exists; an index.js will still resolve as the package name
122332
+ var fileName = getCanonicalFileName(moduleFileToTry.substring(parts.packageRootIndex + 1));
122333
+ if (fileName === "index.d.ts" || fileName === "index.js" || fileName === "index.ts" || fileName === "index.tsx") {
122334
+ return { moduleFileToTry: moduleFileToTry, packageRootPath: packageRootPath };
122335
+ }
122319
122336
  }
122320
- return fullModulePathWithoutExtension;
122337
+ return { moduleFileToTry: moduleFileToTry };
122321
122338
  }
122322
122339
  }
122323
122340
  function tryGetAnyFileFromPath(host, path) {
@@ -122339,7 +122356,7 @@ var ts;
122339
122356
  return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
122340
122357
  });
122341
122358
  }
122342
- function removeExtensionAndIndexPostFix(fileName, ending, options) {
122359
+ function removeExtensionAndIndexPostFix(fileName, ending, options, host) {
122343
122360
  if (ts.fileExtensionIsOneOf(fileName, [".json" /* Json */, ".mjs" /* Mjs */, ".cjs" /* Cjs */]))
122344
122361
  return fileName;
122345
122362
  var noExtension = ts.removeFileExtension(fileName);
@@ -122347,7 +122364,13 @@ var ts;
122347
122364
  return noExtension + getJSExtensionForFile(fileName, options);
122348
122365
  switch (ending) {
122349
122366
  case 0 /* Minimal */:
122350
- return ts.removeSuffix(noExtension, "/index");
122367
+ var withoutIndex = ts.removeSuffix(noExtension, "/index");
122368
+ if (host && withoutIndex !== noExtension && tryGetAnyFileFromPath(host, withoutIndex)) {
122369
+ // Can't remove index if there's a file by the same name as the directory.
122370
+ // Probably more callers should pass `host` so we can determine this?
122371
+ return noExtension;
122372
+ }
122373
+ return withoutIndex;
122351
122374
  case 1 /* Index */:
122352
122375
  return noExtension;
122353
122376
  case 2 /* JsExtension */:
@@ -14,7 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
 
16
16
  declare namespace ts {
17
- const versionMajorMinor = "4.7";
17
+ const versionMajorMinor = "4.8";
18
18
  /** The version of the TypeScript compiler release */
19
19
  const version: string;
20
20
  /**