ttsc 0.30.3 → 0.31.0
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/cmd/graphbench/main.go +2 -3
- package/cmd/graphdump/main.go +42 -16
- package/cmd/graphdump/run_declares_the_capability_its_output_carries_test.go +32 -18
- package/cmd/graphdump/run_reports_an_unknown_flag_without_exiting_the_process_test.go +10 -9
- package/cmd/graphdump/run_reports_an_unloadable_project_without_printing_a_dump_test.go +8 -7
- package/cmd/platform/command_operation_families_test.go +192 -0
- package/cmd/platform/main.go +11 -1
- package/cmd/ttsc/api_compile.go +166 -46
- package/cmd/ttsc/api_compile_branches_test.go +97 -10
- package/cmd/ttsc/api_transform.go +134 -46
- package/cmd/ttsc/api_transform_branches_test.go +10 -7
- package/cmd/ttsc/build.go +177 -68
- package/cmd/ttsc/build_branches_test.go +35 -7
- package/cmd/ttsc/cli_command_operation_families_test.go +1287 -0
- package/cmd/ttsc/cli_contract_helpers_test.go +82 -0
- package/cmd/ttsc/compiler_argument_cwd_test.go +57 -0
- package/cmd/ttsc/filter.go +31 -14
- package/cmd/ttsc/filter_resolves_flag_names_case_insensitively_test.go +10 -13
- package/cmd/ttsc/filter_strips_unknown_forwarded_flag_test.go +10 -16
- package/cmd/ttsc/flags_gen.go +2 -2
- package/cmd/ttsc/helpers_test.go +67 -10
- package/cmd/ttsc/main.go +122 -21
- package/cmd/ttsc/main_alias_branches_test.go +35 -9
- package/cmd/ttsc/testdata/cli_operation_families/TestAPITransformEnvelopeCarriesReferenceGraph/ambient.d.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestAPITransformEnvelopeCarriesReferenceGraph/main.ts +2 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestAPITransformEnvelopeCarriesReferenceGraph/mytype.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestAPITransformEnvelopeCarriesReferenceGraph/tsconfig.base.json +3 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestAPITransformEnvelopeCarriesReferenceGraph/tsconfig.json +5 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPICompileAndTransform/index.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPICompileAndTransform/src/decorated/main.ts +10 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPICompileAndTransform/src/decorated/types.ts +3 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPICompileAndTransform/src/helpers.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPICompileAndTransform/src/isolated.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPICompileAndTransform/src/main.ts +7 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPICompileAndTransform/src/nested/model.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPICompileAndTransform/tsconfig.json +14 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPITransformUsesCurrentDirectory/index.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIAPITransformUsesCurrentDirectory/tsconfig.json +7 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildAllowsUnusedTypeParametersOnOverloadSignatures/index.ts +4 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildAllowsUnusedTypeParametersOnOverloadSignatures/tsconfig.json +11 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildBlocksSemanticDiagnostics/index.ts +2 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildBlocksSemanticDiagnostics/tsconfig.json +9 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildBlocksSyntacticDiagnostics/index.ts +2 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildBlocksSyntacticDiagnostics/tsconfig.json +8 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildBlocksUnusedParameters/index.ts +3 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildBlocksUnusedParameters/tsconfig.json +10 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildEmitErrorRejectsManifest/index.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIProjectBuildEmitErrorRejectsManifest/tsconfig.json +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIReportsDiagnosticsWithoutEmit/index.ts +1 -0
- package/cmd/ttsc/testdata/cli_operation_families/TestCLIReportsDiagnosticsWithoutEmit/tsconfig.json +8 -0
- package/cmd/ttsc/testdata/cli_operation_families/shared-value-one/project/emit.json +8 -0
- package/cmd/ttsc/testdata/cli_operation_families/shared-value-one/project/flag-shaped.json +7 -0
- package/cmd/ttsc/testdata/cli_operation_families/shared-value-one/project/index.ts +2 -0
- package/cmd/ttsc/testdata/cli_operation_families/shared-value-one/project/nested/tsconfig.app.json +11 -0
- package/cmd/ttsc/testdata/cli_operation_families/shared-value-one/project/outside.json +8 -0
- package/cmd/ttsc/testdata/cli_operation_families/shared-value-one/project/tsconfig.json +8 -0
- package/cmd/ttscgraph/auxiliary_identity_state_tracks_retargets_not_source_contents_test.go +26 -15
- package/cmd/ttscgraph/disk_realpath_other.go +2 -0
- package/cmd/ttscgraph/dump.go +46 -29
- package/cmd/ttscgraph/prepared_projection.go +61 -0
- package/cmd/ttscgraph/projection_fixture_test.go +96 -0
- package/cmd/ttscgraph/run_dump_claims_artifacts_only_when_it_asked_test.go +30 -5
- package/cmd/ttscgraph/run_dump_declares_the_capability_its_output_carries_test.go +6 -1
- package/cmd/ttscgraph/run_dump_emits_only_checker_verified_member_relations_test.go +12 -5
- package/cmd/ttscgraph/run_dump_prints_the_graph_as_json_test.go +17 -12
- package/cmd/ttscgraph/run_help_version_and_bad_flags_exit_codes_test.go +8 -3
- package/cmd/ttscgraph/serve.go +116 -79
- package/cmd/ttscgraph/serve_adopts_a_republished_artifact_set_test.go +16 -167
- package/cmd/ttscgraph/serve_adopts_a_republished_set_over_the_shard_protocol_test.go +122 -0
- package/cmd/ttscgraph/serve_answers_a_project_that_implements_its_own_ambient_declaration_test.go +35 -7
- package/cmd/ttscgraph/serve_early_error_encode_failure_is_observable_test.go +5 -0
- package/cmd/ttscgraph/serve_error_response_still_names_its_mode_test.go +10 -5
- package/cmd/ttscgraph/serve_git_ignore_projection_test.go +150 -0
- package/cmd/ttscgraph/serve_keeps_a_startup_set_a_client_never_mentions_test.go +69 -0
- package/cmd/ttscgraph/serve_object_members_refresh_without_identity_collisions_test.go +82 -0
- package/cmd/ttscgraph/serve_phase_trace_accounts_for_load_failure_test.go +9 -3
- package/cmd/ttscgraph/serve_phase_trace_is_opt_in_and_payload_free_test.go +12 -6
- package/cmd/ttscgraph/serve_projects_an_artifact_no_source_owns_test.go +13 -16
- package/cmd/ttscgraph/serve_protocol_fails_the_stream_on_an_unaddressable_request_line_test.go +10 -9
- package/cmd/ttscgraph/serve_protocol_negotiates_incremental_shards_test.go +37 -2
- package/cmd/ttscgraph/serve_protocol_retries_session_creation_test.go +7 -2
- package/cmd/ttscgraph/serve_protocol_reuses_session_test.go +13 -3
- package/cmd/ttscgraph/serve_session_applies_source_edit_incrementally_test.go +12 -7
- package/cmd/ttscgraph/serve_session_fails_closed_on_deleted_config_test.go +12 -7
- package/cmd/ttscgraph/serve_session_fails_closed_on_invalid_config_test.go +8 -3
- package/cmd/ttscgraph/serve_session_keeps_base_url_fallback_unchanged_test.go +7 -2
- package/cmd/ttscgraph/serve_session_keeps_change_detection_live_after_initial_dump_error_test.go +66 -0
- package/cmd/ttscgraph/serve_session_keeps_esm_directory_candidate_unchanged_test.go +12 -3
- package/cmd/ttscgraph/serve_session_keeps_exports_blocked_file_candidates_unchanged_test.go +8 -3
- package/cmd/ttscgraph/serve_session_keeps_inactive_conditional_export_unchanged_test.go +12 -3
- package/cmd/ttscgraph/serve_session_keeps_lower_priority_module_candidate_unchanged_test.go +14 -8
- package/cmd/ttscgraph/serve_session_keeps_lower_priority_paths_pattern_unchanged_test.go +12 -3
- package/cmd/ttscgraph/serve_session_keeps_missing_literal_root_unchanged_test.go +7 -2
- package/cmd/ttscgraph/serve_session_keeps_nonlongest_root_dirs_candidate_unchanged_test.go +12 -3
- package/cmd/ttscgraph/serve_session_rebuilds_import_graph_change_test.go +17 -8
- package/cmd/ttscgraph/serve_session_reloads_commonjs_package_entry_for_esm_test.go +11 -2
- package/cmd/ttscgraph/serve_session_reloads_created_literal_root_test.go +7 -2
- package/cmd/ttscgraph/serve_session_reloads_extended_config_change_test.go +9 -4
- package/cmd/ttscgraph/serve_session_reloads_module_suffix_candidate_test.go +13 -4
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_conditional_export_test.go +13 -8
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_config_types_test.go +7 -2
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_excluded_import_test.go +11 -3
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_package_export_test.go +11 -2
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_package_import_test.go +11 -2
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_path_alias_test.go +11 -2
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_reference_path_test.go +11 -2
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_root_dirs_target_test.go +11 -2
- package/cmd/ttscgraph/serve_session_reloads_newly_resolved_type_reference_test.go +11 -2
- package/cmd/ttscgraph/serve_session_reloads_root_file_set_test.go +11 -5
- package/cmd/ttscgraph/serve_session_reloads_source_deleted_during_load_test.go +16 -9
- package/cmd/ttscgraph/serve_session_reloads_superseding_module_candidates_test.go +18 -13
- package/cmd/ttscgraph/serve_session_reloads_transitive_project_reference_test.go +14 -5
- package/cmd/ttscgraph/serve_session_reloads_when_program_plugin_linked_test.go +13 -8
- package/cmd/ttscgraph/serve_session_retries_a_pending_dump_before_unchanged_test.go +62 -0
- package/cmd/ttscgraph/serve_session_reuses_unchanged_preamble_source_test.go +21 -0
- package/cmd/ttscgraph/serve_session_reuses_unchanged_snapshot_test.go +12 -7
- package/cmd/ttscgraph/serve_session_revisits_source_edited_during_load_test.go +18 -8
- package/cmd/ttscgraph/serve_session_tolerates_os_invalid_resolution_candidate_test.go +13 -9
- package/cmd/ttscgraph/serve_session_tracks_all_module_specifier_forms_test.go +12 -3
- package/cmd/ttscgraph/serve_session_tracks_diamond_project_references_once_test.go +12 -8
- package/cmd/ttscgraph/serve_shards.go +356 -279
- package/cmd/ttscgraph/serve_shards_abandoned_generation_converges_on_retry_test.go +41 -16
- package/cmd/ttscgraph/serve_shards_delete_removed_source_test.go +14 -4
- package/cmd/ttscgraph/serve_shards_external_endpoints_test.go +18 -2
- package/cmd/ttscgraph/serve_shards_keep_source_distributed_dependencies_at_the_boundary_test.go +36 -5
- package/cmd/ttscgraph/serve_shards_match_full_dump_oracle_test.go +12 -3
- package/cmd/ttscgraph/serve_shards_merge_pending_and_new_edits_test.go +36 -3
- package/cmd/ttscgraph/serve_shards_prune_unreferenced_external_endpoints_test.go +18 -2
- package/cmd/ttscgraph/serve_shards_publish_created_source_test.go +16 -13
- package/cmd/ttscgraph/serve_shards_rebuild_declaration_edit_test.go +14 -4
- package/cmd/ttscgraph/serve_shards_refresh_cross_file_implementation_test.go +24 -5
- package/cmd/ttscgraph/serve_shards_refresh_dependent_diagnostics_test.go +30 -7
- package/cmd/ttscgraph/serve_shards_rename_moves_source_identity_test.go +14 -11
- package/cmd/ttscgraph/serve_shards_retry_preserves_committed_generation_test.go +17 -7
- package/cmd/ttscgraph/serve_shards_reuse_unaffected_sources_test.go +21 -7
- package/cmd/ttscgraph/serve_snapshot_proves_its_program_without_a_second_read_test.go +57 -16
- package/cmd/ttscgraph/serve_source_encoding_test.go +133 -0
- package/cmd/ttscserver/command_operation_families_test.go +207 -0
- package/cmd/ttscserver/main.go +121 -39
- package/cmd/ttscserver/resolve_launch_uses_native_flag_authority_test.go +147 -0
- package/cmd/ttscserver/run_lsp_forwards_execute_command_advertisement_flags_test.go +7 -0
- package/cmd/ttscserver/run_lsp_prefers_tsgo_flag_test.go +13 -1
- package/cmd/ttscserver/run_lsp_reports_getwd_error_test.go +5 -0
- package/cmd/ttscserver/run_lsp_reports_server_error_test.go +10 -3
- package/cmd/ttscserver/run_lsp_uses_native_plugin_manifest_source_test.go +13 -10
- package/cmd/ttscserver/run_lsp_uses_tsgo_environment_test.go +10 -3
- package/driver/authored_region_maps_positions_around_the_preamble_test.go +95 -0
- package/driver/build_information_uses_selected_output_identity_test.go +148 -0
- package/driver/check_observations.go +67 -0
- package/driver/config_discovery.go +93 -24
- package/driver/declaration_shape.go +9 -0
- package/driver/diagnostics_preamble.go +8 -7
- package/driver/emit_containment.go +29 -8
- package/driver/emit_plugin.go +106 -36
- package/driver/emit_plugin_output.go +26 -2
- package/driver/emit_provenance.go +155 -0
- package/driver/graph.go +54 -20
- package/driver/host.go +26 -3
- package/driver/input_observation.go +78 -16
- package/driver/input_observation_test.go +34 -11
- package/driver/lsp.go +401 -30
- package/driver/overlay.go +69 -2
- package/driver/plugins.go +256 -24
- package/driver/private_result.go +43 -0
- package/driver/program.go +439 -95
- package/driver/resolution_candidates.go +63 -14
- package/driver/resolution_candidates_test.go +28 -0
- package/driver/resolutioninputs/recorder.cjs +1149 -0
- package/driver/resolutioninputs/resolutioninputs.go +37 -0
- package/driver/rewrite.go +373 -420
- package/driver/session.go +80 -12
- package/driver/sourcemap_preamble.go +38 -16
- package/driver/transform_dependencies.go +38 -10
- package/driver/transform_dependencies_declares_every_file_without_a_contributor_test.go +9 -8
- package/driver/transform_dependencies_drops_a_self_reported_dependency_test.go +7 -6
- package/driver/transform_dependencies_keys_a_reported_path_like_the_envelope_test.go +9 -9
- package/driver/transform_dependencies_requires_every_contributor_to_declare_test.go +10 -5
- package/driver/transform_dependencies_stays_silent_for_an_undeclared_contributor_test.go +8 -6
- package/driver/transform_dependencies_withdraws_completeness_after_an_unusable_dependency_test.go +9 -5
- package/driver/transform_source_map.go +388 -0
- package/driver/windowsjunction/create_preserves_existing_directory_windows_test.go +48 -0
- package/driver/windowsjunction/create_treats_paths_as_data_windows_test.go +55 -0
- package/driver/windowsjunction/windowsjunction.go +17 -1
- package/go.mod +10 -10
- package/go.sum +10 -10
- package/internal/cwd/cwd.go +13 -0
- package/internal/e2etrace/artifact.go +147 -0
- package/internal/e2etrace/completion_hints.go +35 -0
- package/internal/e2etrace/completion_hints_test.go +76 -0
- package/internal/e2etrace/e2etrace.go +303 -0
- package/internal/e2etrace/output.go +50 -0
- package/internal/graph/artifacts.go +69 -12
- package/internal/graph/artifacts_index_what_a_plugin_published_test.go +19 -8
- package/internal/graph/artifacts_survive_a_partial_rebuild_test.go +11 -12
- package/internal/graph/assigned_implementations_of_declaration_file_symbols_leave_no_edge_source_test.go +10 -12
- package/internal/graph/assigned_implementations_of_node_modules_symbols_leave_no_edge_source_test.go +7 -1
- package/internal/graph/build.go +122 -38
- package/internal/graph/build_files_reuses_committed_cross_file_endpoints_test.go +9 -3
- package/internal/graph/build_keeps_source_distributed_dependencies_at_the_external_boundary_test.go +10 -1
- package/internal/graph/build_records_a_node_per_top_level_declaration_test.go +10 -4
- package/internal/graph/build_releases_the_scratch_it_no_longer_reads_test.go +22 -15
- package/internal/graph/decorators.go +18 -0
- package/internal/graph/decorators_capture_name_and_literal_arguments_test.go +9 -4
- package/internal/graph/diagnostics.go +21 -8
- package/internal/graph/doc_refs_are_the_use_the_checker_already_counts_test.go +25 -13
- package/internal/graph/doc_refs_resolve_documentation_links_test.go +19 -15
- package/internal/graph/doc_tags.go +28 -19
- package/internal/graph/doc_tags_are_claimed_before_they_are_read_test.go +16 -6
- package/internal/graph/doc_tags_capture_every_unrecognized_tag_test.go +9 -2
- package/internal/graph/doc_tags_read_only_what_the_parser_attached_test.go +12 -8
- package/internal/graph/doc_tags_stop_at_the_external_boundary_test.go +11 -1
- package/internal/graph/doc_tags_survive_line_endings_and_repeated_blocks_test.go +16 -6
- package/internal/graph/dump.go +200 -51
- package/internal/graph/dump_checkout_paths_are_stable_test.go +9 -2
- package/internal/graph/dump_diagnostics_ride_the_generation_that_built_it_test.go +10 -11
- package/internal/graph/dump_evidence_skips_leading_trivia_test.go +8 -2
- package/internal/graph/dump_is_a_function_of_the_source_test.go +12 -13
- package/internal/graph/dump_never_serializes_a_list_as_null_test.go +9 -9
- package/internal/graph/dump_path_mapper_caches_alias_resolution_test.go +10 -2
- package/internal/graph/dump_path_mapper_rejects_unportable_roots_and_collisions_test.go +53 -0
- package/internal/graph/{dump_paths_are_portable_and_injective_test.go → dump_path_mapper_uses_portable_coordinates_test.go} +8 -43
- package/internal/graph/dump_paths.go +61 -25
- package/internal/graph/dump_paths_canonicalize_windows_short_root_test.go +45 -8
- package/internal/graph/dump_rejects_provenance_only_path_errors_test.go +5 -0
- package/internal/graph/dump_serializes_the_full_graph_test.go +13 -19
- package/internal/graph/dump_symlink_project_publishes_matching_base_test.go +8 -0
- package/internal/graph/dump_uses_ecma_line_terminators_test.go +12 -6
- package/internal/graph/duplicate_variable_object_members_keep_first_declaration_test.go +11 -8
- package/internal/graph/edge_spans_point_to_resolved_usage_test.go +13 -5
- package/internal/graph/edges.go +44 -47
- package/internal/graph/edges_cover_class_level_references_test.go +14 -11
- package/internal/graph/enum_initializer_calls_are_edges_test.go +13 -3
- package/internal/graph/enum_members_carry_their_names_on_the_enum_node_test.go +19 -26
- package/internal/graph/exports.go +3 -5
- package/internal/graph/file_diagnostics_match_tsgo_code_and_location_test.go +9 -4
- package/internal/graph/file_diagnostics_report_code_column_and_message_test.go +11 -5
- package/internal/graph/function_locals_do_not_collide_test.go +27 -7
- package/internal/graph/gitignore.go +25 -12
- package/internal/graph/graph.go +167 -52
- package/internal/graph/heritage_edges_cover_implements_and_interface_extends_test.go +11 -3
- package/internal/graph/heritage_edges_keep_extends_and_implements_to_same_base_test.go +6 -0
- package/internal/graph/heritage_edges_record_extends_versus_implements_origin_test.go +9 -3
- package/internal/graph/heritage_edges_traverse_barrels_and_stop_at_external_leaves_test.go +11 -4
- package/internal/graph/line_model.go +44 -25
- package/internal/graph/literals.go +6 -7
- package/internal/graph/literals_are_absent_when_the_type_admits_more_than_it_can_name_test.go +10 -5
- package/internal/graph/literals_cover_enum_members_the_graph_has_no_nodes_for_test.go +15 -17
- package/internal/graph/literals_do_not_depend_on_declaration_line_wrapping_test.go +10 -9
- package/internal/graph/literals_render_every_value_in_typescript_source_form_test.go +11 -11
- package/internal/graph/literals_resolve_through_alias_indirection_test.go +11 -11
- package/internal/graph/member_relation_edges_follow_checker_validity_test.go +11 -2
- package/internal/graph/member_relation_edges_preserve_checker_boundaries_test.go +11 -1
- package/internal/graph/member_relation_edges_reject_checker_invalid_pairs_test.go +12 -7
- package/internal/graph/namespace_dotted_form_qualifies_deeply_test.go +12 -3
- package/internal/graph/namespace_members_become_qualified_nodes_and_edges_test.go +12 -2
- package/internal/graph/node_identity_is_position_invariant_test.go +8 -2
- package/internal/graph/node_ids_preserve_hash_bearing_components_test.go +10 -2
- package/internal/graph/node_modifiers_emit_union_strings_test.go +13 -12
- package/internal/graph/nodes_are_marked_exported_through_the_export_table_test.go +12 -14
- package/internal/graph/object_literal_declarations_resolve_calls_test.go +170 -0
- package/internal/graph/object_literal_members_ride_on_the_snapshot_test.go +14 -13
- package/internal/graph/object_member_signatures_preserve_literal_whitespace_test.go +11 -7
- package/internal/graph/object_members.go +100 -1
- package/internal/graph/overload_implementation_replaces_signature_test.go +13 -2
- package/internal/graph/property_member_edges_remain_owner_visible_test.go +9 -3
- package/internal/graph/provenance.go +172 -87
- package/internal/graph/resolve.go +46 -12
- package/internal/graph/resolve_prefers_implementation_declaration_test.go +10 -2
- package/internal/graph/resolve_unwraps_barrel_reexport_to_real_declaration_test.go +16 -20
- package/internal/graph/source.go +16 -6
- package/internal/graph/source_texts_cover_every_resident_program_source_test.go +11 -7
- package/internal/graph/type_ref_edges_cover_typeof_as_satisfies_test.go +21 -2
- package/internal/graph/type_ref_edges_resolve_named_types_across_files_test.go +8 -3
- package/internal/graph/value_access_edges_cover_properties_test.go +11 -3
- package/internal/graph/value_call_edges_attribute_function_assignments_to_members_test.go +10 -4
- package/internal/graph/value_call_edges_cover_jsx_components_test.go +12 -8
- package/internal/graph/value_call_edges_cover_methods_and_constructors_test.go +12 -9
- package/internal/graph/value_call_edges_cover_variable_bound_callables_test.go +9 -3
- package/internal/graph/value_call_edges_do_not_double_record_invoked_member_access_test.go +10 -3
- package/internal/graph/value_call_edges_record_construct_versus_call_origin_test.go +12 -9
- package/internal/graph/value_call_edges_resolve_across_files_and_dedupe_test.go +10 -3
- package/internal/graph/value_call_edges_skip_self_and_unresolved_test.go +16 -5
- package/internal/graph/wire_node_ids_share_alias_resolution_test.go +10 -4
- package/internal/graphsymbols/position_helpers_follow_ecma_line_terminators_test.go +16 -4
- package/internal/graphsymbols/provider.go +278 -113
- package/internal/lspserver/lsp_clean_didopen_refreshes_compiler_state_test.go +14 -12
- package/internal/lspserver/lsp_completion_gate_never_refuses_a_matching_line_test.go +7 -1
- package/internal/lspserver/lsp_completion_hints_longest_trigger_wins_test.go +30 -5
- package/internal/lspserver/lsp_completion_hints_nearest_trigger_wins_test.go +5 -0
- package/internal/lspserver/lsp_completion_merges_into_upstream_response_test.go +23 -10
- package/internal/lspserver/lsp_completion_nearest_hint_replaces_nearest_filter_test.go +7 -1
- package/internal/lspserver/lsp_completion_preserves_completion_list_extensions_test.go +13 -5
- package/internal/lspserver/lsp_completion_refuses_hints_inside_a_string_literal_test.go +11 -7
- package/internal/lspserver/lsp_completion_replaces_full_filter_in_rank_order_test.go +12 -2
- package/internal/lspserver/lsp_completion_request.go +5 -26
- package/internal/lspserver/lsp_completion_scope.go +13 -10
- package/internal/lspserver/lsp_completion_scope_bench_test.go +11 -5
- package/internal/lspserver/lsp_completion_scope_classifies_regex_statement_and_operator_boundaries_test.go +8 -1
- package/internal/lspserver/lsp_completion_scope_ignores_jsdoc_bytes_in_literals_test.go +11 -10
- package/internal/lspserver/lsp_completion_scope_refuses_regex_hints_test.go +7 -3
- package/internal/lspserver/lsp_completion_trigger_uses_last_rune_test.go +6 -0
- package/internal/lspserver/lsp_deleted_watched_file_withdraws_plugin_diagnostics_test.go +11 -10
- package/internal/lspserver/lsp_didsave_keeps_the_incremental_changed_uri_path_test.go +12 -9
- package/internal/lspserver/lsp_document_diagnostics_omits_cached_project_when_current_result_has_none_test.go +17 -5
- package/internal/lspserver/lsp_envelope.go +84 -11
- package/internal/lspserver/lsp_executable_project_input_change_requests_launcher_restart_test.go +12 -9
- package/internal/lspserver/lsp_external_watched_change_retains_program_test.go +8 -2
- package/internal/lspserver/lsp_frame.go +42 -10
- package/internal/lspserver/lsp_hints_absence_is_not_an_error_test.go +16 -15
- package/internal/lspserver/lsp_hints_refresh_coalesces_concurrent_requests_test.go +21 -12
- package/internal/lspserver/lsp_hints_refresh_ignores_a_superseded_generation_test.go +20 -12
- package/internal/lspserver/lsp_hints_refresh_keeps_each_producer_isolated_test.go +30 -9
- package/internal/lspserver/lsp_hints_refresh_replaces_the_session_snapshot_test.go +25 -18
- package/internal/lspserver/lsp_hints_refresh_scheduled_by_editor_events_test.go +12 -12
- package/internal/lspserver/lsp_hints_refresh_serves_completion_while_running_test.go +21 -8
- package/internal/lspserver/lsp_index_byte_from_bounds_its_search_start_test.go +9 -7
- package/internal/lspserver/lsp_initialize_constrains_position_encoding_to_utf16_test.go +57 -21
- package/internal/lspserver/lsp_late_completion_trigger_is_reported_once_test.go +16 -17
- package/internal/lspserver/lsp_native_completion_hints_decode_flat_lint_wire_test.go +8 -2
- package/internal/lspserver/lsp_native_completion_hints_grouped_compatibility_boundary_test.go +5 -0
- package/internal/lspserver/lsp_native_plugin_source.go +381 -202
- package/internal/lspserver/lsp_native_plugin_source_ends_the_session_on_a_selection_input_test.go +234 -0
- package/internal/lspserver/lsp_native_reply_policies_test.go +475 -0
- package/internal/lspserver/lsp_native_reply_policy.go +232 -0
- package/internal/lspserver/lsp_native_resident.go +171 -57
- package/internal/lspserver/lsp_plugin.go +372 -68
- package/internal/lspserver/lsp_plugin_completion_resolve_stays_local_test.go +13 -4
- package/internal/lspserver/lsp_plugin_selection_inputs.go +283 -0
- package/internal/lspserver/lsp_plugin_selection_inputs_follow_directory_case_semantics_windows_test.go +81 -0
- package/internal/lspserver/lsp_position_conversions_span_astral_and_combining_runes_test.go +33 -11
- package/internal/lspserver/lsp_project_context_transport_identity_test.go +14 -2
- package/internal/lspserver/lsp_project_diagnostics.go +25 -4
- package/internal/lspserver/lsp_project_diagnostics_capability_is_independent_test.go +13 -2
- package/internal/lspserver/lsp_project_diagnostics_program_input_overlap_refreshes_all_producers_test.go +14 -4
- package/internal/lspserver/lsp_project_diagnostics_refresh_accumulates_owner_freshness_test.go +8 -2
- package/internal/lspserver/lsp_project_diagnostics_refresh_keeps_each_producer_last_good_test.go +10 -5
- package/internal/lspserver/lsp_project_diagnostics_refreshes_only_input_owners_test.go +14 -2
- package/internal/lspserver/lsp_project_diagnostics_resume_preserves_generation_test.go +8 -2
- package/internal/lspserver/lsp_project_diagnostics_translates_relative_client_project_test.go +15 -11
- package/internal/lspserver/lsp_project_input_ownership_resolves_declared_spellings_test.go +17 -8
- package/internal/lspserver/lsp_project_input_path_key_windows.go +16 -16
- package/internal/lspserver/lsp_project_input_path_key_windows_test.go +34 -18
- package/internal/lspserver/lsp_project_input_registration.go +5 -1
- package/internal/lspserver/lsp_project_input_registration_rechecks_selection_baseline_test.go +10 -4
- package/internal/lspserver/lsp_project_input_registration_reconciles_rejected_pending_request_test.go +5 -0
- package/internal/lspserver/lsp_project_input_registration_shapes_patterns_test.go +9 -3
- package/internal/lspserver/lsp_project_input_watchers_anchor_missing_paths_test.go +8 -3
- package/internal/lspserver/lsp_project_inputs.go +203 -59
- package/internal/lspserver/lsp_project_inputs_match_missing_exact_and_glob_test.go +10 -6
- package/internal/lspserver/lsp_project_inputs_reject_invalid_and_foreign_snapshots_test.go +25 -2
- package/internal/lspserver/lsp_proxy.go +239 -80
- package/internal/lspserver/lsp_refresh.go +16 -1
- package/internal/lspserver/lsp_reload_directories_compare_immediate_topology_test.go +66 -19
- package/internal/lspserver/lsp_reload_directories_separate_glob_territory_test.go +26 -6
- package/internal/lspserver/lsp_reload_file_fingerprint_preserves_raw_symlink_target_test.go +12 -6
- package/internal/lspserver/lsp_reload_fingerprints_read_a_junction_as_a_link_test.go +76 -0
- package/internal/lspserver/lsp_resident_falls_back_when_serve_unsupported_test.go +20 -13
- package/internal/lspserver/lsp_resident_invalidation_broadcasts_program_input_overlap_test.go +9 -4
- package/internal/lspserver/lsp_resident_invalidation_targets_project_input_owners_test.go +6 -1
- package/internal/lspserver/lsp_resident_maps_verb_args_test.go +5 -0
- package/internal/lspserver/lsp_same_transport_entries_are_deduplicated_test.go +10 -1
- package/internal/lspserver/lsp_server.go +124 -21
- package/internal/lspserver/lsp_symbols.go +92 -13
- package/internal/lspserver/lsp_watched_file_changes_reach_compiler_caches_test.go +11 -10
- package/internal/sourceprocess/complete_group.go +70 -0
- package/internal/sourceprocess/complete_group_preserves_original_wait_and_requires_independent_absence_test.go +145 -0
- package/internal/sourceprocess/contain_unix.go +143 -0
- package/internal/sourceprocess/contain_windows.go +442 -0
- package/internal/sourceprocess/darwin_group_retirement_preserves_phase_evidence_test.go +287 -0
- package/internal/sourceprocess/observe_exit_darwin.go +57 -0
- package/internal/sourceprocess/observe_exit_linux.go +27 -0
- package/internal/sourceprocess/observe_exit_other.go +11 -0
- package/internal/sourceprocess/reap_linux.go +31 -0
- package/internal/sourceprocess/reap_other.go +10 -0
- package/internal/sourceprocess/request_preserves_native_command_inputs_test.go +86 -0
- package/internal/sourceprocess/run.go +216 -0
- package/internal/sourceprocess/target_windows.go +211 -0
- package/internal/sourceprocess/windows_job_accounting_rejects_invalid_boundary_test.go +97 -0
- package/internal/sourceprocess/windows_target_owns_suspended_admission_test.go +179 -0
- package/internal/watchhelper/run.go +32 -0
- package/internal/watchhelper/run_linux.go +323 -0
- package/internal/watchhelper/run_linux_test.go +418 -0
- package/internal/watchhelper/run_other.go +16 -0
- package/internal/watchhelper/watchhelper.go +100 -0
- package/lib/TtscCompiler.d.ts +118 -21
- package/lib/TtscCompiler.js +175 -179
- package/lib/TtscCompiler.js.map +1 -1
- package/lib/TtscService.d.ts +66 -18
- package/lib/TtscService.js +81 -24
- package/lib/TtscService.js.map +1 -1
- package/lib/TtscServiceRequestOptions.d.ts +21 -0
- package/lib/TtscServiceRequestOptions.js +3 -0
- package/lib/TtscServiceRequestOptions.js.map +1 -0
- package/lib/compiler/internal/CapturedProcessOutput.d.ts +61 -0
- package/lib/compiler/internal/CapturedProcessOutput.js +3 -0
- package/lib/compiler/internal/CapturedProcessOutput.js.map +1 -0
- package/lib/compiler/internal/CompilerArgumentsInspection.d.ts +53 -0
- package/lib/compiler/internal/CompilerArgumentsInspection.js +173 -0
- package/lib/compiler/internal/CompilerArgumentsInspection.js.map +1 -0
- package/lib/compiler/internal/EmitOwnershipIndex.d.ts +92 -0
- package/lib/compiler/internal/EmitOwnershipIndex.js +215 -0
- package/lib/compiler/internal/EmitOwnershipIndex.js.map +1 -0
- package/lib/compiler/internal/PrivateCompilerOutput.d.ts +67 -0
- package/lib/compiler/internal/PrivateCompilerOutput.js +245 -0
- package/lib/compiler/internal/PrivateCompilerOutput.js.map +1 -0
- package/lib/compiler/internal/ResidentCheckProcess.d.ts +127 -0
- package/lib/compiler/internal/ResidentCheckProcess.js +403 -0
- package/lib/compiler/internal/ResidentCheckProcess.js.map +1 -0
- package/lib/compiler/internal/ResidentCheckProcessOptions.d.ts +29 -0
- package/lib/compiler/internal/ResidentCheckProcessOptions.js +3 -0
- package/lib/compiler/internal/ResidentCheckProcessOptions.js.map +1 -0
- package/lib/compiler/internal/ResidentCheckRequest.d.ts +37 -0
- package/lib/compiler/internal/ResidentCheckRequest.js +3 -0
- package/lib/compiler/internal/ResidentCheckRequest.js.map +1 -0
- package/lib/compiler/internal/ResidentCheckResult.d.ts +23 -0
- package/lib/compiler/internal/ResidentCheckResult.js +3 -0
- package/lib/compiler/internal/ResidentCheckResult.js.map +1 -0
- package/lib/compiler/internal/ResidentCheckTelemetry.d.ts +33 -0
- package/lib/compiler/internal/ResidentCheckTelemetry.js +3 -0
- package/lib/compiler/internal/ResidentCheckTelemetry.js.map +1 -0
- package/lib/compiler/internal/ResidentReplyKind.d.ts +18 -0
- package/lib/compiler/internal/ResidentReplyKind.js +3 -0
- package/lib/compiler/internal/ResidentReplyKind.js.map +1 -0
- package/lib/compiler/internal/ResidentTransformProcess.d.ts +83 -0
- package/lib/compiler/internal/ResidentTransformProcess.js +261 -0
- package/lib/compiler/internal/ResidentTransformProcess.js.map +1 -0
- package/lib/compiler/internal/ResidentTransformProcessOptions.d.ts +27 -0
- package/lib/compiler/internal/ResidentTransformProcessOptions.js +3 -0
- package/lib/compiler/internal/ResidentTransformProcessOptions.js.map +1 -0
- package/lib/compiler/internal/ResidentTransformReply.d.ts +51 -0
- package/lib/compiler/internal/ResidentTransformReply.js +79 -0
- package/lib/compiler/internal/ResidentTransformReply.js.map +1 -0
- package/lib/compiler/internal/ResidentTransformRequestOptions.d.ts +16 -0
- package/lib/compiler/internal/ResidentTransformRequestOptions.js +3 -0
- package/lib/compiler/internal/ResidentTransformRequestOptions.js.map +1 -0
- package/lib/compiler/internal/ResidentTransformRequests.d.ts +102 -0
- package/lib/compiler/internal/ResidentTransformRequests.js +172 -0
- package/lib/compiler/internal/ResidentTransformRequests.js.map +1 -0
- package/lib/compiler/internal/StartedResidentTransform.d.ts +27 -0
- package/lib/compiler/internal/StartedResidentTransform.js +3 -0
- package/lib/compiler/internal/StartedResidentTransform.js.map +1 -0
- package/lib/compiler/internal/TransformProjectWorkerReply.d.ts +34 -0
- package/lib/compiler/internal/TransformProjectWorkerReply.js +3 -0
- package/lib/compiler/internal/TransformProjectWorkerReply.js.map +1 -0
- package/lib/compiler/internal/TransformProjectWorkerRequest.d.ts +39 -0
- package/lib/compiler/internal/TransformProjectWorkerRequest.js +3 -0
- package/lib/compiler/internal/TransformProjectWorkerRequest.js.map +1 -0
- package/lib/compiler/internal/build/BuildExecution.d.ts +359 -0
- package/lib/compiler/internal/build/BuildExecution.js +977 -0
- package/lib/compiler/internal/build/BuildExecution.js.map +1 -0
- package/lib/compiler/internal/build/BuildTiming.d.ts +99 -0
- package/lib/compiler/internal/build/BuildTiming.js +113 -0
- package/lib/compiler/internal/build/BuildTiming.js.map +1 -0
- package/lib/compiler/internal/build/CompilerDiagnostics.d.ts +82 -0
- package/lib/compiler/internal/build/CompilerDiagnostics.js +270 -0
- package/lib/compiler/internal/build/CompilerDiagnostics.js.map +1 -0
- package/lib/compiler/internal/build/NativePluginArguments.d.ts +114 -0
- package/lib/compiler/internal/build/NativePluginArguments.js +255 -0
- package/lib/compiler/internal/build/NativePluginArguments.js.map +1 -0
- package/lib/compiler/internal/build/PassthroughFlags.d.ts +137 -0
- package/lib/compiler/internal/build/PassthroughFlags.js +213 -0
- package/lib/compiler/internal/build/PassthroughFlags.js.map +1 -0
- package/lib/compiler/internal/build/PluginFailureDiagnostics.d.ts +48 -0
- package/lib/compiler/internal/build/PluginFailureDiagnostics.js +68 -0
- package/lib/compiler/internal/build/PluginFailureDiagnostics.js.map +1 -0
- package/lib/compiler/internal/build/ResidentCheckEntryPlan.d.ts +38 -0
- package/lib/compiler/internal/build/ResidentCheckEntryPlan.js +3 -0
- package/lib/compiler/internal/build/ResidentCheckEntryPlan.js.map +1 -0
- package/lib/compiler/internal/build/ResidentCheckWatchChange.d.ts +30 -0
- package/lib/compiler/internal/build/ResidentCheckWatchChange.js +3 -0
- package/lib/compiler/internal/build/ResidentCheckWatchChange.js.map +1 -0
- package/lib/compiler/internal/build/ResidentCheckWatchSession.d.ts +113 -0
- package/lib/compiler/internal/build/ResidentCheckWatchSession.js +378 -0
- package/lib/compiler/internal/build/ResidentCheckWatchSession.js.map +1 -0
- package/lib/compiler/internal/build/RunBuildOptions.d.ts +130 -0
- package/lib/compiler/internal/build/RunBuildOptions.js +3 -0
- package/lib/compiler/internal/build/RunBuildOptions.js.map +1 -0
- package/lib/compiler/internal/build/TsgoArguments.d.ts +168 -0
- package/lib/compiler/internal/build/TsgoArguments.js +324 -0
- package/lib/compiler/internal/build/TsgoArguments.js.map +1 -0
- package/lib/compiler/internal/build/appendBuildOutput.d.ts +41 -0
- package/lib/compiler/internal/build/appendBuildOutput.js +182 -0
- package/lib/compiler/internal/build/appendBuildOutput.js.map +1 -0
- package/lib/compiler/internal/build/bufferResidentCheckEntryRequests.d.ts +20 -0
- package/lib/compiler/internal/build/bufferResidentCheckEntryRequests.js +40 -0
- package/lib/compiler/internal/build/bufferResidentCheckEntryRequests.js.map +1 -0
- package/lib/compiler/internal/build/createProcessDiagnostic.d.ts +19 -0
- package/lib/compiler/internal/build/createProcessDiagnostic.js +30 -0
- package/lib/compiler/internal/build/createProcessDiagnostic.js.map +1 -0
- package/lib/compiler/internal/build/isAbsoluteLocalProjectInputPath.d.ts +22 -0
- package/lib/compiler/internal/build/isAbsoluteLocalProjectInputPath.js +59 -0
- package/lib/compiler/internal/build/isAbsoluteLocalProjectInputPath.js.map +1 -0
- package/lib/compiler/internal/build/mergeProjectInputSnapshots.d.ts +28 -0
- package/lib/compiler/internal/build/mergeProjectInputSnapshots.js +121 -0
- package/lib/compiler/internal/build/mergeProjectInputSnapshots.js.map +1 -0
- package/lib/compiler/internal/build/normalizeBuildOutput.d.ts +29 -0
- package/lib/compiler/internal/build/normalizeBuildOutput.js +72 -0
- package/lib/compiler/internal/build/normalizeBuildOutput.js.map +1 -0
- package/lib/compiler/internal/build/parseProjectInputSnapshot.d.ts +26 -0
- package/lib/compiler/internal/build/parseProjectInputSnapshot.js +68 -0
- package/lib/compiler/internal/build/parseProjectInputSnapshot.js.map +1 -0
- package/lib/compiler/internal/build/planResidentCheckEntries.d.ts +21 -0
- package/lib/compiler/internal/build/planResidentCheckEntries.js +45 -0
- package/lib/compiler/internal/build/planResidentCheckEntries.js.map +1 -0
- package/lib/compiler/internal/build/privateRuntimeRootDir.d.ts +20 -0
- package/lib/compiler/internal/build/privateRuntimeRootDir.js +35 -0
- package/lib/compiler/internal/build/privateRuntimeRootDir.js.map +1 -0
- package/lib/compiler/internal/build/residentCheckRequest.d.ts +22 -0
- package/lib/compiler/internal/build/residentCheckRequest.js +42 -0
- package/lib/compiler/internal/build/residentCheckRequest.js.map +1 -0
- package/lib/compiler/internal/build/runBuild.d.ts +22 -0
- package/lib/compiler/internal/build/runBuild.js +44 -0
- package/lib/compiler/internal/build/runBuild.js.map +1 -0
- package/lib/compiler/internal/build/runExternalEmitProvenance.d.ts +61 -0
- package/lib/compiler/internal/build/runExternalEmitProvenance.js +451 -0
- package/lib/compiler/internal/build/runExternalEmitProvenance.js.map +1 -0
- package/lib/compiler/internal/build/takeResidentCheckEntryRequest.d.ts +18 -0
- package/lib/compiler/internal/build/takeResidentCheckEntryRequest.js +28 -0
- package/lib/compiler/internal/build/takeResidentCheckEntryRequest.js.map +1 -0
- package/lib/compiler/internal/buildNativeCompiler.d.ts +16 -1
- package/lib/compiler/internal/buildNativeCompiler.js +14 -2
- package/lib/compiler/internal/buildNativeCompiler.js.map +1 -1
- package/lib/compiler/internal/captureProcessOutput.d.ts +23 -21
- package/lib/compiler/internal/captureProcessOutput.js +40 -26
- package/lib/compiler/internal/captureProcessOutput.js.map +1 -1
- package/lib/compiler/internal/compileProjectInMemory.d.ts +30 -7
- package/lib/compiler/internal/compileProjectInMemory.js +103 -83
- package/lib/compiler/internal/compileProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/ensureExecutable.d.ts +15 -0
- package/lib/compiler/internal/ensureExecutable.js +40 -0
- package/lib/compiler/internal/ensureExecutable.js.map +1 -0
- package/lib/compiler/internal/findNearestGoMod.d.ts +23 -0
- package/lib/compiler/internal/findNearestGoMod.js +48 -0
- package/lib/compiler/internal/findNearestGoMod.js.map +1 -0
- package/lib/compiler/internal/isOutsideRelativePath.d.ts +18 -0
- package/lib/compiler/internal/isOutsideRelativePath.js +30 -0
- package/lib/compiler/internal/isOutsideRelativePath.js.map +1 -0
- package/lib/compiler/internal/outputText.d.ts +16 -0
- package/lib/compiler/internal/outputText.js +25 -0
- package/lib/compiler/internal/outputText.js.map +1 -0
- package/lib/compiler/internal/packageRootDir.d.ts +25 -0
- package/lib/compiler/internal/packageRootDir.js +47 -0
- package/lib/compiler/internal/packageRootDir.js.map +1 -0
- package/lib/compiler/internal/parseNativeTransformOutput.d.ts +88 -0
- package/lib/compiler/internal/parseNativeTransformOutput.js +552 -0
- package/lib/compiler/internal/parseNativeTransformOutput.js.map +1 -0
- package/lib/compiler/internal/project/CompilerProjectSelection.d.ts +80 -0
- package/lib/compiler/internal/project/CompilerProjectSelection.js +187 -0
- package/lib/compiler/internal/project/CompilerProjectSelection.js.map +1 -0
- package/lib/compiler/internal/project/ConfigJsonText.d.ts +50 -0
- package/lib/compiler/internal/project/ConfigJsonText.js +61 -0
- package/lib/compiler/internal/project/ConfigJsonText.js.map +1 -0
- package/lib/compiler/internal/project/compilerUsesCaseSensitiveFileNames.d.ts +48 -0
- package/lib/compiler/internal/project/compilerUsesCaseSensitiveFileNames.js +119 -0
- package/lib/compiler/internal/project/compilerUsesCaseSensitiveFileNames.js.map +1 -0
- package/lib/compiler/internal/project/createNativeProjectContextArgs.d.ts +11 -8
- package/lib/compiler/internal/project/createNativeProjectContextArgs.js +15 -17
- package/lib/compiler/internal/project/createNativeProjectContextArgs.js.map +1 -1
- package/lib/compiler/internal/project/createNativeProjectContextJson.d.ts +19 -0
- package/lib/compiler/internal/project/createNativeProjectContextJson.js +27 -0
- package/lib/compiler/internal/project/createNativeProjectContextJson.js.map +1 -0
- package/lib/compiler/internal/project/parseJsonc.d.ts +42 -0
- package/lib/compiler/internal/project/parseJsonc.js +317 -0
- package/lib/compiler/internal/project/parseJsonc.js.map +1 -0
- package/lib/compiler/internal/project/readJsonFile.d.ts +21 -0
- package/lib/compiler/internal/project/readJsonFile.js +38 -0
- package/lib/compiler/internal/project/readJsonFile.js.map +1 -0
- package/lib/compiler/internal/project/readJsoncFile.d.ts +20 -0
- package/lib/compiler/internal/project/readJsoncFile.js +47 -0
- package/lib/compiler/internal/project/readJsoncFile.js.map +1 -0
- package/lib/compiler/internal/project/readProjectConfig.d.ts +29 -2
- package/lib/compiler/internal/project/readProjectConfig.js +105 -168
- package/lib/compiler/internal/project/readProjectConfig.js.map +1 -1
- package/lib/compiler/internal/project/resolveOwningProjectConfig.d.ts +65 -0
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js +248 -0
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js.map +1 -0
- package/lib/compiler/internal/project/resolveProjectConfig.d.ts +17 -14
- package/lib/compiler/internal/project/resolveProjectConfig.js +19 -122
- package/lib/compiler/internal/project/resolveProjectConfig.js.map +1 -1
- package/lib/compiler/internal/project/resolveProjectIdentity.d.ts +32 -0
- package/lib/compiler/internal/project/resolveProjectIdentity.js +144 -0
- package/lib/compiler/internal/project/resolveProjectIdentity.js.map +1 -0
- package/lib/compiler/internal/project/resolveTsconfigExtends.d.ts +38 -0
- package/lib/compiler/internal/project/resolveTsconfigExtends.js +163 -0
- package/lib/compiler/internal/project/resolveTsconfigExtends.js.map +1 -0
- package/lib/compiler/internal/project/selectReferencedProject.d.ts +26 -0
- package/lib/compiler/internal/project/selectReferencedProject.js +48 -0
- package/lib/compiler/internal/project/selectReferencedProject.js.map +1 -0
- package/lib/compiler/internal/project/tsconfigExtendsFileCandidates.d.ts +34 -0
- package/lib/compiler/internal/project/tsconfigExtendsFileCandidates.js +55 -0
- package/lib/compiler/internal/project/tsconfigExtendsFileCandidates.js.map +1 -0
- package/lib/compiler/internal/readEffectiveCompilerOptions.d.ts +54 -0
- package/lib/compiler/internal/readEffectiveCompilerOptions.js +116 -0
- package/lib/compiler/internal/readEffectiveCompilerOptions.js.map +1 -0
- package/lib/compiler/internal/resolveBinary.d.ts +17 -1
- package/lib/compiler/internal/resolveBinary.js +24 -9
- package/lib/compiler/internal/resolveBinary.js.map +1 -1
- package/lib/compiler/internal/resolveTsgo.d.ts +22 -7
- package/lib/compiler/internal/resolveTsgo.js +25 -9
- package/lib/compiler/internal/resolveTsgo.js.map +1 -1
- package/lib/compiler/internal/runNativeCheckWithObservations.d.ts +41 -0
- package/lib/compiler/internal/runNativeCheckWithObservations.js +185 -0
- package/lib/compiler/internal/runNativeCheckWithObservations.js.map +1 -0
- package/lib/compiler/internal/runSingleFileEmit.d.ts +26 -5
- package/lib/compiler/internal/runSingleFileEmit.js +82 -27
- package/lib/compiler/internal/runSingleFileEmit.js.map +1 -1
- package/lib/compiler/internal/sharedHost/SEMANTIC_CONFIG_PATH_ENV.d.ts +2 -0
- package/lib/compiler/internal/sharedHost/SEMANTIC_CONFIG_PATH_ENV.js +6 -0
- package/lib/compiler/internal/sharedHost/SEMANTIC_CONFIG_PATH_ENV.js.map +1 -0
- package/lib/compiler/internal/sharedHost/SidecarEnvironment.d.ts +90 -0
- package/lib/compiler/internal/sharedHost/SidecarEnvironment.js +153 -0
- package/lib/compiler/internal/sharedHost/SidecarEnvironment.js.map +1 -0
- package/lib/compiler/internal/sharedHost/TSGO_ARGS_CWD_ENV.d.ts +7 -0
- package/lib/compiler/internal/sharedHost/TSGO_ARGS_CWD_ENV.js +11 -0
- package/lib/compiler/internal/sharedHost/TSGO_ARGS_CWD_ENV.js.map +1 -0
- package/lib/compiler/internal/sharedHost/TSGO_ARGS_ENV.d.ts +7 -0
- package/lib/compiler/internal/sharedHost/TSGO_ARGS_ENV.js +11 -0
- package/lib/compiler/internal/sharedHost/TSGO_ARGS_ENV.js.map +1 -0
- package/lib/compiler/internal/sharedHost/assertSharedHostCompatibility.d.ts +24 -0
- package/lib/compiler/internal/sharedHost/assertSharedHostCompatibility.js +46 -0
- package/lib/compiler/internal/sharedHost/assertSharedHostCompatibility.js.map +1 -0
- package/lib/compiler/internal/sharedHost/clearInheritedSemanticConfigPath.d.ts +15 -0
- package/lib/compiler/internal/sharedHost/clearInheritedSemanticConfigPath.js +23 -0
- package/lib/compiler/internal/sharedHost/clearInheritedSemanticConfigPath.js.map +1 -0
- package/lib/compiler/internal/sharedHost/clearInheritedTsgoArgs.d.ts +23 -0
- package/lib/compiler/internal/sharedHost/clearInheritedTsgoArgs.js +33 -0
- package/lib/compiler/internal/sharedHost/clearInheritedTsgoArgs.js.map +1 -0
- package/lib/compiler/internal/sharedHost/inheritedSidecarEnv.d.ts +27 -0
- package/lib/compiler/internal/sharedHost/inheritedSidecarEnv.js +41 -0
- package/lib/compiler/internal/sharedHost/inheritedSidecarEnv.js.map +1 -0
- package/lib/compiler/internal/sharedHost/isLinkedTransform.d.ts +16 -0
- package/lib/compiler/internal/sharedHost/isLinkedTransform.js +21 -0
- package/lib/compiler/internal/sharedHost/isLinkedTransform.js.map +1 -0
- package/lib/compiler/internal/sharedHost/linkedTransformPlugins.d.ts +19 -0
- package/lib/compiler/internal/sharedHost/linkedTransformPlugins.js +25 -0
- package/lib/compiler/internal/sharedHost/linkedTransformPlugins.js.map +1 -0
- package/lib/compiler/internal/sharedHost/publishLinkedTransformPlugins.d.ts +25 -0
- package/lib/compiler/internal/sharedHost/publishLinkedTransformPlugins.js +35 -0
- package/lib/compiler/internal/sharedHost/publishLinkedTransformPlugins.js.map +1 -0
- package/lib/compiler/internal/sharedHost/resolvePluginConfigDir.d.ts +26 -0
- package/lib/compiler/internal/sharedHost/resolvePluginConfigDir.js +36 -0
- package/lib/compiler/internal/sharedHost/resolvePluginConfigDir.js.map +1 -0
- package/lib/compiler/internal/sharedHost/selectSharedHostPlugin.d.ts +22 -0
- package/lib/compiler/internal/sharedHost/selectSharedHostPlugin.js +32 -0
- package/lib/compiler/internal/sharedHost/selectSharedHostPlugin.js.map +1 -0
- package/lib/compiler/internal/spawnNative.d.ts +15 -16
- package/lib/compiler/internal/spawnNative.js +20 -48
- package/lib/compiler/internal/spawnNative.js.map +1 -1
- package/lib/compiler/internal/startResidentTransform.d.ts +26 -17
- package/lib/compiler/internal/startResidentTransform.js +51 -36
- package/lib/compiler/internal/startResidentTransform.js.map +1 -1
- package/lib/compiler/internal/transformProjectInMemory.d.ts +42 -5
- package/lib/compiler/internal/transformProjectInMemory.js +197 -471
- package/lib/compiler/internal/transformProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/transformProjectInWorker.d.ts +49 -0
- package/lib/compiler/internal/transformProjectInWorker.js +168 -0
- package/lib/compiler/internal/transformProjectInWorker.js.map +1 -0
- package/lib/compiler/internal/transformProjectWorker.js +37 -0
- package/lib/compiler/internal/transformProjectWorker.js.map +1 -0
- package/lib/flags/AnySubcommand.d.ts +18 -0
- package/lib/flags/AnySubcommand.js +3 -0
- package/lib/flags/AnySubcommand.js.map +1 -0
- package/lib/flags/COMPILER_ENUM_WHITESPACE.d.ts +2 -0
- package/lib/flags/COMPILER_ENUM_WHITESPACE.js +38 -0
- package/lib/flags/COMPILER_ENUM_WHITESPACE.js.map +1 -0
- package/lib/flags/COMPILER_OPTIONS.d.ts +6 -0
- package/lib/flags/COMPILER_OPTIONS.js +509 -0
- package/lib/flags/COMPILER_OPTIONS.js.map +1 -0
- package/lib/flags/COMPILER_OPTION_ASCII_FOLDS.d.ts +2 -0
- package/lib/flags/COMPILER_OPTION_ASCII_FOLDS.js +13 -0
- package/lib/flags/COMPILER_OPTION_ASCII_FOLDS.js.map +1 -0
- package/lib/flags/COMPILER_OPTION_KINDS.d.ts +2 -0
- package/lib/flags/COMPILER_OPTION_KINDS.js +14 -0
- package/lib/flags/COMPILER_OPTION_KINDS.js.map +1 -0
- package/lib/flags/CompilerOptionSpec.d.ts +27 -0
- package/lib/flags/CompilerOptionSpec.js +3 -0
- package/lib/flags/CompilerOptionSpec.js.map +1 -0
- package/lib/flags/FLAG_BY_TOKEN.d.ts +8 -0
- package/lib/flags/FLAG_BY_TOKEN.js +34 -0
- package/lib/flags/FLAG_BY_TOKEN.js.map +1 -0
- package/lib/flags/FLAG_SCHEMA.d.ts +35 -0
- package/lib/flags/{schema.js → FLAG_SCHEMA.js} +47 -153
- package/lib/flags/FLAG_SCHEMA.js.map +1 -0
- package/lib/flags/FlagKind.d.ts +22 -0
- package/lib/flags/FlagKind.js +3 -0
- package/lib/flags/FlagKind.js.map +1 -0
- package/lib/flags/FlagLayer.d.ts +19 -0
- package/lib/flags/FlagLayer.js +3 -0
- package/lib/flags/FlagLayer.js.map +1 -0
- package/lib/flags/FlagSpec.d.ts +104 -0
- package/lib/flags/FlagSpec.js +3 -0
- package/lib/flags/FlagSpec.js.map +1 -0
- package/lib/flags/ParseOptions.d.ts +92 -0
- package/lib/flags/ParseOptions.js +3 -0
- package/lib/flags/ParseOptions.js.map +1 -0
- package/lib/flags/ParseResult.d.ts +37 -0
- package/lib/flags/ParseResult.js +3 -0
- package/lib/flags/ParseResult.js.map +1 -0
- package/lib/flags/TtscSubcommand.d.ts +14 -0
- package/lib/flags/TtscSubcommand.js +3 -0
- package/lib/flags/TtscSubcommand.js.map +1 -0
- package/lib/flags/TtsxSubcommand.d.ts +13 -0
- package/lib/flags/TtsxSubcommand.js +3 -0
- package/lib/flags/TtsxSubcommand.js.map +1 -0
- package/lib/flags/ValueValidator.d.ts +14 -0
- package/lib/flags/ValueValidator.js +3 -0
- package/lib/flags/ValueValidator.js.map +1 -0
- package/lib/flags/buildGoAllowList.d.ts +18 -0
- package/lib/flags/buildGoAllowList.js +45 -0
- package/lib/flags/buildGoAllowList.js.map +1 -0
- package/lib/flags/flagsForSubcommand.d.ts +18 -0
- package/lib/flags/flagsForSubcommand.js +23 -0
- package/lib/flags/flagsForSubcommand.js.map +1 -0
- package/lib/flags/getBoolean.d.ts +19 -0
- package/lib/flags/getBoolean.js +27 -0
- package/lib/flags/getBoolean.js.map +1 -0
- package/lib/flags/getNumber.d.ts +16 -0
- package/lib/flags/getNumber.js +24 -0
- package/lib/flags/getNumber.js.map +1 -0
- package/lib/flags/getString.d.ts +16 -0
- package/lib/flags/getString.js +24 -0
- package/lib/flags/getString.js.map +1 -0
- package/lib/flags/getStringList.d.ts +19 -0
- package/lib/flags/getStringList.js +24 -0
- package/lib/flags/getStringList.js.map +1 -0
- package/lib/flags/normalizeCompilerEnumValue.d.ts +20 -0
- package/lib/flags/normalizeCompilerEnumValue.js +40 -0
- package/lib/flags/normalizeCompilerEnumValue.js.map +1 -0
- package/lib/flags/normalizeFlagToken.d.ts +28 -0
- package/lib/flags/normalizeFlagToken.js +38 -0
- package/lib/flags/normalizeFlagToken.js.map +1 -0
- package/lib/flags/parseFlags.d.ts +18 -0
- package/lib/flags/parseFlags.js +288 -0
- package/lib/flags/parseFlags.js.map +1 -0
- package/lib/flags/readCompilerOptionOccurrence.d.ts +34 -0
- package/lib/flags/readCompilerOptionOccurrence.js +81 -0
- package/lib/flags/readCompilerOptionOccurrence.js.map +1 -0
- package/lib/flags/readCompilerOptionValues.d.ts +33 -0
- package/lib/flags/readCompilerOptionValues.js +58 -0
- package/lib/flags/readCompilerOptionValues.js.map +1 -0
- package/lib/flags/resolveFlagSpec.d.ts +21 -0
- package/lib/flags/resolveFlagSpec.js +32 -0
- package/lib/flags/resolveFlagSpec.js.map +1 -0
- package/lib/index.d.ts +8 -3
- package/lib/index.js +10 -3
- package/lib/index.js.map +1 -1
- package/lib/internal/CanonicalTempDirectoryOperations.d.ts +73 -0
- package/lib/internal/CanonicalTempDirectoryOperations.js +3 -0
- package/lib/internal/CanonicalTempDirectoryOperations.js.map +1 -0
- package/lib/internal/CompilerContextSnapshot.d.ts +66 -0
- package/lib/internal/CompilerContextSnapshot.js +121 -0
- package/lib/internal/CompilerContextSnapshot.js.map +1 -0
- package/lib/internal/CompilerResultAdapter.d.ts +129 -0
- package/lib/internal/CompilerResultAdapter.js +247 -0
- package/lib/internal/CompilerResultAdapter.js.map +1 -0
- package/lib/internal/E2ETrace.d.ts +219 -0
- package/lib/internal/E2ETrace.js +541 -0
- package/lib/internal/E2ETrace.js.map +1 -0
- package/lib/internal/IJavaScriptRuntimeCapabilities.d.ts +48 -0
- package/lib/internal/IJavaScriptRuntimeCapabilities.js +3 -0
- package/lib/internal/IJavaScriptRuntimeCapabilities.js.map +1 -0
- package/lib/internal/OwnedNativeProcess.d.ts +66 -0
- package/lib/internal/OwnedNativeProcess.js +317 -0
- package/lib/internal/OwnedNativeProcess.js.map +1 -0
- package/lib/internal/OwnedSynchronousProcess.d.ts +158 -0
- package/lib/internal/OwnedSynchronousProcess.js +171 -0
- package/lib/internal/OwnedSynchronousProcess.js.map +1 -0
- package/lib/internal/RetireLockDirectoryOperations.d.ts +77 -0
- package/lib/internal/RetireLockDirectoryOperations.js +3 -0
- package/lib/internal/RetireLockDirectoryOperations.js.map +1 -0
- package/lib/internal/SafeCacheCleanupTarget.d.ts +39 -0
- package/lib/internal/SafeCacheCleanupTarget.js +3 -0
- package/lib/internal/SafeCacheCleanupTarget.js.map +1 -0
- package/lib/internal/SourceNativeRetirement.d.ts +384 -0
- package/lib/internal/SourceNativeRetirement.js +892 -0
- package/lib/internal/SourceNativeRetirement.js.map +1 -0
- package/lib/internal/SpawnSyncOutputFiles.d.ts +28 -0
- package/lib/internal/SpawnSyncOutputFiles.js +3 -0
- package/lib/internal/SpawnSyncOutputFiles.js.map +1 -0
- package/lib/internal/cacheEntryExists.d.ts +13 -0
- package/lib/internal/cacheEntryExists.js +32 -0
- package/lib/internal/cacheEntryExists.js.map +1 -0
- package/lib/internal/createCanonicalTempDirectory.d.ts +23 -13
- package/lib/internal/createCanonicalTempDirectory.js +31 -12
- package/lib/internal/createCanonicalTempDirectory.js.map +1 -1
- package/lib/internal/isContendedCandidateRename.d.ts +27 -0
- package/lib/internal/isContendedCandidateRename.js +37 -0
- package/lib/internal/isContendedCandidateRename.js.map +1 -0
- package/lib/internal/isSpawnSyncFdExhaustion.d.ts +16 -0
- package/lib/internal/isSpawnSyncFdExhaustion.js +23 -0
- package/lib/internal/isSpawnSyncFdExhaustion.js.map +1 -0
- package/lib/internal/javascriptRuntimeCapabilities.d.ts +20 -0
- package/lib/internal/javascriptRuntimeCapabilities.js +142 -0
- package/lib/internal/javascriptRuntimeCapabilities.js.map +1 -0
- package/lib/internal/nativeBinary.d.ts +11 -0
- package/lib/internal/nativeBinary.js +16 -0
- package/lib/internal/nativeBinary.js.map +1 -0
- package/lib/internal/parseWindowsDirectoryCaseSensitivity.d.ts +24 -0
- package/lib/internal/parseWindowsDirectoryCaseSensitivity.js +47 -0
- package/lib/internal/parseWindowsDirectoryCaseSensitivity.js.map +1 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentity.d.ts +43 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentity.js +3 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentity.js.map +1 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentityContext.d.ts +176 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentityContext.js +3 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentityContext.js.map +1 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentityOperations.d.ts +100 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentityOperations.js +3 -0
- package/lib/internal/pathIdentity/FilesystemPathIdentityOperations.js.map +1 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentity.d.ts +20 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentity.js +3 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentity.js.map +1 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentityContext.d.ts +20 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentityContext.js +3 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentityContext.js.map +1 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentityOperations.d.ts +20 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentityOperations.js +3 -0
- package/lib/internal/pathIdentity/ProjectInputPathIdentityOperations.js.map +1 -0
- package/lib/internal/pathIdentity/createFilesystemPathIdentityContext.d.ts +25 -0
- package/lib/internal/pathIdentity/createFilesystemPathIdentityContext.js +336 -0
- package/lib/internal/pathIdentity/createFilesystemPathIdentityContext.js.map +1 -0
- package/lib/internal/pathIdentity/createProjectInputPathIdentityContext.d.ts +28 -0
- package/lib/internal/pathIdentity/createProjectInputPathIdentityContext.js +33 -0
- package/lib/internal/pathIdentity/createProjectInputPathIdentityContext.js.map +1 -0
- package/lib/internal/pathIdentity/isFilesystemPathIdentityWithin.d.ts +20 -0
- package/lib/internal/pathIdentity/isFilesystemPathIdentityWithin.js +33 -0
- package/lib/internal/pathIdentity/isFilesystemPathIdentityWithin.js.map +1 -0
- package/lib/internal/pathIdentity/isProjectInputPathIdentityWithin.d.ts +15 -0
- package/lib/internal/pathIdentity/isProjectInputPathIdentityWithin.js +22 -0
- package/lib/internal/pathIdentity/isProjectInputPathIdentityWithin.js.map +1 -0
- package/lib/internal/pathIdentity/resolveFilesystemPath.d.ts +22 -0
- package/lib/internal/pathIdentity/resolveFilesystemPath.js +44 -0
- package/lib/internal/pathIdentity/resolveFilesystemPath.js.map +1 -0
- package/lib/internal/pathIdentity/resolvePhysicalPath.d.ts +21 -0
- package/lib/internal/pathIdentity/resolvePhysicalPath.js +35 -0
- package/lib/internal/pathIdentity/resolvePhysicalPath.js.map +1 -0
- package/lib/internal/pathIdentity/resolveProjectInputPath.d.ts +14 -0
- package/lib/internal/pathIdentity/resolveProjectInputPath.js +21 -0
- package/lib/internal/pathIdentity/resolveProjectInputPath.js.map +1 -0
- package/lib/internal/pluginSource.d.ts +26 -0
- package/lib/internal/pluginSource.js +43 -0
- package/lib/internal/pluginSource.js.map +1 -0
- package/lib/internal/projectInputPathIdentity.d.ts +27 -31
- package/lib/internal/projectInputPathIdentity.js +37 -275
- package/lib/internal/projectInputPathIdentity.js.map +1 -1
- package/lib/internal/resolveNodeBinary.d.ts +9 -7
- package/lib/internal/resolveNodeBinary.js +14 -120
- package/lib/internal/resolveNodeBinary.js.map +1 -1
- package/lib/internal/resolveSafeCacheCleanupTargets.d.ts +27 -8
- package/lib/internal/resolveSafeCacheCleanupTargets.js +44 -11
- package/lib/internal/resolveSafeCacheCleanupTargets.js.map +1 -1
- package/lib/internal/restoreCompilerError.d.ts +21 -0
- package/lib/internal/restoreCompilerError.js +164 -0
- package/lib/internal/restoreCompilerError.js.map +1 -0
- package/lib/internal/retireLockDirectory.d.ts +45 -0
- package/lib/internal/retireLockDirectory.js +152 -0
- package/lib/internal/retireLockDirectory.js.map +1 -0
- package/lib/internal/runHoldingLock.d.ts +30 -0
- package/lib/internal/runHoldingLock.js +53 -0
- package/lib/internal/runHoldingLock.js.map +1 -0
- package/lib/internal/runtimeExecutableIdentity.d.ts +20 -0
- package/lib/internal/runtimeExecutableIdentity.js +171 -0
- package/lib/internal/runtimeExecutableIdentity.js.map +1 -0
- package/lib/internal/serializeCompilerError.d.ts +28 -0
- package/lib/internal/serializeCompilerError.js +138 -0
- package/lib/internal/serializeCompilerError.js.map +1 -0
- package/lib/internal/spawnSyncResilient.d.ts +31 -0
- package/lib/internal/spawnSyncResilient.js +50 -0
- package/lib/internal/spawnSyncResilient.js.map +1 -0
- package/lib/internal/spawnSyncWithLowDescriptors.d.ts +30 -0
- package/lib/internal/spawnSyncWithLowDescriptors.js +194 -0
- package/lib/internal/spawnSyncWithLowDescriptors.js.map +1 -0
- package/lib/internal/tsconfig.d.ts +16 -0
- package/lib/internal/tsconfig.js +33 -0
- package/lib/internal/tsconfig.js.map +1 -0
- package/lib/launcher/internal/PendingResidentCheckWatchChanges.d.ts +56 -0
- package/lib/launcher/internal/PendingResidentCheckWatchChanges.js +97 -0
- package/lib/launcher/internal/PendingResidentCheckWatchChanges.js.map +1 -0
- package/lib/launcher/internal/TtscBuildMode.d.ts +14 -0
- package/lib/launcher/internal/TtscBuildMode.js +3 -0
- package/lib/launcher/internal/TtscBuildMode.js.map +1 -0
- package/lib/launcher/internal/TtsxEntryOptions.d.ts +50 -0
- package/lib/launcher/internal/TtsxEntryOptions.js +94 -0
- package/lib/launcher/internal/TtsxEntryOptions.js.map +1 -0
- package/lib/launcher/internal/assertNoSolutionBuild.d.ts +17 -10
- package/lib/launcher/internal/assertNoSolutionBuild.js +16 -9
- package/lib/launcher/internal/assertNoSolutionBuild.js.map +1 -1
- package/lib/launcher/internal/assertTtsxNoWatch.d.ts +25 -0
- package/lib/launcher/internal/assertTtsxNoWatch.js +46 -0
- package/lib/launcher/internal/assertTtsxNoWatch.js.map +1 -0
- package/lib/launcher/internal/buildSingleRootProject.d.ts +108 -0
- package/lib/launcher/internal/buildSingleRootProject.js +229 -0
- package/lib/launcher/internal/buildSingleRootProject.js.map +1 -0
- package/lib/launcher/internal/getCompilerVersionText.d.ts +14 -1
- package/lib/launcher/internal/getCompilerVersionText.js +21 -6
- package/lib/launcher/internal/getCompilerVersionText.js.map +1 -1
- package/lib/launcher/internal/inlineServedSourceMap.d.ts +35 -0
- package/lib/launcher/internal/inlineServedSourceMap.js +255 -0
- package/lib/launcher/internal/inlineServedSourceMap.js.map +1 -0
- package/lib/launcher/internal/linkVirtualEntry.d.ts +31 -0
- package/lib/launcher/internal/linkVirtualEntry.js +87 -0
- package/lib/launcher/internal/linkVirtualEntry.js.map +1 -0
- package/lib/launcher/internal/parseCommonJsExports.d.ts +17 -0
- package/lib/launcher/internal/{commonJsExportMetadata.js → parseCommonJsExports.js} +13 -3
- package/lib/launcher/internal/parseCommonJsExports.js.map +1 -0
- package/lib/launcher/internal/parseTtscBuildArgs.d.ts +34 -0
- package/lib/launcher/internal/parseTtscBuildArgs.js +97 -0
- package/lib/launcher/internal/parseTtscBuildArgs.js.map +1 -0
- package/lib/launcher/internal/parseTtsxCLI.d.ts +35 -0
- package/lib/launcher/internal/parseTtsxCLI.js +187 -0
- package/lib/launcher/internal/parseTtsxCLI.js.map +1 -0
- package/lib/launcher/internal/prepareExecution.d.ts +49 -5
- package/lib/launcher/internal/prepareExecution.js +360 -324
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/prepareTtscBuildMode.d.ts +23 -0
- package/lib/launcher/internal/prepareTtscBuildMode.js +58 -0
- package/lib/launcher/internal/prepareTtscBuildMode.js.map +1 -0
- package/lib/launcher/internal/resolveCacheDir.d.ts +12 -3
- package/lib/launcher/internal/resolveCacheDir.js +12 -3
- package/lib/launcher/internal/resolveCacheDir.js.map +1 -1
- package/lib/launcher/internal/resolveSingleFileOutput.d.ts +35 -0
- package/lib/launcher/internal/resolveSingleFileOutput.js +115 -0
- package/lib/launcher/internal/resolveSingleFileOutput.js.map +1 -0
- package/lib/launcher/internal/resolveTtscserverBinary.d.ts +15 -3
- package/lib/launcher/internal/resolveTtscserverBinary.js +19 -5
- package/lib/launcher/internal/resolveTtscserverBinary.js.map +1 -1
- package/lib/launcher/internal/runTtsc.d.ts +23 -23
- package/lib/launcher/internal/runTtsc.js +336 -286
- package/lib/launcher/internal/runTtsc.js.map +1 -1
- package/lib/launcher/internal/runTtsx.d.ts +32 -4
- package/lib/launcher/internal/runTtsx.js +286 -138
- package/lib/launcher/internal/runTtsx.js.map +1 -1
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.d.ts +92 -0
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.js +354 -0
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.js.map +1 -0
- package/lib/launcher/internal/runtime/DependencyBuildAdmission.d.ts +72 -0
- package/lib/launcher/internal/runtime/DependencyBuildAdmission.js +120 -0
- package/lib/launcher/internal/runtime/DependencyBuildAdmission.js.map +1 -0
- package/lib/launcher/internal/runtime/DependencyBuildGeneration.d.ts +185 -0
- package/lib/launcher/internal/runtime/DependencyBuildGeneration.js +153 -0
- package/lib/launcher/internal/runtime/DependencyBuildGeneration.js.map +1 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockFence.d.ts +22 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockFence.js +3 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockFence.js.map +1 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockLease.d.ts +22 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockLease.js +3 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockLease.js.map +1 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockObservation.d.ts +41 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockObservation.js +3 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockObservation.js.map +1 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockProtocol.d.ts +83 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockProtocol.js +126 -0
- package/lib/launcher/internal/runtime/DependencyBuildLockProtocol.js.map +1 -0
- package/lib/launcher/internal/runtime/OwnedProjectSource.d.ts +112 -0
- package/lib/launcher/internal/runtime/OwnedProjectSource.js +59 -0
- package/lib/launcher/internal/runtime/OwnedProjectSource.js.map +1 -0
- package/lib/launcher/internal/runtime/OwningModuleOptions.d.ts +21 -0
- package/lib/launcher/internal/runtime/OwningModuleOptions.js +3 -0
- package/lib/launcher/internal/runtime/OwningModuleOptions.js.map +1 -0
- package/lib/launcher/internal/runtime/PluginDescriptorInputObservation.d.ts +89 -0
- package/lib/launcher/internal/runtime/PluginDescriptorInputObservation.js +115 -0
- package/lib/launcher/internal/runtime/PluginDescriptorInputObservation.js.map +1 -0
- package/lib/launcher/internal/runtime/ProcessOwnedDirectory.d.ts +168 -0
- package/lib/launcher/internal/runtime/ProcessOwnedDirectory.js +251 -0
- package/lib/launcher/internal/runtime/ProcessOwnedDirectory.js.map +1 -0
- package/lib/launcher/internal/runtime/ResolveResult.d.ts +24 -0
- package/lib/launcher/internal/runtime/ResolveResult.js +3 -0
- package/lib/launcher/internal/runtime/ResolveResult.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeEmitProvenance.d.ts +38 -0
- package/lib/launcher/internal/runtime/RuntimeEmitProvenance.js +60 -0
- package/lib/launcher/internal/runtime/RuntimeEmitProvenance.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeEntryPreparer.d.ts +22 -0
- package/lib/launcher/internal/runtime/RuntimeEntryPreparer.js +3 -0
- package/lib/launcher/internal/runtime/RuntimeEntryPreparer.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeFilesystem.d.ts +52 -0
- package/lib/launcher/internal/runtime/RuntimeFilesystem.js +73 -0
- package/lib/launcher/internal/runtime/RuntimeFilesystem.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeHookOptions.d.ts +22 -0
- package/lib/launcher/internal/runtime/RuntimeHookOptions.js +3 -0
- package/lib/launcher/internal/runtime/RuntimeHookOptions.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeIsolatedEmit.d.ts +53 -0
- package/lib/launcher/internal/runtime/RuntimeIsolatedEmit.js +88 -0
- package/lib/launcher/internal/runtime/RuntimeIsolatedEmit.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeLoaderCapabilities.d.ts +78 -0
- package/lib/launcher/internal/runtime/RuntimeLoaderCapabilities.js +256 -0
- package/lib/launcher/internal/runtime/RuntimeLoaderCapabilities.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeManifest.d.ts +65 -0
- package/lib/launcher/internal/runtime/RuntimeManifest.js +3 -0
- package/lib/launcher/internal/runtime/RuntimeManifest.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeManifestRegistry.d.ts +95 -0
- package/lib/launcher/internal/runtime/RuntimeManifestRegistry.js +268 -0
- package/lib/launcher/internal/runtime/RuntimeManifestRegistry.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeModuleFormat.d.ts +60 -0
- package/lib/launcher/internal/runtime/RuntimeModuleFormat.js +249 -0
- package/lib/launcher/internal/runtime/RuntimeModuleFormat.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeProjectOwnership.d.ts +50 -0
- package/lib/launcher/internal/runtime/RuntimeProjectOwnership.js +134 -0
- package/lib/launcher/internal/runtime/RuntimeProjectOwnership.js.map +1 -0
- package/lib/launcher/internal/runtime/TTSX_MINIMUM_NODE_VERSION.d.ts +11 -0
- package/lib/launcher/internal/runtime/TTSX_MINIMUM_NODE_VERSION.js +15 -0
- package/lib/launcher/internal/runtime/TTSX_MINIMUM_NODE_VERSION.js.map +1 -0
- package/lib/launcher/internal/runtime/acquireDependencyBuildLock.d.ts +22 -0
- package/lib/launcher/internal/runtime/acquireDependencyBuildLock.js +74 -0
- package/lib/launcher/internal/runtime/acquireDependencyBuildLock.js.map +1 -0
- package/lib/launcher/internal/runtime/checkNodeRuntimeSupport.d.ts +30 -0
- package/lib/launcher/internal/runtime/checkNodeRuntimeSupport.js +83 -0
- package/lib/launcher/internal/runtime/checkNodeRuntimeSupport.js.map +1 -0
- package/lib/launcher/internal/runtime/claimRuntimeProjectDirectory.d.ts +30 -0
- package/lib/launcher/internal/runtime/claimRuntimeProjectDirectory.js +52 -0
- package/lib/launcher/internal/runtime/claimRuntimeProjectDirectory.js.map +1 -0
- package/lib/launcher/internal/runtime/commonJsExportNames.d.ts +21 -0
- package/lib/launcher/internal/runtime/commonJsExportNames.js +68 -0
- package/lib/launcher/internal/runtime/commonJsExportNames.js.map +1 -0
- package/lib/launcher/internal/runtime/commonJsImportFacade.d.ts +32 -0
- package/lib/launcher/internal/runtime/commonJsImportFacade.js +56 -0
- package/lib/launcher/internal/runtime/commonJsImportFacade.js.map +1 -0
- package/lib/launcher/internal/runtime/dependencyCacheKey.d.ts +36 -0
- package/lib/launcher/internal/runtime/dependencyCacheKey.js +57 -0
- package/lib/launcher/internal/runtime/dependencyCacheKey.js.map +1 -0
- package/lib/launcher/internal/runtime/dependencyCacheRoot.d.ts +32 -0
- package/lib/launcher/internal/runtime/dependencyCacheRoot.js +98 -0
- package/lib/launcher/internal/runtime/dependencyCacheRoot.js.map +1 -0
- package/lib/launcher/internal/runtime/inspectDependencyBuildLock.d.ts +23 -0
- package/lib/launcher/internal/runtime/inspectDependencyBuildLock.js +126 -0
- package/lib/launcher/internal/runtime/inspectDependencyBuildLock.js.map +1 -0
- package/lib/launcher/internal/runtime/installRuntimeHooks.d.ts +58 -0
- package/lib/launcher/internal/runtime/installRuntimeHooks.js +1988 -0
- package/lib/launcher/internal/runtime/installRuntimeHooks.js.map +1 -0
- package/lib/launcher/internal/runtime/interopProbe.d.ts +8 -0
- package/lib/launcher/internal/runtime/interopProbe.js +3 -0
- package/lib/launcher/internal/runtime/interopProbe.js.map +1 -0
- package/lib/launcher/internal/runtime/isLocalProcessGone.d.ts +33 -0
- package/lib/launcher/internal/runtime/isLocalProcessGone.js +60 -0
- package/lib/launcher/internal/runtime/isLocalProcessGone.js.map +1 -0
- package/lib/launcher/internal/runtime/observeMappedDescriptorResolution.d.ts +28 -0
- package/lib/launcher/internal/runtime/observeMappedDescriptorResolution.js +50 -0
- package/lib/launcher/internal/runtime/observeMappedDescriptorResolution.js.map +1 -0
- package/lib/launcher/internal/runtime/projectModuleOptions.d.ts +16 -0
- package/lib/launcher/internal/runtime/projectModuleOptions.js +28 -0
- package/lib/launcher/internal/runtime/projectModuleOptions.js.map +1 -0
- package/lib/launcher/internal/runtime/readDependencyCache.d.ts +28 -0
- package/lib/launcher/internal/runtime/readDependencyCache.js +83 -0
- package/lib/launcher/internal/runtime/readDependencyCache.js.map +1 -0
- package/lib/launcher/internal/runtime/realPath.d.ts +22 -0
- package/lib/launcher/internal/runtime/realPath.js +37 -0
- package/lib/launcher/internal/runtime/realPath.js.map +1 -0
- package/lib/launcher/internal/runtime/reclaimDependencyBuildLock.d.ts +17 -0
- package/lib/launcher/internal/runtime/reclaimDependencyBuildLock.js +23 -0
- package/lib/launcher/internal/runtime/reclaimDependencyBuildLock.js.map +1 -0
- package/lib/launcher/internal/runtime/releaseDependencyBuildLock.d.ts +17 -0
- package/lib/launcher/internal/runtime/releaseDependencyBuildLock.js +23 -0
- package/lib/launcher/internal/runtime/releaseDependencyBuildLock.js.map +1 -0
- package/lib/launcher/internal/runtime/resolveRuntimeCleanTargets.d.ts +34 -0
- package/lib/launcher/internal/runtime/resolveRuntimeCleanTargets.js +88 -0
- package/lib/launcher/internal/runtime/resolveRuntimeCleanTargets.js.map +1 -0
- package/lib/launcher/internal/runtime/restoreStrippedNodeBuiltinScheme.d.ts +20 -0
- package/lib/launcher/internal/runtime/restoreStrippedNodeBuiltinScheme.js +30 -0
- package/lib/launcher/internal/runtime/restoreStrippedNodeBuiltinScheme.js.map +1 -0
- package/lib/launcher/internal/runtime/runtimeRunKey.d.ts +24 -0
- package/lib/launcher/internal/runtime/runtimeRunKey.js +36 -0
- package/lib/launcher/internal/runtime/runtimeRunKey.js.map +1 -0
- package/lib/launcher/internal/runtime/selectRuntimePluginPolicy.d.ts +21 -0
- package/lib/launcher/internal/runtime/selectRuntimePluginPolicy.js +29 -0
- package/lib/launcher/internal/runtime/selectRuntimePluginPolicy.js.map +1 -0
- package/lib/launcher/internal/runtime/withRuntimeDirectoryLock.d.ts +35 -0
- package/lib/launcher/internal/runtime/withRuntimeDirectoryLock.js +76 -0
- package/lib/launcher/internal/runtime/withRuntimeDirectoryLock.js.map +1 -0
- package/lib/launcher/internal/runtimeCompilerArgs.d.ts +35 -6
- package/lib/launcher/internal/runtimeCompilerArgs.js +87 -58
- package/lib/launcher/internal/runtimeCompilerArgs.js.map +1 -1
- package/lib/launcher/internal/runtimeEmitProfile.d.ts +39 -0
- package/lib/launcher/internal/runtimeEmitProfile.js +56 -0
- package/lib/launcher/internal/runtimeEmitProfile.js.map +1 -0
- package/lib/launcher/internal/runtimeHookPreload.js +4 -4
- package/lib/launcher/internal/runtimeHookPreload.js.map +1 -1
- package/lib/launcher/internal/runtimeOwnerPreload.d.ts +1 -0
- package/lib/launcher/internal/runtimeOwnerPreload.js +43 -0
- package/lib/launcher/internal/runtimeOwnerPreload.js.map +1 -0
- package/lib/launcher/internal/singleRootProjectConfig.d.ts +34 -0
- package/lib/launcher/internal/singleRootProjectConfig.js +39 -0
- package/lib/launcher/internal/singleRootProjectConfig.js.map +1 -0
- package/lib/launcher/internal/ttscserver/ILSPPluginSelectionInputs.d.ts +61 -0
- package/lib/launcher/internal/ttscserver/ILSPPluginSelectionInputs.js +3 -0
- package/lib/launcher/internal/ttscserver/ILSPPluginSelectionInputs.js.map +1 -0
- package/lib/launcher/internal/ttscserver/LSPProjectInputDigest.d.ts +95 -0
- package/lib/launcher/internal/ttscserver/LSPProjectInputDigest.js +270 -0
- package/lib/launcher/internal/ttscserver/LSPProjectInputDigest.js.map +1 -0
- package/lib/launcher/internal/ttscserver/captureLSPPluginSelectionInputs.d.ts +46 -0
- package/lib/launcher/internal/ttscserver/captureLSPPluginSelectionInputs.js +91 -0
- package/lib/launcher/internal/ttscserver/captureLSPPluginSelectionInputs.js.map +1 -0
- package/lib/launcher/internal/ttscserver/fingerprintInitialLSPProjectInputSnapshot.d.ts +21 -0
- package/lib/launcher/internal/ttscserver/fingerprintInitialLSPProjectInputSnapshot.js +39 -0
- package/lib/launcher/internal/ttscserver/fingerprintInitialLSPProjectInputSnapshot.js.map +1 -0
- package/lib/launcher/internal/ttscserver/initialLSPProjectInputSnapshotIsCurrent.d.ts +18 -0
- package/lib/launcher/internal/ttscserver/initialLSPProjectInputSnapshotIsCurrent.js +27 -0
- package/lib/launcher/internal/ttscserver/initialLSPProjectInputSnapshotIsCurrent.js.map +1 -0
- package/lib/launcher/internal/ttscserver/materializeLSPPluginManifest.d.ts +26 -0
- package/lib/launcher/internal/ttscserver/materializeLSPPluginManifest.js +62 -0
- package/lib/launcher/internal/ttscserver/materializeLSPPluginManifest.js.map +1 -0
- package/lib/launcher/internal/ttscserver/needsStdio.d.ts +17 -0
- package/lib/launcher/internal/ttscserver/needsStdio.js +36 -0
- package/lib/launcher/internal/ttscserver/needsStdio.js.map +1 -0
- package/lib/launcher/internal/ttscserver/runTtscserver.d.ts +25 -0
- package/lib/launcher/internal/ttscserver/runTtscserver.js +439 -0
- package/lib/launcher/internal/ttscserver/runTtscserver.js.map +1 -0
- package/lib/launcher/internal/watch/CompilerDirectoryWatchEventPlan.d.ts +29 -0
- package/lib/launcher/internal/watch/CompilerDirectoryWatchEventPlan.js +3 -0
- package/lib/launcher/internal/watch/CompilerDirectoryWatchEventPlan.js.map +1 -0
- package/lib/launcher/internal/watch/DirectoryWatcher.d.ts +44 -0
- package/lib/launcher/internal/watch/DirectoryWatcher.js +3 -0
- package/lib/launcher/internal/watch/DirectoryWatcher.js.map +1 -0
- package/lib/launcher/internal/watch/FseventsStreams.d.ts +87 -0
- package/lib/launcher/internal/watch/FseventsStreams.js +266 -0
- package/lib/launcher/internal/watch/FseventsStreams.js.map +1 -0
- package/lib/launcher/internal/watch/ProjectInputWatchRules.d.ts +92 -0
- package/lib/launcher/internal/watch/ProjectInputWatchRules.js +163 -0
- package/lib/launcher/internal/watch/ProjectInputWatchRules.js.map +1 -0
- package/lib/launcher/internal/watch/WatchInputChange.d.ts +29 -0
- package/lib/launcher/internal/watch/WatchInputChange.js +3 -0
- package/lib/launcher/internal/watch/WatchInputChange.js.map +1 -0
- package/lib/launcher/internal/watch/WatchPaths.d.ts +101 -0
- package/lib/launcher/internal/watch/WatchPaths.js +150 -0
- package/lib/launcher/internal/watch/WatchPaths.js.map +1 -0
- package/lib/launcher/internal/watch/WatchTopology.d.ts +384 -0
- package/lib/launcher/internal/{watchTopology.js → watch/WatchTopology.js} +726 -799
- package/lib/launcher/internal/watch/WatchTopology.js.map +1 -0
- package/lib/launcher/internal/watch/literalGlobRoot.d.ts +22 -0
- package/lib/launcher/internal/watch/literalGlobRoot.js +45 -0
- package/lib/launcher/internal/watch/literalGlobRoot.js.map +1 -0
- package/lib/launcher/internal/watch/planCompilerDirectoryWatchEvent.d.ts +40 -0
- package/lib/launcher/internal/watch/planCompilerDirectoryWatchEvent.js +69 -0
- package/lib/launcher/internal/watch/planCompilerDirectoryWatchEvent.js.map +1 -0
- package/lib/launcher/internal/watch/projectInputActiveWatchDirectories.d.ts +19 -0
- package/lib/launcher/internal/watch/projectInputActiveWatchDirectories.js +52 -0
- package/lib/launcher/internal/watch/projectInputActiveWatchDirectories.js.map +1 -0
- package/lib/launcher/internal/watch/projectInputAvailableWatchDirectory.d.ts +21 -0
- package/lib/launcher/internal/watch/projectInputAvailableWatchDirectory.js +55 -0
- package/lib/launcher/internal/watch/projectInputAvailableWatchDirectory.js.map +1 -0
- package/lib/launcher/internal/watch/projectInputEventShouldNotify.d.ts +21 -0
- package/lib/launcher/internal/watch/projectInputEventShouldNotify.js +23 -0
- package/lib/launcher/internal/watch/projectInputEventShouldNotify.js.map +1 -0
- package/lib/launcher/internal/watch/projectInputMembershipInvalidatesProgram.d.ts +27 -0
- package/lib/launcher/internal/watch/projectInputMembershipInvalidatesProgram.js +54 -0
- package/lib/launcher/internal/watch/projectInputMembershipInvalidatesProgram.js.map +1 -0
- package/lib/launcher/internal/watch/projectInputReloadEventShouldNotify.d.ts +26 -0
- package/lib/launcher/internal/watch/projectInputReloadEventShouldNotify.js +100 -0
- package/lib/launcher/internal/watch/projectInputReloadEventShouldNotify.js.map +1 -0
- package/lib/launcher/internal/watch/projectInputReplacementStrandsWatchers.d.ts +37 -0
- package/lib/launcher/internal/watch/projectInputReplacementStrandsWatchers.js +54 -0
- package/lib/launcher/internal/watch/projectInputReplacementStrandsWatchers.js.map +1 -0
- package/lib/launcher/internal/watch/projectInputTopologyMayAffect.d.ts +23 -0
- package/lib/launcher/internal/watch/projectInputTopologyMayAffect.js +67 -0
- package/lib/launcher/internal/watch/projectInputTopologyMayAffect.js.map +1 -0
- package/lib/launcher/internal/watch/projectInputWatchDirectories.d.ts +22 -0
- package/lib/launcher/internal/watch/projectInputWatchDirectories.js +30 -0
- package/lib/launcher/internal/watch/projectInputWatchDirectories.js.map +1 -0
- package/lib/launcher/internal/watch/reloadInputsForFailedTopologyRefresh.d.ts +22 -0
- package/lib/launcher/internal/watch/reloadInputsForFailedTopologyRefresh.js +45 -0
- package/lib/launcher/internal/watch/reloadInputsForFailedTopologyRefresh.js.map +1 -0
- package/lib/launcher/internal/watch/syncWatchers.d.ts +25 -0
- package/lib/launcher/internal/watch/syncWatchers.js +61 -0
- package/lib/launcher/internal/watch/syncWatchers.js.map +1 -0
- package/lib/launcher/internal/watch/watchDirectory.d.ts +28 -0
- package/lib/launcher/internal/watch/watchDirectory.js +46 -0
- package/lib/launcher/internal/watch/watchDirectory.js.map +1 -0
- package/lib/launcher/internal/watch/watchDirectoryThroughFsWatch.d.ts +28 -0
- package/lib/launcher/internal/watch/watchDirectoryThroughFsWatch.js +38 -0
- package/lib/launcher/internal/watch/watchDirectoryThroughFsWatch.js.map +1 -0
- package/lib/launcher/ttscserver.js +1 -1
- package/lib/launcher/ttscserver.js.map +1 -1
- package/lib/launcher/ttsx.js +2 -3
- package/lib/launcher/ttsx.js.map +1 -1
- package/lib/plugin/CapabilityPluginResolver.d.ts +140 -0
- package/lib/plugin/CapabilityPluginResolver.js +400 -0
- package/lib/plugin/CapabilityPluginResolver.js.map +1 -0
- package/lib/plugin/ITtscCapabilityPlugin.d.ts +87 -0
- package/lib/plugin/ITtscCapabilityPlugin.js +3 -0
- package/lib/plugin/ITtscCapabilityPlugin.js.map +1 -0
- package/lib/plugin/internal/CapabilityPluginResult.d.ts +66 -0
- package/lib/plugin/internal/CapabilityPluginResult.js +86 -0
- package/lib/plugin/internal/CapabilityPluginResult.js.map +1 -0
- package/lib/plugin/internal/CapabilityResolutionFormat.d.ts +114 -0
- package/lib/plugin/internal/CapabilityResolutionFormat.js +229 -0
- package/lib/plugin/internal/CapabilityResolutionFormat.js.map +1 -0
- package/lib/plugin/internal/ITtscCapabilityPluginSource.d.ts +35 -0
- package/lib/plugin/internal/ITtscCapabilityPluginSource.js +3 -0
- package/lib/plugin/internal/ITtscCapabilityPluginSource.js.map +1 -0
- package/lib/plugin/internal/ITtscCapabilityResolutionEntry.d.ts +49 -0
- package/lib/plugin/internal/ITtscCapabilityResolutionEntry.js +3 -0
- package/lib/plugin/internal/ITtscCapabilityResolutionEntry.js.map +1 -0
- package/lib/plugin/internal/ITtscCapabilityResolutionPlugin.d.ts +21 -0
- package/lib/plugin/internal/ITtscCapabilityResolutionPlugin.js +3 -0
- package/lib/plugin/internal/ITtscCapabilityResolutionPlugin.js.map +1 -0
- package/lib/plugin/internal/capabilityPluginWorker.d.ts +1 -0
- package/lib/plugin/internal/capabilityPluginWorker.js +178 -0
- package/lib/plugin/internal/capabilityPluginWorker.js.map +1 -0
- package/lib/plugin/internal/decodeCapabilityCommandReply.d.ts +23 -0
- package/lib/plugin/internal/decodeCapabilityCommandReply.js +25 -0
- package/lib/plugin/internal/decodeCapabilityCommandReply.js.map +1 -0
- package/lib/plugin/internal/load/COMMONJS_PLUGIN_DESCRIPTOR_SHIM_SOURCE.d.ts +15 -0
- package/lib/plugin/internal/load/COMMONJS_PLUGIN_DESCRIPTOR_SHIM_SOURCE.js +182 -0
- package/lib/plugin/internal/load/COMMONJS_PLUGIN_DESCRIPTOR_SHIM_SOURCE.js.map +1 -0
- package/lib/plugin/internal/load/PLUGIN_DESCRIPTOR_SHIM_SOURCE.d.ts +11 -0
- package/lib/plugin/internal/load/PLUGIN_DESCRIPTOR_SHIM_SOURCE.js +62 -0
- package/lib/plugin/internal/load/PLUGIN_DESCRIPTOR_SHIM_SOURCE.js.map +1 -0
- package/lib/plugin/internal/load/PluginDescriptorAdmission.d.ts +46 -0
- package/lib/plugin/internal/load/PluginDescriptorAdmission.js +72 -0
- package/lib/plugin/internal/load/PluginDescriptorAdmission.js.map +1 -0
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.d.ts +154 -0
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.js +317 -0
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.js.map +1 -0
- package/lib/plugin/internal/load/PluginPackageResolution.d.ts +208 -0
- package/lib/plugin/internal/load/PluginPackageResolution.js +593 -0
- package/lib/plugin/internal/load/PluginPackageResolution.js.map +1 -0
- package/lib/plugin/internal/load/ProjectPluginEntries.d.ts +60 -0
- package/lib/plugin/internal/load/ProjectPluginEntries.js +164 -0
- package/lib/plugin/internal/load/ProjectPluginEntries.js.map +1 -0
- package/lib/plugin/internal/load/RESOLUTION_INPUT_RECORDER_PATH.d.ts +13 -0
- package/lib/plugin/internal/load/RESOLUTION_INPUT_RECORDER_PATH.js +21 -0
- package/lib/plugin/internal/load/RESOLUTION_INPUT_RECORDER_PATH.js.map +1 -0
- package/lib/plugin/internal/load/collectProjectHostInputs.d.ts +16 -0
- package/lib/plugin/internal/load/collectProjectHostInputs.js +66 -0
- package/lib/plugin/internal/load/collectProjectHostInputs.js.map +1 -0
- package/lib/plugin/internal/load/composePluginSources.d.ts +20 -0
- package/lib/plugin/internal/load/composePluginSources.js +95 -0
- package/lib/plugin/internal/load/composePluginSources.js.map +1 -0
- package/lib/plugin/internal/load/declaresHostInputReads.d.ts +24 -0
- package/lib/plugin/internal/load/declaresHostInputReads.js +48 -0
- package/lib/plugin/internal/load/declaresHostInputReads.js.map +1 -0
- package/lib/plugin/internal/load/hasProjectPluginEntries.d.ts +21 -0
- package/lib/plugin/internal/load/hasProjectPluginEntries.js +29 -0
- package/lib/plugin/internal/load/hasProjectPluginEntries.js.map +1 -0
- package/lib/plugin/internal/load/hashHostInputPaths.d.ts +17 -0
- package/lib/plugin/internal/load/hashHostInputPaths.js +46 -0
- package/lib/plugin/internal/load/hashHostInputPaths.js.map +1 -0
- package/lib/plugin/internal/load/isRelativePluginSpecifier.d.ts +22 -0
- package/lib/plugin/internal/load/isRelativePluginSpecifier.js +33 -0
- package/lib/plugin/internal/load/isRelativePluginSpecifier.js.map +1 -0
- package/lib/plugin/internal/load/loadProjectPlugins.d.ts +113 -0
- package/lib/plugin/internal/load/loadProjectPlugins.js +1615 -0
- package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -0
- package/lib/plugin/internal/load/moduleResolutionBaseSelects.d.ts +42 -0
- package/lib/plugin/internal/load/moduleResolutionBaseSelects.js +51 -0
- package/lib/plugin/internal/load/moduleResolutionBaseSelects.js.map +1 -0
- package/lib/plugin/internal/load/observeImportSearchRoots.d.ts +29 -0
- package/lib/plugin/internal/load/observeImportSearchRoots.js +38 -0
- package/lib/plugin/internal/load/observeImportSearchRoots.js.map +1 -0
- package/lib/plugin/internal/load/pluginLabel.d.ts +15 -0
- package/lib/plugin/internal/load/pluginLabel.js +25 -0
- package/lib/plugin/internal/load/pluginLabel.js.map +1 -0
- package/lib/plugin/internal/load/realpathHostInput.d.ts +14 -0
- package/lib/plugin/internal/load/realpathHostInput.js +29 -0
- package/lib/plugin/internal/load/realpathHostInput.js.map +1 -0
- package/lib/plugin/internal/load/realpathHostInputPaths.d.ts +17 -0
- package/lib/plugin/internal/load/realpathHostInputPaths.js +28 -0
- package/lib/plugin/internal/load/realpathHostInputPaths.js.map +1 -0
- package/lib/plugin/internal/load/rejectJsTransformFunctions.d.ts +13 -0
- package/lib/plugin/internal/load/rejectJsTransformFunctions.js +22 -0
- package/lib/plugin/internal/load/rejectJsTransformFunctions.js.map +1 -0
- package/lib/plugin/internal/load/requirePluginSource.d.ts +14 -0
- package/lib/plugin/internal/load/requirePluginSource.js +38 -0
- package/lib/plugin/internal/load/requirePluginSource.js.map +1 -0
- package/lib/plugin/internal/load/resolveNativeSource.d.ts +29 -0
- package/lib/plugin/internal/load/resolveNativeSource.js +37 -0
- package/lib/plugin/internal/load/resolveNativeSource.js.map +1 -0
- package/lib/plugin/internal/load/validatePluginContributors.d.ts +22 -0
- package/lib/plugin/internal/load/validatePluginContributors.js +86 -0
- package/lib/plugin/internal/load/validatePluginContributors.js.map +1 -0
- package/lib/plugin/internal/load/validatePluginSource.d.ts +14 -0
- package/lib/plugin/internal/load/validatePluginSource.js +21 -0
- package/lib/plugin/internal/load/validatePluginSource.js.map +1 -0
- package/lib/plugin/internal/load/visitImportMappedCandidates.d.ts +36 -0
- package/lib/plugin/internal/load/visitImportMappedCandidates.js +45 -0
- package/lib/plugin/internal/load/visitImportMappedCandidates.js.map +1 -0
- package/lib/plugin/internal/pluginDescriptorFailureReason.d.ts +23 -0
- package/lib/plugin/internal/pluginDescriptorFailureReason.js +43 -0
- package/lib/plugin/internal/pluginDescriptorFailureReason.js.map +1 -0
- package/lib/plugin/internal/pluginDescriptorProcessFailure.d.ts +28 -0
- package/lib/plugin/internal/pluginDescriptorProcessFailure.js +37 -0
- package/lib/plugin/internal/pluginDescriptorProcessFailure.js.map +1 -0
- package/lib/plugin/internal/readCapabilityResolution.d.ts +42 -0
- package/lib/plugin/internal/readCapabilityResolution.js +158 -0
- package/lib/plugin/internal/readCapabilityResolution.js.map +1 -0
- package/lib/plugin/internal/receiveCapabilityFailure.d.ts +21 -0
- package/lib/plugin/internal/receiveCapabilityFailure.js +28 -0
- package/lib/plugin/internal/receiveCapabilityFailure.js.map +1 -0
- package/lib/plugin/internal/source/CachePrunePolicy.d.ts +42 -0
- package/lib/plugin/internal/source/CachePrunePolicy.js +47 -0
- package/lib/plugin/internal/source/CachePrunePolicy.js.map +1 -0
- package/lib/plugin/internal/source/GoBuildCacheCoordination.d.ts +159 -0
- package/lib/plugin/internal/source/GoBuildCacheCoordination.js +475 -0
- package/lib/plugin/internal/source/GoBuildCacheCoordination.js.map +1 -0
- package/lib/plugin/internal/source/GoSourceInputs.d.ts +124 -0
- package/lib/plugin/internal/source/GoSourceInputs.js +180 -0
- package/lib/plugin/internal/source/GoSourceInputs.js.map +1 -0
- package/lib/plugin/internal/source/GoToolResolution.d.ts +125 -0
- package/lib/plugin/internal/source/GoToolResolution.js +278 -0
- package/lib/plugin/internal/source/GoToolResolution.js.map +1 -0
- package/lib/plugin/internal/source/IGoBuildCachePruneOptions.d.ts +30 -0
- package/lib/plugin/internal/source/IGoBuildCachePruneOptions.js +3 -0
- package/lib/plugin/internal/source/IGoBuildCachePruneOptions.js.map +1 -0
- package/lib/plugin/internal/source/IPluginCachePruneOptions.d.ts +33 -0
- package/lib/plugin/internal/source/IPluginCachePruneOptions.js +3 -0
- package/lib/plugin/internal/source/IPluginCachePruneOptions.js.map +1 -0
- package/lib/plugin/internal/source/IPluginModuleReplaceDirectory.d.ts +27 -0
- package/lib/plugin/internal/source/IPluginModuleReplaceDirectory.js +3 -0
- package/lib/plugin/internal/source/IPluginModuleReplaceDirectory.js.map +1 -0
- package/lib/plugin/internal/source/ITtscBuildContributor.d.ts +18 -0
- package/lib/plugin/internal/source/ITtscBuildContributor.js +3 -0
- package/lib/plugin/internal/source/ITtscBuildContributor.js.map +1 -0
- package/lib/plugin/internal/source/ITtscSourceBuildCachePaths.d.ts +25 -0
- package/lib/plugin/internal/source/ITtscSourceBuildCachePaths.js +3 -0
- package/lib/plugin/internal/source/ITtscSourceBuildCachePaths.js.map +1 -0
- package/lib/plugin/internal/source/NativeSourcePackages.d.ts +155 -0
- package/lib/plugin/internal/source/NativeSourcePackages.js +317 -0
- package/lib/plugin/internal/source/NativeSourcePackages.js.map +1 -0
- package/lib/plugin/internal/source/PluginBinaryUse.d.ts +66 -0
- package/lib/plugin/internal/source/PluginBinaryUse.js +163 -0
- package/lib/plugin/internal/source/PluginBinaryUse.js.map +1 -0
- package/lib/plugin/internal/source/PluginBinaryWaitResult.d.ts +34 -0
- package/lib/plugin/internal/source/PluginBinaryWaitResult.js +3 -0
- package/lib/plugin/internal/source/PluginBinaryWaitResult.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.d.ts +90 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js +207 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentWitness.d.ts +128 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentWitness.js +209 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentWitness.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildLockFence.d.ts +25 -0
- package/lib/plugin/internal/source/PluginBuildLockFence.js +3 -0
- package/lib/plugin/internal/source/PluginBuildLockFence.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildLockLease.d.ts +29 -0
- package/lib/plugin/internal/source/PluginBuildLockLease.js +3 -0
- package/lib/plugin/internal/source/PluginBuildLockLease.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildLockObservation.d.ts +42 -0
- package/lib/plugin/internal/source/PluginBuildLockObservation.js +3 -0
- package/lib/plugin/internal/source/PluginBuildLockObservation.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildLockOwner.d.ts +126 -0
- package/lib/plugin/internal/source/PluginBuildLockOwner.js +165 -0
- package/lib/plugin/internal/source/PluginBuildLockOwner.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildLockProtocol.d.ts +234 -0
- package/lib/plugin/internal/source/PluginBuildLockProtocol.js +287 -0
- package/lib/plugin/internal/source/PluginBuildLockProtocol.js.map +1 -0
- package/lib/plugin/internal/source/SourceBuildCacheLayout.d.ts +183 -0
- package/lib/plugin/internal/source/SourceBuildCacheLayout.js +291 -0
- package/lib/plugin/internal/source/SourceBuildCacheLayout.js.map +1 -0
- package/lib/plugin/internal/source/SourceBuildFilesystemOperations.d.ts +32 -0
- package/lib/plugin/internal/source/SourceBuildFilesystemOperations.js +3 -0
- package/lib/plugin/internal/source/SourceBuildFilesystemOperations.js.map +1 -0
- package/lib/plugin/internal/source/SourcePluginAdmission.d.ts +80 -0
- package/lib/plugin/internal/source/SourcePluginAdmission.js +114 -0
- package/lib/plugin/internal/source/SourcePluginAdmission.js.map +1 -0
- package/lib/plugin/internal/source/SourcePluginWorkspace.d.ts +122 -0
- package/lib/plugin/internal/source/SourcePluginWorkspace.js +307 -0
- package/lib/plugin/internal/source/SourcePluginWorkspace.js.map +1 -0
- package/lib/plugin/internal/source/acquirePluginBuildLock.d.ts +35 -0
- package/lib/plugin/internal/source/acquirePluginBuildLock.js +176 -0
- package/lib/plugin/internal/source/acquirePluginBuildLock.js.map +1 -0
- package/lib/plugin/internal/source/autoQuoteGoModToken.d.ts +24 -0
- package/lib/plugin/internal/source/autoQuoteGoModToken.js +110 -0
- package/lib/plugin/internal/source/autoQuoteGoModToken.js.map +1 -0
- package/lib/plugin/internal/source/buildSourcePlugin.d.ts +86 -0
- package/lib/plugin/internal/source/buildSourcePlugin.js +857 -0
- package/lib/plugin/internal/source/buildSourcePlugin.js.map +1 -0
- package/lib/plugin/internal/source/collectPluginSourceDirectories.d.ts +30 -0
- package/lib/plugin/internal/source/collectPluginSourceDirectories.js +77 -0
- package/lib/plugin/internal/source/collectPluginSourceDirectories.js.map +1 -0
- package/lib/plugin/internal/source/collectPluginSourceFiles.d.ts +40 -0
- package/lib/plugin/internal/source/collectPluginSourceFiles.js +95 -0
- package/lib/plugin/internal/source/collectPluginSourceFiles.js.map +1 -0
- package/lib/plugin/internal/source/computeCacheKey.d.ts +73 -0
- package/lib/plugin/internal/source/computeCacheKey.js +113 -0
- package/lib/plugin/internal/source/computeCacheKey.js.map +1 -0
- package/lib/plugin/internal/source/copiesPluginSourceEntry.d.ts +33 -0
- package/lib/plugin/internal/source/copiesPluginSourceEntry.js +57 -0
- package/lib/plugin/internal/source/copiesPluginSourceEntry.js.map +1 -0
- package/lib/plugin/internal/source/createExternalSourceSnapshotLayout.d.ts +22 -0
- package/lib/plugin/internal/source/createExternalSourceSnapshotLayout.js +60 -0
- package/lib/plugin/internal/source/createExternalSourceSnapshotLayout.js.map +1 -0
- package/lib/plugin/internal/source/ensureExecutableGoToolchain.d.ts +25 -0
- package/lib/plugin/internal/source/ensureExecutableGoToolchain.js +96 -0
- package/lib/plugin/internal/source/ensureExecutableGoToolchain.js.map +1 -0
- package/lib/plugin/internal/source/formatDuration.d.ts +18 -0
- package/lib/plugin/internal/source/formatDuration.js +36 -0
- package/lib/plugin/internal/source/formatDuration.js.map +1 -0
- package/lib/plugin/internal/source/formatGoWorkPath.d.ts +35 -0
- package/lib/plugin/internal/source/formatGoWorkPath.js +42 -0
- package/lib/plugin/internal/source/formatGoWorkPath.js.map +1 -0
- package/lib/plugin/internal/source/hashPluginBuildEnvironment.d.ts +47 -0
- package/lib/plugin/internal/source/hashPluginBuildEnvironment.js +663 -0
- package/lib/plugin/internal/source/hashPluginBuildEnvironment.js.map +1 -0
- package/lib/plugin/internal/source/inspectPluginBuildLock.d.ts +29 -0
- package/lib/plugin/internal/source/inspectPluginBuildLock.js +285 -0
- package/lib/plugin/internal/source/inspectPluginBuildLock.js.map +1 -0
- package/lib/plugin/internal/source/isPathWithin.d.ts +16 -0
- package/lib/plugin/internal/source/isPathWithin.js +28 -0
- package/lib/plugin/internal/source/isPathWithin.js.map +1 -0
- package/lib/plugin/internal/source/legacyGlobalCacheTargets.d.ts +24 -0
- package/lib/plugin/internal/source/legacyGlobalCacheTargets.js +60 -0
- package/lib/plugin/internal/source/legacyGlobalCacheTargets.js.map +1 -0
- package/lib/plugin/internal/source/pluginBuildEnvironment.d.ts +31 -0
- package/lib/plugin/internal/source/pluginBuildEnvironment.js +47 -0
- package/lib/plugin/internal/source/pluginBuildEnvironment.js.map +1 -0
- package/lib/plugin/internal/source/pluginBuildEnvironmentWorker.d.ts +1 -0
- package/lib/plugin/internal/source/pluginBuildEnvironmentWorker.js +24 -0
- package/lib/plugin/internal/source/pluginBuildEnvironmentWorker.js.map +1 -0
- package/lib/plugin/internal/source/pluginBuildVersions.d.ts +31 -0
- package/lib/plugin/internal/source/pluginBuildVersions.js +65 -0
- package/lib/plugin/internal/source/pluginBuildVersions.js.map +1 -0
- package/lib/plugin/internal/source/pluginModuleReplaceDirectories.d.ts +40 -0
- package/lib/plugin/internal/source/pluginModuleReplaceDirectories.js +81 -0
- package/lib/plugin/internal/source/pluginModuleReplaceDirectories.js.map +1 -0
- package/lib/plugin/internal/source/pluginSourceCovers.d.ts +32 -0
- package/lib/plugin/internal/source/pluginSourceCovers.js +54 -0
- package/lib/plugin/internal/source/pluginSourceCovers.js.map +1 -0
- package/lib/plugin/internal/source/pluginSourceDigest.d.ts +40 -0
- package/lib/plugin/internal/source/pluginSourceDigest.js +60 -0
- package/lib/plugin/internal/source/pluginSourceDigest.js.map +1 -0
- package/lib/plugin/internal/source/pluginSourceFilesSignature.d.ts +38 -0
- package/lib/plugin/internal/source/pluginSourceFilesSignature.js +53 -0
- package/lib/plugin/internal/source/pluginSourceFilesSignature.js.map +1 -0
- package/lib/plugin/internal/source/pluginSourceState.d.ts +47 -0
- package/lib/plugin/internal/source/pluginSourceState.js +63 -0
- package/lib/plugin/internal/source/pluginSourceState.js.map +1 -0
- package/lib/plugin/internal/source/pluginSourceStateHolds.d.ts +34 -0
- package/lib/plugin/internal/source/pluginSourceStateHolds.js +45 -0
- package/lib/plugin/internal/source/pluginSourceStateHolds.js.map +1 -0
- package/lib/plugin/internal/source/processPluginBuildEnvironment.d.ts +33 -0
- package/lib/plugin/internal/source/processPluginBuildEnvironment.js +40 -0
- package/lib/plugin/internal/source/processPluginBuildEnvironment.js.map +1 -0
- package/lib/plugin/internal/source/pruneCacheFileRoot.d.ts +34 -0
- package/lib/plugin/internal/source/pruneCacheFileRoot.js +120 -0
- package/lib/plugin/internal/source/pruneCacheFileRoot.js.map +1 -0
- package/lib/plugin/internal/source/pruneGoBuildCacheRoot.d.ts +28 -0
- package/lib/plugin/internal/source/pruneGoBuildCacheRoot.js +185 -0
- package/lib/plugin/internal/source/pruneGoBuildCacheRoot.js.map +1 -0
- package/lib/plugin/internal/source/prunePluginCacheRoot.d.ts +46 -0
- package/lib/plugin/internal/source/prunePluginCacheRoot.js +446 -0
- package/lib/plugin/internal/source/prunePluginCacheRoot.js.map +1 -0
- package/lib/plugin/internal/source/prunesPluginSourceDirectory.d.ts +21 -0
- package/lib/plugin/internal/source/prunesPluginSourceDirectory.js +28 -0
- package/lib/plugin/internal/source/prunesPluginSourceDirectory.js.map +1 -0
- package/lib/plugin/internal/source/reclaimPluginBuildLock.d.ts +23 -0
- package/lib/plugin/internal/source/reclaimPluginBuildLock.js +48 -0
- package/lib/plugin/internal/source/reclaimPluginBuildLock.js.map +1 -0
- package/lib/plugin/internal/source/recordCacheFileUse.d.ts +22 -0
- package/lib/plugin/internal/source/recordCacheFileUse.js +43 -0
- package/lib/plugin/internal/source/recordCacheFileUse.js.map +1 -0
- package/lib/plugin/internal/source/releasePluginBuildLock.d.ts +33 -0
- package/lib/plugin/internal/source/releasePluginBuildLock.js +100 -0
- package/lib/plugin/internal/source/releasePluginBuildLock.js.map +1 -0
- package/lib/plugin/internal/source/resolveCleanTargets.d.ts +26 -0
- package/lib/plugin/internal/source/resolveCleanTargets.js +73 -0
- package/lib/plugin/internal/source/resolveCleanTargets.js.map +1 -0
- package/lib/plugin/internal/source/resolveGoCompiler.d.ts +29 -0
- package/lib/plugin/internal/source/resolveGoCompiler.js +62 -0
- package/lib/plugin/internal/source/resolveGoCompiler.js.map +1 -0
- package/lib/plugin/internal/source/resolvePluginCacheRoot.d.ts +21 -0
- package/lib/plugin/internal/source/resolvePluginCacheRoot.js +31 -0
- package/lib/plugin/internal/source/resolvePluginCacheRoot.js.map +1 -0
- package/lib/plugin/internal/source/resolvePluginGoModule.d.ts +34 -0
- package/lib/plugin/internal/source/resolvePluginGoModule.js +65 -0
- package/lib/plugin/internal/source/resolvePluginGoModule.js.map +1 -0
- package/lib/plugin/internal/source/resolveSourceBuildCachePaths.d.ts +21 -0
- package/lib/plugin/internal/source/resolveSourceBuildCachePaths.js +236 -0
- package/lib/plugin/internal/source/resolveSourceBuildCachePaths.js.map +1 -0
- package/lib/plugin/internal/source/selectPluginModuleReplaceDirectories.d.ts +29 -0
- package/lib/plugin/internal/source/selectPluginModuleReplaceDirectories.js +68 -0
- package/lib/plugin/internal/source/selectPluginModuleReplaceDirectories.js.map +1 -0
- package/lib/plugin/internal/source/spawnGoTool.d.ts +22 -0
- package/lib/plugin/internal/source/spawnGoTool.js +164 -0
- package/lib/plugin/internal/source/spawnGoTool.js.map +1 -0
- package/lib/plugin/internal/source/touchPluginCacheEntryInUse.d.ts +27 -0
- package/lib/plugin/internal/source/touchPluginCacheEntryInUse.js +48 -0
- package/lib/plugin/internal/source/touchPluginCacheEntryInUse.js.map +1 -0
- package/lib/plugin/internal/source/waitForPluginBinary.d.ts +36 -0
- package/lib/plugin/internal/source/waitForPluginBinary.js +94 -0
- package/lib/plugin/internal/source/waitForPluginBinary.js.map +1 -0
- package/lib/plugin/internal/source/windowsGoCommandArgs.d.ts +17 -0
- package/lib/plugin/internal/source/windowsGoCommandArgs.js +23 -0
- package/lib/plugin/internal/source/windowsGoCommandArgs.js.map +1 -0
- package/lib/plugin/internal/source/withGoBuildCacheLease.d.ts +37 -0
- package/lib/plugin/internal/source/withGoBuildCacheLease.js +87 -0
- package/lib/plugin/internal/source/withGoBuildCacheLease.js.map +1 -0
- package/lib/plugin/internal/writeCapabilityResolution.d.ts +80 -0
- package/lib/plugin/internal/writeCapabilityResolution.js +196 -0
- package/lib/plugin/internal/writeCapabilityResolution.js.map +1 -0
- package/lib/plugin/resolveCapabilityPlugins.d.ts +53 -32
- package/lib/plugin/resolveCapabilityPlugins.js +209 -38
- package/lib/plugin/resolveCapabilityPlugins.js.map +1 -1
- package/lib/register.js +20 -5
- package/lib/register.js.map +1 -1
- package/lib/structures/ITtscCompilerContext.d.ts +29 -11
- package/lib/structures/ITtscCompilerDiagnostic.d.ts +24 -7
- package/lib/structures/ITtscCompilerResult.d.ts +75 -25
- package/lib/structures/ITtscCompilerTransformation.d.ts +287 -64
- package/lib/structures/ITtscPlugin.d.ts +24 -8
- package/lib/structures/ITtscPluginCapabilities.d.ts +55 -5
- package/lib/structures/ITtscPluginContributor.d.ts +19 -8
- package/lib/structures/ITtscPluginFactoryContext.d.ts +12 -3
- package/lib/structures/ITtscProjectPluginConfig.d.ts +35 -10
- package/lib/structures/TtscPluginStage.d.ts +9 -0
- package/lib/structures/internal/ITtscLoadedNativePlugin.d.ts +19 -5
- package/lib/structures/internal/ITtscParsedProjectConfig.d.ts +29 -3
- package/lib/structures/internal/ITtscProjectIdentity.d.ts +21 -6
- package/lib/structures/internal/ITtscProjectInputSnapshot.d.ts +23 -8
- package/lib/structures/internal/ITtscProjectLocatorOptions.d.ts +18 -4
- package/lib/structures/internal/TtscBuildOptions.d.ts +33 -14
- package/lib/structures/internal/TtscBuildResult.d.ts +63 -4
- package/lib/structures/internal/TtscCommonOptions.d.ts +47 -14
- package/lib/structures/internal/TtscSingleFileEmitOptions.d.ts +46 -5
- package/package.json +26 -12
- package/shim/ast/enums_gen.go +4 -2
- package/shim/ast/go.mod +5 -5
- package/shim/ast/go.sum +10 -10
- package/shim/ast/lint.go +1088 -20
- package/shim/ast/parent.go +38 -22
- package/shim/ast/safe_text.go +48 -26
- package/shim/ast/shim.go +1307 -20
- package/shim/ast/test/next_jsdoc_comment_location_reaches_variable_statement_test.go +51 -0
- package/shim/ast/test/node_text_joins_multi_hop_qualified_name_test.go +24 -9
- package/shim/ast/test/node_text_joins_one_hop_qualified_name_test.go +9 -5
- package/shim/ast/test/node_text_returns_empty_for_nil_test.go +13 -5
- package/shim/ast/test/node_text_returns_identifier_text_test.go +12 -5
- package/shim/ast/test/node_text_skips_empty_qualified_left_test.go +35 -5
- package/shim/astnav/go.mod +5 -5
- package/shim/astnav/go.sum +12 -10
- package/shim/astnav/shim.go +9 -0
- package/shim/bundled/go.mod +7 -1
- package/shim/bundled/go.sum +12 -0
- package/shim/checker/enums_gen.go +4 -2
- package/shim/checker/extra-shim.json +6 -0
- package/shim/checker/go.mod +5 -5
- package/shim/checker/go.sum +10 -10
- package/shim/checker/node_builder_fields_gen.go +19 -0
- package/shim/checker/shim.go +827 -114
- package/shim/compiler/emit_sourcemap.go +68 -29
- package/shim/compiler/emitassemble.go +36 -2
- package/shim/compiler/emithook.go +13 -3
- package/shim/compiler/go.mod +5 -5
- package/shim/compiler/go.sum +10 -10
- package/shim/compiler/incremental.go +56 -20
- package/shim/compiler/resolution.go +92 -9
- package/shim/core/enums_gen.go +2 -2
- package/shim/core/go.mod +6 -1
- package/shim/core/go.sum +10 -0
- package/shim/core/modulekind.go +9 -0
- package/shim/core/shim.go +157 -6
- package/shim/diagnosticwriter/go.mod +10 -1
- package/shim/diagnosticwriter/go.sum +20 -0
- package/shim/diagnosticwriter/lint.go +188 -10
- package/shim/diagnosticwriter/shim.go +14 -0
- package/shim/lsp/go.mod +5 -5
- package/shim/lsp/go.sum +10 -10
- package/shim/lsp/shim.go +78 -2
- package/shim/parser/go.mod +10 -1
- package/shim/parser/go.sum +22 -0
- package/shim/printer/emithost.go +46 -1
- package/shim/printer/go.mod +5 -5
- package/shim/printer/go.sum +10 -10
- package/shim/printer/shim.go +114 -7
- package/shim/printer/sourcemap.go +55 -0
- package/shim/scanner/go.mod +10 -1
- package/shim/scanner/go.sum +20 -0
- package/shim/scanner/regexp.go +19 -4
- package/shim/scanner/shim.go +3 -0
- package/shim/stringutil/extra-shim.json +1 -0
- package/shim/stringutil/go.mod +5 -0
- package/shim/stringutil/go.sum +2 -0
- package/shim/stringutil/shim.go +119 -0
- package/shim/transformers/go.mod +5 -5
- package/shim/transformers/go.sum +12 -10
- package/shim/transformers/shim.go +12 -3
- package/shim/tsoptions/command_line_raw.go +44 -0
- package/shim/tsoptions/go.mod +10 -1
- package/shim/tsoptions/go.sum +22 -0
- package/shim/tsoptions/shim.go +1 -1
- package/shim/tspath/go.mod +1 -1
- package/shim/tspath/go.sum +6 -0
- package/shim/vfs/cachedvfs/go.mod +3 -1
- package/shim/vfs/cachedvfs/go.sum +12 -0
- package/shim/vfs/decode.go +26 -0
- package/shim/vfs/decode_test.go +42 -0
- package/shim/vfs/go.mod +7 -1
- package/shim/vfs/go.sum +12 -0
- package/shim/vfs/osvfs/go.mod +7 -1
- package/shim/vfs/osvfs/go.sum +12 -0
- package/src/TtscCompiler.ts +223 -234
- package/src/TtscService.ts +87 -31
- package/src/TtscServiceRequestOptions.ts +21 -0
- package/src/compiler/internal/CapturedProcessOutput.ts +69 -0
- package/src/compiler/internal/CompilerArgumentsInspection.ts +184 -0
- package/src/compiler/internal/EmitOwnershipIndex.ts +254 -0
- package/src/compiler/internal/PrivateCompilerOutput.ts +330 -0
- package/src/compiler/internal/ResidentCheckProcess.ts +445 -0
- package/src/compiler/internal/ResidentCheckProcessOptions.ts +32 -0
- package/src/compiler/internal/ResidentCheckRequest.ts +39 -0
- package/src/compiler/internal/ResidentCheckResult.ts +24 -0
- package/src/compiler/internal/ResidentCheckTelemetry.ts +36 -0
- package/src/compiler/internal/ResidentReplyKind.ts +18 -0
- package/src/compiler/internal/ResidentTransformProcess.ts +299 -0
- package/src/compiler/internal/ResidentTransformProcessOptions.ts +30 -0
- package/src/compiler/internal/ResidentTransformReply.ts +79 -0
- package/src/compiler/internal/ResidentTransformRequestOptions.ts +16 -0
- package/src/compiler/internal/ResidentTransformRequests.ts +198 -0
- package/src/compiler/internal/StartedResidentTransform.ts +29 -0
- package/src/compiler/internal/TransformProjectWorkerReply.ts +37 -0
- package/src/compiler/internal/TransformProjectWorkerRequest.ts +42 -0
- package/src/compiler/internal/build/BuildExecution.ts +1261 -0
- package/src/compiler/internal/build/BuildTiming.ts +145 -0
- package/src/compiler/internal/build/CompilerDiagnostics.ts +307 -0
- package/src/compiler/internal/build/NativePluginArguments.ts +302 -0
- package/src/compiler/internal/build/PassthroughFlags.ts +229 -0
- package/src/compiler/internal/build/PluginFailureDiagnostics.ts +70 -0
- package/src/compiler/internal/build/ResidentCheckEntryPlan.ts +42 -0
- package/src/compiler/internal/build/ResidentCheckWatchChange.ts +33 -0
- package/src/compiler/internal/build/ResidentCheckWatchSession.ts +501 -0
- package/src/compiler/internal/build/RunBuildOptions.ts +145 -0
- package/src/compiler/internal/build/TsgoArguments.ts +349 -0
- package/src/compiler/internal/build/appendBuildOutput.ts +218 -0
- package/src/compiler/internal/build/bufferResidentCheckEntryRequests.ts +52 -0
- package/src/compiler/internal/build/createProcessDiagnostic.ts +32 -0
- package/src/compiler/internal/build/isAbsoluteLocalProjectInputPath.ts +55 -0
- package/src/compiler/internal/build/mergeProjectInputSnapshots.ts +147 -0
- package/src/compiler/internal/build/normalizeBuildOutput.ts +89 -0
- package/src/compiler/internal/build/parseProjectInputSnapshot.ts +91 -0
- package/src/compiler/internal/build/planResidentCheckEntries.ts +55 -0
- package/src/compiler/internal/build/privateRuntimeRootDir.ts +33 -0
- package/src/compiler/internal/build/residentCheckRequest.ts +41 -0
- package/src/compiler/internal/build/runBuild.ts +61 -0
- package/src/compiler/internal/build/runExternalEmitProvenance.ts +566 -0
- package/src/compiler/internal/build/takeResidentCheckEntryRequest.ts +31 -0
- package/src/compiler/internal/buildNativeCompiler.ts +19 -2
- package/src/compiler/internal/captureProcessOutput.ts +39 -37
- package/src/compiler/internal/compileProjectInMemory.ts +139 -92
- package/src/compiler/internal/ensureExecutable.ts +32 -0
- package/src/compiler/internal/findNearestGoMod.ts +43 -0
- package/src/compiler/internal/isOutsideRelativePath.ts +26 -0
- package/src/compiler/internal/outputText.ts +21 -0
- package/src/compiler/internal/packageRootDir.ts +43 -0
- package/src/compiler/internal/parseNativeTransformOutput.ts +722 -0
- package/src/compiler/internal/project/CompilerProjectSelection.ts +204 -0
- package/src/compiler/internal/project/ConfigJsonText.ts +55 -0
- package/src/compiler/internal/project/compilerUsesCaseSensitiveFileNames.ts +124 -0
- package/src/compiler/internal/project/createNativeProjectContextArgs.ts +14 -19
- package/src/compiler/internal/project/createNativeProjectContextJson.ts +28 -0
- package/src/compiler/internal/project/parseJsonc.ts +318 -0
- package/src/compiler/internal/project/readJsonFile.ts +34 -0
- package/src/compiler/internal/project/readJsoncFile.ts +46 -0
- package/src/compiler/internal/project/readProjectConfig.ts +137 -200
- package/src/compiler/internal/project/resolveOwningProjectConfig.ts +278 -0
- package/src/compiler/internal/project/resolveProjectConfig.ts +18 -127
- package/src/compiler/internal/project/resolveProjectIdentity.ts +153 -0
- package/src/compiler/internal/project/resolveTsconfigExtends.ts +175 -0
- package/src/compiler/internal/project/selectReferencedProject.ts +54 -0
- package/src/compiler/internal/project/tsconfigExtendsFileCandidates.ts +54 -0
- package/src/compiler/internal/readEffectiveCompilerOptions.ts +126 -0
- package/src/compiler/internal/resolveBinary.ts +25 -9
- package/src/compiler/internal/resolveTsgo.ts +31 -11
- package/src/compiler/internal/runNativeCheckWithObservations.ts +211 -0
- package/src/compiler/internal/runSingleFileEmit.ts +92 -27
- package/src/compiler/internal/sharedHost/SEMANTIC_CONFIG_PATH_ENV.ts +2 -0
- package/src/compiler/internal/sharedHost/SidecarEnvironment.ts +151 -0
- package/src/compiler/internal/sharedHost/TSGO_ARGS_CWD_ENV.ts +7 -0
- package/src/compiler/internal/sharedHost/TSGO_ARGS_ENV.ts +7 -0
- package/src/compiler/internal/sharedHost/assertSharedHostCompatibility.ts +48 -0
- package/src/compiler/internal/sharedHost/clearInheritedSemanticConfigPath.ts +27 -0
- package/src/compiler/internal/sharedHost/clearInheritedTsgoArgs.ts +41 -0
- package/src/compiler/internal/sharedHost/inheritedSidecarEnv.ts +45 -0
- package/src/compiler/internal/sharedHost/isLinkedTransform.ts +19 -0
- package/src/compiler/internal/sharedHost/linkedTransformPlugins.ts +25 -0
- package/src/compiler/internal/sharedHost/publishLinkedTransformPlugins.ts +42 -0
- package/src/compiler/internal/sharedHost/resolvePluginConfigDir.ts +33 -0
- package/src/compiler/internal/sharedHost/selectSharedHostPlugin.ts +35 -0
- package/src/compiler/internal/spawnNative.ts +20 -41
- package/src/compiler/internal/startResidentTransform.ts +66 -53
- package/src/compiler/internal/transformProjectInMemory.ts +356 -634
- package/src/compiler/internal/transformProjectInWorker.ts +170 -0
- package/src/compiler/internal/transformProjectWorker.ts +43 -0
- package/src/flags/AnySubcommand.ts +19 -0
- package/src/flags/COMPILER_ENUM_WHITESPACE.ts +35 -0
- package/src/flags/COMPILER_OPTIONS.ts +512 -0
- package/src/flags/COMPILER_OPTION_ASCII_FOLDS.ts +13 -0
- package/src/flags/COMPILER_OPTION_KINDS.ts +14 -0
- package/src/flags/CompilerOptionSpec.ts +30 -0
- package/src/flags/FLAG_BY_TOKEN.ts +40 -0
- package/src/flags/{schema.ts → FLAG_SCHEMA.ts} +43 -318
- package/src/flags/FlagKind.ts +22 -0
- package/src/flags/FlagLayer.ts +24 -0
- package/src/flags/FlagSpec.ts +118 -0
- package/src/flags/ParseOptions.ts +103 -0
- package/src/flags/ParseResult.ts +44 -0
- package/src/flags/TtscSubcommand.ts +22 -0
- package/src/flags/TtsxSubcommand.ts +13 -0
- package/src/flags/ValueValidator.ts +14 -0
- package/src/flags/buildGoAllowList.ts +43 -0
- package/src/flags/flagsForSubcommand.ts +22 -0
- package/src/flags/getBoolean.ts +27 -0
- package/src/flags/getNumber.ts +24 -0
- package/src/flags/getString.ts +24 -0
- package/src/flags/getStringList.ts +24 -0
- package/src/flags/normalizeCompilerEnumValue.ts +41 -0
- package/src/flags/normalizeFlagToken.ts +38 -0
- package/src/flags/parseFlags.ts +371 -0
- package/src/flags/readCompilerOptionOccurrence.ts +107 -0
- package/src/flags/readCompilerOptionValues.ts +68 -0
- package/src/flags/resolveFlagSpec.ts +29 -0
- package/src/index.ts +9 -3
- package/src/internal/CanonicalTempDirectoryOperations.ts +73 -0
- package/src/internal/CompilerContextSnapshot.ts +139 -0
- package/src/internal/CompilerResultAdapter.ts +320 -0
- package/src/internal/E2ETrace.ts +674 -0
- package/src/internal/IJavaScriptRuntimeCapabilities.ts +50 -0
- package/src/internal/OwnedNativeProcess.ts +417 -0
- package/src/internal/OwnedSynchronousProcess.ts +220 -0
- package/src/internal/RetireLockDirectoryOperations.ts +81 -0
- package/src/internal/SafeCacheCleanupTarget.ts +41 -0
- package/src/internal/SourceNativeRetirement.ts +1109 -0
- package/src/internal/SpawnSyncOutputFiles.ts +29 -0
- package/src/internal/cacheEntryExists.ts +24 -0
- package/src/internal/createCanonicalTempDirectory.ts +35 -18
- package/src/internal/isContendedCandidateRename.ts +35 -0
- package/src/internal/isSpawnSyncFdExhaustion.ts +19 -0
- package/src/internal/javascriptRuntimeCapabilities.ts +166 -0
- package/src/internal/nativeBinary.ts +11 -0
- package/src/internal/parseWindowsDirectoryCaseSensitivity.ts +50 -0
- package/src/internal/pathIdentity/FilesystemPathIdentity.ts +44 -0
- package/src/internal/pathIdentity/FilesystemPathIdentityContext.ts +182 -0
- package/src/internal/pathIdentity/FilesystemPathIdentityOperations.ts +106 -0
- package/src/internal/pathIdentity/ProjectInputPathIdentity.ts +21 -0
- package/src/internal/pathIdentity/ProjectInputPathIdentityContext.ts +21 -0
- package/src/internal/pathIdentity/ProjectInputPathIdentityOperations.ts +22 -0
- package/src/internal/pathIdentity/createFilesystemPathIdentityContext.ts +437 -0
- package/src/internal/pathIdentity/createProjectInputPathIdentityContext.ts +34 -0
- package/src/internal/pathIdentity/isFilesystemPathIdentityWithin.ts +32 -0
- package/src/internal/pathIdentity/isProjectInputPathIdentityWithin.ts +22 -0
- package/src/internal/pathIdentity/resolveFilesystemPath.ts +43 -0
- package/src/internal/pathIdentity/resolvePhysicalPath.ts +31 -0
- package/src/internal/pathIdentity/resolveProjectInputPath.ts +18 -0
- package/src/internal/pluginSource.ts +26 -0
- package/src/internal/projectInputPathIdentity.ts +26 -387
- package/src/internal/resolveNodeBinary.ts +13 -142
- package/src/internal/resolveSafeCacheCleanupTargets.ts +51 -19
- package/src/internal/restoreCompilerError.ts +175 -0
- package/src/internal/retireLockDirectory.ts +166 -0
- package/src/internal/runHoldingLock.ts +55 -0
- package/src/internal/runtimeExecutableIdentity.ts +212 -0
- package/src/internal/serializeCompilerError.ts +145 -0
- package/src/internal/spawnSyncResilient.ts +62 -0
- package/src/internal/spawnSyncWithLowDescriptors.ts +227 -0
- package/src/internal/tsconfig.ts +16 -0
- package/src/launcher/internal/PendingResidentCheckWatchChanges.ts +94 -0
- package/src/launcher/internal/TtscBuildMode.ts +14 -0
- package/src/launcher/internal/TtsxEntryOptions.ts +92 -0
- package/src/launcher/internal/assertNoSolutionBuild.ts +17 -10
- package/src/launcher/internal/assertTtsxNoWatch.ts +49 -0
- package/src/launcher/internal/buildSingleRootProject.ts +303 -0
- package/src/launcher/internal/getCompilerVersionText.ts +20 -5
- package/src/launcher/internal/inlineServedSourceMap.ts +294 -0
- package/src/launcher/internal/linkVirtualEntry.ts +88 -0
- package/src/launcher/internal/{commonJsExportMetadata.ts → parseCommonJsExports.ts} +12 -2
- package/src/launcher/internal/parseTtscBuildArgs.ts +103 -0
- package/src/launcher/internal/parseTtsxCLI.ts +183 -0
- package/src/launcher/internal/prepareExecution.ts +474 -362
- package/src/launcher/internal/prepareTtscBuildMode.ts +64 -0
- package/src/launcher/internal/resolveCacheDir.ts +12 -3
- package/src/launcher/internal/resolveSingleFileOutput.ts +145 -0
- package/src/launcher/internal/resolveTtscserverBinary.ts +20 -5
- package/src/launcher/internal/runTtsc.ts +394 -326
- package/src/launcher/internal/runTtsx.ts +349 -151
- package/src/launcher/internal/runtime/CommonJsRuntimeSource.ts +365 -0
- package/src/launcher/internal/runtime/DependencyBuildAdmission.ts +159 -0
- package/src/launcher/internal/runtime/DependencyBuildGeneration.ts +236 -0
- package/src/launcher/internal/runtime/DependencyBuildLockFence.ts +22 -0
- package/src/launcher/internal/runtime/DependencyBuildLockLease.ts +22 -0
- package/src/launcher/internal/runtime/DependencyBuildLockObservation.ts +49 -0
- package/src/launcher/internal/runtime/DependencyBuildLockProtocol.ts +137 -0
- package/src/launcher/internal/runtime/OwnedProjectSource.ts +140 -0
- package/src/launcher/internal/runtime/OwningModuleOptions.ts +22 -0
- package/src/launcher/internal/runtime/PluginDescriptorInputObservation.ts +112 -0
- package/src/launcher/internal/runtime/ProcessOwnedDirectory.ts +325 -0
- package/src/launcher/internal/runtime/ResolveResult.ts +26 -0
- package/src/launcher/internal/runtime/RuntimeEmitProvenance.ts +58 -0
- package/src/launcher/internal/runtime/RuntimeEntryPreparer.ts +23 -0
- package/src/launcher/internal/runtime/RuntimeFilesystem.ts +64 -0
- package/src/launcher/internal/runtime/RuntimeHookOptions.ts +23 -0
- package/src/launcher/internal/runtime/RuntimeIsolatedEmit.ts +88 -0
- package/src/launcher/internal/runtime/RuntimeLoaderCapabilities.ts +256 -0
- package/src/launcher/internal/runtime/RuntimeManifest.ts +77 -0
- package/src/launcher/internal/runtime/RuntimeManifestRegistry.ts +309 -0
- package/src/launcher/internal/runtime/RuntimeModuleFormat.ts +275 -0
- package/src/launcher/internal/runtime/RuntimeProjectOwnership.ts +139 -0
- package/src/launcher/internal/runtime/TTSX_MINIMUM_NODE_VERSION.ts +11 -0
- package/src/launcher/internal/runtime/acquireDependencyBuildLock.ts +97 -0
- package/src/launcher/internal/runtime/checkNodeRuntimeSupport.ts +94 -0
- package/src/launcher/internal/runtime/claimRuntimeProjectDirectory.ts +54 -0
- package/src/launcher/internal/runtime/commonJsExportNames.ts +57 -0
- package/src/launcher/internal/runtime/commonJsImportFacade.ts +62 -0
- package/src/launcher/internal/runtime/dependencyCacheKey.ts +82 -0
- package/src/launcher/internal/runtime/dependencyCacheRoot.ts +112 -0
- package/src/launcher/internal/runtime/inspectDependencyBuildLock.ts +162 -0
- package/src/launcher/internal/runtime/installRuntimeHooks.ts +2442 -0
- package/src/launcher/internal/runtime/interopProbe.ts +8 -0
- package/src/launcher/internal/runtime/isLocalProcessGone.ts +67 -0
- package/src/launcher/internal/runtime/observeMappedDescriptorResolution.ts +74 -0
- package/src/launcher/internal/runtime/projectModuleOptions.ts +28 -0
- package/src/launcher/internal/runtime/readDependencyCache.ts +89 -0
- package/src/launcher/internal/runtime/realPath.ts +30 -0
- package/src/launcher/internal/runtime/reclaimDependencyBuildLock.ts +27 -0
- package/src/launcher/internal/runtime/releaseDependencyBuildLock.ts +27 -0
- package/src/launcher/internal/runtime/resolveRuntimeCleanTargets.ts +93 -0
- package/src/launcher/internal/runtime/restoreStrippedNodeBuiltinScheme.ts +32 -0
- package/src/launcher/internal/runtime/runtimeRunKey.ts +31 -0
- package/src/launcher/internal/runtime/selectRuntimePluginPolicy.ts +28 -0
- package/src/launcher/internal/runtime/withRuntimeDirectoryLock.ts +92 -0
- package/src/launcher/internal/runtimeCompilerArgs.ts +91 -62
- package/src/launcher/internal/runtimeEmitProfile.ts +70 -0
- package/src/launcher/internal/runtimeHookPreload.ts +3 -3
- package/src/launcher/internal/runtimeOwnerPreload.ts +43 -0
- package/src/launcher/internal/singleRootProjectConfig.ts +38 -0
- package/src/launcher/internal/ttscserver/ILSPPluginSelectionInputs.ts +65 -0
- package/src/launcher/internal/ttscserver/LSPProjectInputDigest.ts +331 -0
- package/src/launcher/internal/ttscserver/captureLSPPluginSelectionInputs.ts +107 -0
- package/src/launcher/internal/ttscserver/fingerprintInitialLSPProjectInputSnapshot.ts +41 -0
- package/src/launcher/internal/ttscserver/initialLSPProjectInputSnapshotIsCurrent.ts +36 -0
- package/src/launcher/internal/ttscserver/materializeLSPPluginManifest.ts +60 -0
- package/src/launcher/internal/ttscserver/needsStdio.ts +32 -0
- package/src/launcher/internal/ttscserver/runTtscserver.ts +592 -0
- package/src/launcher/internal/watch/CompilerDirectoryWatchEventPlan.ts +31 -0
- package/src/launcher/internal/watch/DirectoryWatcher.ts +45 -0
- package/src/launcher/internal/watch/FseventsStreams.ts +303 -0
- package/src/launcher/internal/watch/ProjectInputWatchRules.ts +179 -0
- package/src/launcher/internal/watch/WatchInputChange.ts +31 -0
- package/src/launcher/internal/watch/WatchPaths.ts +156 -0
- package/src/launcher/internal/{watchTopology.ts → watch/WatchTopology.ts} +867 -962
- package/src/launcher/internal/watch/literalGlobRoot.ts +40 -0
- package/src/launcher/internal/watch/planCompilerDirectoryWatchEvent.ts +83 -0
- package/src/launcher/internal/watch/projectInputActiveWatchDirectories.ts +47 -0
- package/src/launcher/internal/watch/projectInputAvailableWatchDirectory.ts +56 -0
- package/src/launcher/internal/watch/projectInputEventShouldNotify.ts +23 -0
- package/src/launcher/internal/watch/projectInputMembershipInvalidatesProgram.ts +63 -0
- package/src/launcher/internal/watch/projectInputReloadEventShouldNotify.ts +127 -0
- package/src/launcher/internal/watch/projectInputReplacementStrandsWatchers.ts +57 -0
- package/src/launcher/internal/watch/projectInputTopologyMayAffect.ts +73 -0
- package/src/launcher/internal/watch/projectInputWatchDirectories.ts +33 -0
- package/src/launcher/internal/watch/reloadInputsForFailedTopologyRefresh.ts +49 -0
- package/src/launcher/internal/watch/syncWatchers.ts +64 -0
- package/src/launcher/internal/watch/watchDirectory.ts +53 -0
- package/src/launcher/internal/watch/watchDirectoryThroughFsWatch.ts +47 -0
- package/src/launcher/ttscserver.ts +1 -1
- package/src/launcher/ttsx.ts +2 -3
- package/src/plugin/CapabilityPluginResolver.ts +549 -0
- package/src/plugin/ITtscCapabilityPlugin.ts +93 -0
- package/src/plugin/internal/CapabilityPluginResult.ts +99 -0
- package/src/plugin/internal/CapabilityResolutionFormat.ts +248 -0
- package/src/plugin/internal/ITtscCapabilityPluginSource.ts +37 -0
- package/src/plugin/internal/ITtscCapabilityResolutionEntry.ts +57 -0
- package/src/plugin/internal/ITtscCapabilityResolutionPlugin.ts +22 -0
- package/src/plugin/internal/capabilityPluginWorker.ts +216 -0
- package/src/plugin/internal/decodeCapabilityCommandReply.ts +27 -0
- package/src/plugin/internal/load/COMMONJS_PLUGIN_DESCRIPTOR_SHIM_SOURCE.ts +182 -0
- package/src/plugin/internal/load/PLUGIN_DESCRIPTOR_SHIM_SOURCE.ts +59 -0
- package/src/plugin/internal/load/PluginDescriptorAdmission.ts +75 -0
- package/src/plugin/internal/load/PluginDescriptorEvaluationCache.ts +432 -0
- package/src/plugin/internal/load/PluginPackageResolution.ts +711 -0
- package/src/plugin/internal/load/ProjectPluginEntries.ts +232 -0
- package/src/plugin/internal/load/RESOLUTION_INPUT_RECORDER_PATH.ts +34 -0
- package/src/plugin/internal/load/collectProjectHostInputs.ts +88 -0
- package/src/plugin/internal/load/composePluginSources.ts +121 -0
- package/src/plugin/internal/load/declaresHostInputReads.ts +52 -0
- package/src/plugin/internal/load/hasProjectPluginEntries.ts +33 -0
- package/src/plugin/internal/load/hashHostInputPaths.ts +44 -0
- package/src/plugin/internal/load/isRelativePluginSpecifier.ts +31 -0
- package/src/plugin/internal/load/loadProjectPlugins.ts +2242 -0
- package/src/plugin/internal/load/moduleResolutionBaseSelects.ts +59 -0
- package/src/plugin/internal/load/observeImportSearchRoots.ts +42 -0
- package/src/plugin/internal/load/pluginLabel.ts +28 -0
- package/src/plugin/internal/load/realpathHostInput.ts +22 -0
- package/src/plugin/internal/load/realpathHostInputPaths.ts +27 -0
- package/src/plugin/internal/load/rejectJsTransformFunctions.ts +23 -0
- package/src/plugin/internal/load/requirePluginSource.ts +34 -0
- package/src/plugin/internal/load/resolveNativeSource.ts +42 -0
- package/src/plugin/internal/load/validatePluginContributors.ts +102 -0
- package/src/plugin/internal/load/validatePluginSource.ts +19 -0
- package/src/plugin/internal/load/visitImportMappedCandidates.ts +63 -0
- package/src/plugin/internal/pluginDescriptorFailureReason.ts +35 -0
- package/src/plugin/internal/pluginDescriptorProcessFailure.ts +48 -0
- package/src/plugin/internal/readCapabilityResolution.ts +193 -0
- package/src/plugin/internal/receiveCapabilityFailure.ts +27 -0
- package/src/plugin/internal/source/CachePrunePolicy.ts +47 -0
- package/src/plugin/internal/source/GoBuildCacheCoordination.ts +588 -0
- package/src/plugin/internal/source/GoSourceInputs.ts +182 -0
- package/src/plugin/internal/source/GoToolResolution.ts +312 -0
- package/src/plugin/internal/source/IGoBuildCachePruneOptions.ts +34 -0
- package/src/plugin/internal/source/IPluginCachePruneOptions.ts +38 -0
- package/src/plugin/internal/source/IPluginModuleReplaceDirectory.ts +30 -0
- package/src/plugin/internal/source/ITtscBuildContributor.ts +19 -0
- package/src/plugin/internal/source/ITtscSourceBuildCachePaths.ts +28 -0
- package/src/plugin/internal/source/NativeSourcePackages.ts +368 -0
- package/src/plugin/internal/source/PluginBinaryUse.ts +159 -0
- package/src/plugin/internal/source/PluginBinaryWaitResult.ts +34 -0
- package/src/plugin/internal/source/PluginBuildEnvironmentReadings.ts +231 -0
- package/src/plugin/internal/source/PluginBuildEnvironmentWitness.ts +233 -0
- package/src/plugin/internal/source/PluginBuildLockFence.ts +26 -0
- package/src/plugin/internal/source/PluginBuildLockLease.ts +31 -0
- package/src/plugin/internal/source/PluginBuildLockObservation.ts +48 -0
- package/src/plugin/internal/source/PluginBuildLockOwner.ts +225 -0
- package/src/plugin/internal/source/PluginBuildLockProtocol.ts +342 -0
- package/src/plugin/internal/source/SourceBuildCacheLayout.ts +303 -0
- package/src/plugin/internal/source/SourceBuildFilesystemOperations.ts +32 -0
- package/src/plugin/internal/source/SourcePluginAdmission.ts +127 -0
- package/src/plugin/internal/source/SourcePluginWorkspace.ts +446 -0
- package/src/plugin/internal/source/acquirePluginBuildLock.ts +222 -0
- package/src/plugin/internal/source/autoQuoteGoModToken.ts +113 -0
- package/src/plugin/internal/source/buildSourcePlugin.ts +1197 -0
- package/src/plugin/internal/source/collectPluginSourceDirectories.ts +70 -0
- package/src/plugin/internal/source/collectPluginSourceFiles.ts +90 -0
- package/src/plugin/internal/source/computeCacheKey.ts +190 -0
- package/src/plugin/internal/source/copiesPluginSourceEntry.ts +52 -0
- package/src/plugin/internal/source/createExternalSourceSnapshotLayout.ts +66 -0
- package/src/plugin/internal/source/ensureExecutableGoToolchain.ts +87 -0
- package/src/plugin/internal/source/formatDuration.ts +32 -0
- package/src/plugin/internal/source/formatGoWorkPath.ts +42 -0
- package/src/plugin/internal/source/hashPluginBuildEnvironment.ts +803 -0
- package/src/plugin/internal/source/inspectPluginBuildLock.ts +330 -0
- package/src/plugin/internal/source/isPathWithin.ts +24 -0
- package/src/plugin/internal/source/legacyGlobalCacheTargets.ts +71 -0
- package/src/plugin/internal/source/pluginBuildEnvironment.ts +59 -0
- package/src/plugin/internal/source/pluginBuildEnvironmentWorker.ts +30 -0
- package/src/plugin/internal/source/pluginBuildVersions.ts +75 -0
- package/src/plugin/internal/source/pluginModuleReplaceDirectories.ts +96 -0
- package/src/plugin/internal/source/pluginSourceCovers.ts +54 -0
- package/src/plugin/internal/source/pluginSourceDigest.ts +55 -0
- package/src/plugin/internal/source/pluginSourceFilesSignature.ts +54 -0
- package/src/plugin/internal/source/pluginSourceState.ts +69 -0
- package/src/plugin/internal/source/pluginSourceStateHolds.ts +45 -0
- package/src/plugin/internal/source/processPluginBuildEnvironment.ts +40 -0
- package/src/plugin/internal/source/pruneCacheFileRoot.ts +134 -0
- package/src/plugin/internal/source/pruneGoBuildCacheRoot.ts +228 -0
- package/src/plugin/internal/source/prunePluginCacheRoot.ts +507 -0
- package/src/plugin/internal/source/prunesPluginSourceDirectory.ts +25 -0
- package/src/plugin/internal/source/reclaimPluginBuildLock.ts +63 -0
- package/src/plugin/internal/source/recordCacheFileUse.ts +35 -0
- package/src/plugin/internal/source/releasePluginBuildLock.ts +125 -0
- package/src/plugin/internal/source/resolveCleanTargets.ts +84 -0
- package/src/plugin/internal/source/resolveGoCompiler.ts +92 -0
- package/src/plugin/internal/source/resolvePluginCacheRoot.ts +32 -0
- package/src/plugin/internal/source/resolvePluginGoModule.ts +69 -0
- package/src/plugin/internal/source/resolveSourceBuildCachePaths.ts +276 -0
- package/src/plugin/internal/source/selectPluginModuleReplaceDirectories.ts +80 -0
- package/src/plugin/internal/source/spawnGoTool.ts +204 -0
- package/src/plugin/internal/source/touchPluginCacheEntryInUse.ts +44 -0
- package/src/plugin/internal/source/waitForPluginBinary.ts +123 -0
- package/src/plugin/internal/source/windowsGoCommandArgs.ts +19 -0
- package/src/plugin/internal/source/withGoBuildCacheLease.ts +101 -0
- package/src/plugin/internal/writeCapabilityResolution.ts +266 -0
- package/src/plugin/resolveCapabilityPlugins.ts +242 -77
- package/src/register.ts +20 -7
- package/src/structures/ITtscCompilerContext.ts +29 -11
- package/src/structures/ITtscCompilerDiagnostic.ts +24 -7
- package/src/structures/ITtscCompilerResult.ts +75 -25
- package/src/structures/ITtscCompilerTransformation.ts +304 -64
- package/src/structures/ITtscPlugin.ts +24 -8
- package/src/structures/ITtscPluginCapabilities.ts +58 -5
- package/src/structures/ITtscPluginContributor.ts +19 -8
- package/src/structures/ITtscPluginFactoryContext.ts +12 -3
- package/src/structures/ITtscProjectPluginConfig.ts +35 -10
- package/src/structures/TtscPluginStage.ts +9 -0
- package/src/structures/internal/ITtscLoadedNativePlugin.ts +27 -5
- package/src/structures/internal/ITtscParsedProjectConfig.ts +37 -3
- package/src/structures/internal/ITtscProjectIdentity.ts +27 -6
- package/src/structures/internal/ITtscProjectInputSnapshot.ts +31 -8
- package/src/structures/internal/ITtscProjectLocatorOptions.ts +21 -4
- package/src/structures/internal/TtscBuildOptions.ts +38 -14
- package/src/structures/internal/TtscBuildResult.ts +74 -4
- package/src/structures/internal/TtscCommonOptions.ts +59 -14
- package/src/structures/internal/TtscSingleFileEmitOptions.ts +55 -5
- package/tools/gen_shims/main.go +124 -11
- package/tools/gen_shims/package_load_admission_rejects_incomplete_results_test.go +61 -0
- package/tools/gen_shims/private_field_support_preserves_upstream_layout_test.go +104 -0
- package/tools/shim_audit/enum_generation_preserves_existing_family_members_test.go +182 -0
- package/tools/shim_audit/enum_generation_refuses_removed_public_members_test.go +93 -0
- package/tools/shim_audit/main.go +166 -31
- package/tools/shim_audit/main_test.go +35 -0
- package/tools/shim_audit/producer_exemptions_require_rationale_test.go +5 -0
- package/tools/shim_audit/producer_surface_includes_exposed_methods_test.go +5 -0
- package/tools/shim_audit/producer_surface_rejects_unproducible_reference_test.go +5 -0
- package/tools/shim_audit/shim_dir_coverage_rejects_unregistered_shims_test.go +71 -0
- package/utility/command.go +48 -0
- package/utility/flags_gen.go +2 -2
- package/utility/host.go +282 -66
- package/utility/preamble_output.go +245 -0
- package/utility/preamble_output_test.go +90 -0
- package/utility/serve.go +61 -18
- package/cmd/ttscgraph/serve_graph_snapshot_version_matches_typescript_client_test.go +0 -32
- package/cmd/ttscgraph/serve_protocol_version_matches_the_typescript_client_test.go +0 -48
- package/cmd/ttscgraph/serve_session_retries_failed_dump_test.go +0 -103
- package/internal/graph/dump_schema_version_matches_the_typescript_client_test.go +0 -48
- package/internal/graph/edge_kinds_names_every_declared_kind_test.go +0 -49
- package/internal/graph/graph_kind_contracts_match_their_producers_test.go +0 -121
- package/internal/lspserver/lsp_launcher_reload_directory_fingerprint_parity_windows_test.go +0 -94
- package/internal/lspserver/lsp_project_diagnostics_resident_unsupported_falls_back_test.go +0 -123
- package/lib/compiler/internal/paths.d.ts +0 -27
- package/lib/compiler/internal/paths.js +0 -70
- package/lib/compiler/internal/paths.js.map +0 -1
- package/lib/compiler/internal/project/readConfigJson.d.ts +0 -30
- package/lib/compiler/internal/project/readConfigJson.js +0 -208
- package/lib/compiler/internal/project/readConfigJson.js.map +0 -1
- package/lib/compiler/internal/residentCheckProcess.d.ts +0 -44
- package/lib/compiler/internal/residentCheckProcess.js +0 -213
- package/lib/compiler/internal/residentCheckProcess.js.map +0 -1
- package/lib/compiler/internal/residentTransformProcess.d.ts +0 -65
- package/lib/compiler/internal/residentTransformProcess.js +0 -330
- package/lib/compiler/internal/residentTransformProcess.js.map +0 -1
- package/lib/compiler/internal/resolveEmittedJavaScript.d.ts +0 -25
- package/lib/compiler/internal/resolveEmittedJavaScript.js +0 -165
- package/lib/compiler/internal/resolveEmittedJavaScript.js.map +0 -1
- package/lib/compiler/internal/runBuild.d.ts +0 -152
- package/lib/compiler/internal/runBuild.js +0 -1694
- package/lib/compiler/internal/runBuild.js.map +0 -1
- package/lib/compiler/internal/sharedHostHelpers.d.ts +0 -79
- package/lib/compiler/internal/sharedHostHelpers.js +0 -134
- package/lib/compiler/internal/sharedHostHelpers.js.map +0 -1
- package/lib/flags/parser.d.ts +0 -97
- package/lib/flags/parser.js +0 -293
- package/lib/flags/parser.js.map +0 -1
- package/lib/flags/schema.d.ts +0 -191
- package/lib/flags/schema.js.map +0 -1
- package/lib/internal/windowsDirectoryCaseSensitivity.d.ts +0 -10
- package/lib/internal/windowsDirectoryCaseSensitivity.js +0 -34
- package/lib/internal/windowsDirectoryCaseSensitivity.js.map +0 -1
- package/lib/launcher/internal/commonJsExportMetadata.d.ts +0 -7
- package/lib/launcher/internal/commonJsExportMetadata.js.map +0 -1
- package/lib/launcher/internal/registerRuntimeHooks.js +0 -59
- package/lib/launcher/internal/registerRuntimeHooks.js.map +0 -1
- package/lib/launcher/internal/runTtscserver.d.ts +0 -35
- package/lib/launcher/internal/runTtscserver.js +0 -660
- package/lib/launcher/internal/runTtscserver.js.map +0 -1
- package/lib/launcher/internal/runtimeHooks.d.ts +0 -198
- package/lib/launcher/internal/runtimeHooks.js +0 -2579
- package/lib/launcher/internal/runtimeHooks.js.map +0 -1
- package/lib/launcher/internal/servedSourceMap.d.ts +0 -25
- package/lib/launcher/internal/servedSourceMap.js +0 -164
- package/lib/launcher/internal/servedSourceMap.js.map +0 -1
- package/lib/launcher/internal/singleFileOutput.d.ts +0 -16
- package/lib/launcher/internal/singleFileOutput.js +0 -103
- package/lib/launcher/internal/singleFileOutput.js.map +0 -1
- package/lib/launcher/internal/watchTopology.d.ts +0 -329
- package/lib/launcher/internal/watchTopology.js.map +0 -1
- package/lib/plugin/internal/buildSourcePlugin.d.ts +0 -298
- package/lib/plugin/internal/buildSourcePlugin.js +0 -3086
- package/lib/plugin/internal/buildSourcePlugin.js.map +0 -1
- package/lib/plugin/internal/capabilityResolutionCache.d.ts +0 -76
- package/lib/plugin/internal/capabilityResolutionCache.js +0 -224
- package/lib/plugin/internal/capabilityResolutionCache.js.map +0 -1
- package/lib/plugin/internal/descriptorProcessFailure.d.ts +0 -36
- package/lib/plugin/internal/descriptorProcessFailure.js +0 -62
- package/lib/plugin/internal/descriptorProcessFailure.js.map +0 -1
- package/lib/plugin/internal/loadProjectPlugins.d.ts +0 -74
- package/lib/plugin/internal/loadProjectPlugins.js +0 -2379
- package/lib/plugin/internal/loadProjectPlugins.js.map +0 -1
- package/src/compiler/internal/paths.ts +0 -68
- package/src/compiler/internal/project/readConfigJson.ts +0 -209
- package/src/compiler/internal/residentCheckProcess.ts +0 -259
- package/src/compiler/internal/residentTransformProcess.ts +0 -406
- package/src/compiler/internal/resolveEmittedJavaScript.ts +0 -197
- package/src/compiler/internal/runBuild.ts +0 -2345
- package/src/compiler/internal/sharedHostHelpers.ts +0 -154
- package/src/flags/parser.ts +0 -459
- package/src/internal/windowsDirectoryCaseSensitivity.ts +0 -33
- package/src/launcher/internal/registerRuntimeHooks.ts +0 -68
- package/src/launcher/internal/runTtscserver.ts +0 -841
- package/src/launcher/internal/runtimeHooks.ts +0 -3197
- package/src/launcher/internal/servedSourceMap.ts +0 -183
- package/src/launcher/internal/singleFileOutput.ts +0 -133
- package/src/plugin/internal/buildSourcePlugin.ts +0 -3990
- package/src/plugin/internal/capabilityResolutionCache.ts +0 -305
- package/src/plugin/internal/descriptorProcessFailure.ts +0 -69
- package/src/plugin/internal/loadProjectPlugins.ts +0 -3044
- package/tools/shim_audit/shim_dir_coverage_test.go +0 -25
- /package/lib/{launcher/internal/registerRuntimeHooks.d.ts → compiler/internal/transformProjectWorker.d.ts} +0 -0
|
@@ -0,0 +1,2242 @@
|
|
|
1
|
+
import childProcess from "node:child_process";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
import { readJsonFile } from "../../../compiler/internal/project/readJsonFile";
|
|
8
|
+
import { readProjectConfig } from "../../../compiler/internal/project/readProjectConfig";
|
|
9
|
+
import { SidecarEnvironment } from "../../../compiler/internal/sharedHost/SidecarEnvironment";
|
|
10
|
+
import { E2ETrace } from "../../../internal/E2ETrace";
|
|
11
|
+
import { OwnedSynchronousProcess } from "../../../internal/OwnedSynchronousProcess";
|
|
12
|
+
import { createCanonicalTempDirectory } from "../../../internal/createCanonicalTempDirectory";
|
|
13
|
+
import { javascriptRuntimeCapabilities } from "../../../internal/javascriptRuntimeCapabilities";
|
|
14
|
+
import { resolveNodeBinary } from "../../../internal/resolveNodeBinary";
|
|
15
|
+
import { spawnSyncResilient } from "../../../internal/spawnSyncResilient";
|
|
16
|
+
import type { ITtscPlugin } from "../../../structures/ITtscPlugin";
|
|
17
|
+
import type { ITtscPluginContributor } from "../../../structures/ITtscPluginContributor";
|
|
18
|
+
import type { ITtscPluginFactoryContext } from "../../../structures/ITtscPluginFactoryContext";
|
|
19
|
+
import type { ITtscProjectPluginConfig } from "../../../structures/ITtscProjectPluginConfig";
|
|
20
|
+
import type { ITtscLoadedNativePlugin } from "../../../structures/internal/ITtscLoadedNativePlugin";
|
|
21
|
+
import type { ITtscParsedProjectConfig } from "../../../structures/internal/ITtscParsedProjectConfig";
|
|
22
|
+
import { pluginDescriptorFailureReason } from "../pluginDescriptorFailureReason";
|
|
23
|
+
import { pluginDescriptorProcessFailure } from "../pluginDescriptorProcessFailure";
|
|
24
|
+
import { NativeSourcePackages } from "../source/NativeSourcePackages";
|
|
25
|
+
import { SourcePluginWorkspace } from "../source/SourcePluginWorkspace";
|
|
26
|
+
import { resolvePluginGoModule } from "../source/resolvePluginGoModule";
|
|
27
|
+
import { buildSourcePlugin } from "../source/buildSourcePlugin";
|
|
28
|
+
import { isPathWithin } from "../source/isPathWithin";
|
|
29
|
+
import { pluginBuildVersions } from "../source/pluginBuildVersions";
|
|
30
|
+
import { pluginModuleReplaceDirectories } from "../source/pluginModuleReplaceDirectories";
|
|
31
|
+
import { pluginSourceState } from "../source/pluginSourceState";
|
|
32
|
+
import { COMMONJS_PLUGIN_DESCRIPTOR_SHIM_SOURCE } from "./COMMONJS_PLUGIN_DESCRIPTOR_SHIM_SOURCE";
|
|
33
|
+
import { PLUGIN_DESCRIPTOR_SHIM_SOURCE } from "./PLUGIN_DESCRIPTOR_SHIM_SOURCE";
|
|
34
|
+
import { PluginDescriptorAdmission } from "./PluginDescriptorAdmission";
|
|
35
|
+
import { PluginDescriptorEvaluationCache } from "./PluginDescriptorEvaluationCache";
|
|
36
|
+
import { PluginPackageResolution } from "./PluginPackageResolution";
|
|
37
|
+
import { ProjectPluginEntries } from "./ProjectPluginEntries";
|
|
38
|
+
import { collectProjectHostInputs } from "./collectProjectHostInputs";
|
|
39
|
+
import { composePluginSources } from "./composePluginSources";
|
|
40
|
+
import { declaresHostInputReads } from "./declaresHostInputReads";
|
|
41
|
+
import { hashHostInputPaths } from "./hashHostInputPaths";
|
|
42
|
+
import { moduleResolutionBaseSelects } from "./moduleResolutionBaseSelects";
|
|
43
|
+
import { pluginLabel } from "./pluginLabel";
|
|
44
|
+
import { realpathHostInput } from "./realpathHostInput";
|
|
45
|
+
import { realpathHostInputPaths } from "./realpathHostInputPaths";
|
|
46
|
+
import { rejectJsTransformFunctions } from "./rejectJsTransformFunctions";
|
|
47
|
+
import { requirePluginSource } from "./requirePluginSource";
|
|
48
|
+
import { resolveNativeSource } from "./resolveNativeSource";
|
|
49
|
+
import { validatePluginContributors } from "./validatePluginContributors";
|
|
50
|
+
import { validatePluginSource } from "./validatePluginSource";
|
|
51
|
+
import { visitImportMappedCandidates } from "./visitImportMappedCandidates";
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Resolve, load, and build all native plugin sidecars for a TypeScript project.
|
|
55
|
+
*
|
|
56
|
+
* Reads the project config, discovers plugin entries (from tsconfig and package
|
|
57
|
+
* auto-discovery), validates and composes their descriptors, then invokes
|
|
58
|
+
* `buildSourcePlugin` to compile each Go source package into a cached binary.
|
|
59
|
+
* Native ownership comes from the selected Go packages in generated build
|
|
60
|
+
* workspaces. The source-selected tool proposes nested transform ownership
|
|
61
|
+
* under generic host manifests while preserving source-relative input layout.
|
|
62
|
+
* Main proposals must agree in their full owning module; linked proposals must
|
|
63
|
+
* agree inside every selected transform host. Errors or disagreement terminate
|
|
64
|
+
* the load rather than changing the proposed kind.
|
|
65
|
+
* Watch callers first receive structurally selected source/module/contributor
|
|
66
|
+
* repair interests, before metadata can reject them. Valid records then narrow
|
|
67
|
+
* those interests to the exact build directories; interests alone never admit
|
|
68
|
+
* a plugin, certify a kind or supply reusable source-state proof.
|
|
69
|
+
* Returns the ordered native plugins, parsed project config, recorded
|
|
70
|
+
* JavaScript-host inputs and unresolved selection candidates, and the keyed
|
|
71
|
+
* state of reported Go source directories supplied to the builds
|
|
72
|
+
* (`pluginSources`): each plugin's module root and each contributor's source,
|
|
73
|
+
* with its state (`pluginSourceState`), the sources as the build read them
|
|
74
|
+
* together with the environment a build there is keyed on. Directories within
|
|
75
|
+
* ttsc's installed package, including its overlays and the fallback
|
|
76
|
+
* linked-plugin host, are keyed but omitted from this report under the
|
|
77
|
+
* installed-package/version ownership policy. That policy does not prove the
|
|
78
|
+
* installation cannot be edited in place. Descriptor completeness relies on the
|
|
79
|
+
* runtime recorder's status and the descriptor's explicit external-read
|
|
80
|
+
* declaration. Sequential content, metadata and physical-path observations are
|
|
81
|
+
* not an atomic snapshot or detection of every omitted read.
|
|
82
|
+
*
|
|
83
|
+
* @param options.binary - Absolute path to the ttsc native helper binary.
|
|
84
|
+
* @param options.cacheDir - Override the plugin binary cache directory.
|
|
85
|
+
* @param options.cwd - Working directory for resolving relative paths.
|
|
86
|
+
* @param options.entries - Explicit plugin entries; `false` disables all
|
|
87
|
+
* plugins (skips both tsconfig entries and package auto-discovery).
|
|
88
|
+
* @param options.env - Effective environment for source-plugin builds and
|
|
89
|
+
* isolated descriptor evaluators, including the `ttsx` fallback, merged with
|
|
90
|
+
* native environment-name identity. Defaults to `process.env` for CLI
|
|
91
|
+
* callers, so ambient behavior is unchanged.
|
|
92
|
+
* @param options.file - Path to the tsconfig/jsconfig file.
|
|
93
|
+
* @param options.pluginConfigDir - Caller-declared anchor for plugin
|
|
94
|
+
* config-file discovery (see `ITtscPluginFactoryContext.pluginConfigDir`).
|
|
95
|
+
* @param options.projectRoot - Override the project root directory.
|
|
96
|
+
* @param options.tsconfig - Alias for `file`.
|
|
97
|
+
* @evidence contracts/common.md#principled-implementation The loader brackets project discovery observations, evaluates descriptors in isolated processes and validates declarations before publishing conservative source repair interests. Metadata refusal remains terminal; valid records narrow watch interests before final admission/build, while contradictory content or physical observations are omitted from proof rather than retroactively blessed.
|
|
98
|
+
* @evidence contracts/common.md#clear-and-simple-design The operation owns one ordered load generation; private helpers separate discovery, evaluation, validation, composition and proof merging, while package resolution and source building remain their own modules.
|
|
99
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Descriptor module caches are isolated rather than deleting application singletons. ttsx retry occurs only for explicit supported TypeScript loader incompatibility, with plugins disabled to avoid recursive self-hosting; arbitrary descriptor failures are not retried into false success.
|
|
100
|
+
* @evidence contracts/common.md#meaningful-documentation Native JSDoc explains result provenance, environment and path options; helper comments explain input races, conservative proof omission, fallback authority and cleanup. Member/tag spacing and separated concepts follow the documentation skill.
|
|
101
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native path/file-URL conversion, createRequire and hidden spawn with explicit argv/environment implement OS-neutral selection and process execution. Physical identities are preserved separately from lexical candidates; Bun-specific differences are capability decisions, not OS guesses.
|
|
102
|
+
* @evidence contracts/performance.md#efficient-algorithms Input merging and conflicts use Sets/maps and sorted path populations, with path/key/value byte costs. Discovery can repeat config/manifest/candidate reads and full hashes; descriptor work includes runtime probes, full observation/JSON processing and possibly synchronous evaluation. Watch-only preliminary publication can temporarily digest/watch the full admitted module as well as its package before kind is known; callbacks delegate topology reconciliation. Load-local replacement readings serve preliminary and final publication. Package selection groups equivalent module contexts and batches entries through Go list without dependency compilation; per-load selected-tool manifest readers share overlay readings. Builds delegate source/environment hashing, copying, cold materialized ownership admission and Go execution; per-load digest maps share selected work. Composition can be quadratic in configured plugins/aliases, and native lookup/file/output bytes are not bounded by plugin count alone.
|
|
103
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Descriptor hits require the cache's context/environment/runtime/version identity and matching recorded projections, subject to producer declarations and sequential-observation limits. Per-load source/environment maps share directory-keyed digests and one selected transform host serves linked contributors; these identities do not certify every undeclared read or atomic filesystem stability.
|
|
104
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Finally restores injected environment locators, attempts evaluator directory removal and closes direct-evaluator diagnostic descriptors. Close/removal can fail; synchronous completion concerns the selected evaluator and does not certify arbitrary descendants are gone. Generation maps/results scale with observed data, and disk diagnostics/result/observation files have no independent byte ceiling here. Default disk pruning has its own interval/protection/failure policy; explicit roots remain caller-owned.
|
|
105
|
+
*/
|
|
106
|
+
export function loadProjectPlugins(options: {
|
|
107
|
+
/** Absolute native ttsc helper used in descriptor factory contexts. */
|
|
108
|
+
binary: string;
|
|
109
|
+
|
|
110
|
+
/** Caller-owned cache-root override; omitted for workspace-local policy. */
|
|
111
|
+
cacheDir?: string;
|
|
112
|
+
|
|
113
|
+
/** Invocation working directory for project discovery and relative inputs. */
|
|
114
|
+
cwd?: string;
|
|
115
|
+
|
|
116
|
+
/** Replacement plugin list, false to disable, or omitted for discovery. */
|
|
117
|
+
entries?: readonly ITtscProjectPluginConfig[] | false;
|
|
118
|
+
|
|
119
|
+
/** Effective build/evaluator environment, already merged by API callers. */
|
|
120
|
+
env?: NodeJS.ProcessEnv;
|
|
121
|
+
|
|
122
|
+
/** Explicit project config, resolved from cwd. */
|
|
123
|
+
file?: string;
|
|
124
|
+
|
|
125
|
+
/** Observe plugin build roots before building, including failed builds. */
|
|
126
|
+
onWatchInputs?: (inputs: readonly string[]) => void;
|
|
127
|
+
|
|
128
|
+
/** Caller-selected anchor for plugin-owned configuration discovery. */
|
|
129
|
+
pluginConfigDir?: string;
|
|
130
|
+
|
|
131
|
+
/** Project root override for generated config wrappers. */
|
|
132
|
+
projectRoot?: string;
|
|
133
|
+
|
|
134
|
+
/** Alias for the selected file option. */
|
|
135
|
+
tsconfig?: string;
|
|
136
|
+
}): {
|
|
137
|
+
/**
|
|
138
|
+
* Whether config selection has complete observations. Module-based extends is
|
|
139
|
+
* unproved; descriptor/module proof is carried separately by host inputs.
|
|
140
|
+
*/
|
|
141
|
+
discoveryInputsComplete: boolean;
|
|
142
|
+
|
|
143
|
+
/** Inputs only the native plugin reads, whose proof must come from it. */
|
|
144
|
+
deferredHostInputs: string[];
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Whether every descriptor reported complete runtime observations and an
|
|
148
|
+
* explicit external-read declaration (`declaresHostInputReads`). This flag
|
|
149
|
+
* does not discover reads omitted by that producer. Without the declaration,
|
|
150
|
+
* the host inputs cannot prove the load's answer to a later launch. The
|
|
151
|
+
* runtime must also explicitly complete its module observations; retained
|
|
152
|
+
* partial records do not establish that declaration's input graph.
|
|
153
|
+
*/
|
|
154
|
+
descriptorReadsDeclared: boolean;
|
|
155
|
+
|
|
156
|
+
/** Content observations captured when host inputs influenced the load. */
|
|
157
|
+
hostInputHashes: Record<string, string | null>;
|
|
158
|
+
|
|
159
|
+
/** Physical observations captured alongside the host-input reads. */
|
|
160
|
+
hostInputRealpaths: Record<string, string | null>;
|
|
161
|
+
|
|
162
|
+
/** Reported loader inputs, including unresolved discovery candidates. */
|
|
163
|
+
hostInputs: string[];
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Negative-only descriptor observation status. It records an incomplete
|
|
167
|
+
* producer channel independently of external-read declarations or dropped
|
|
168
|
+
* mutation witnesses; omission makes no positive completeness claim.
|
|
169
|
+
*/
|
|
170
|
+
observationsComplete?: false;
|
|
171
|
+
|
|
172
|
+
/** Check-stage entries followed by transform-stage entries in stable order. */
|
|
173
|
+
nativePlugins: ITtscLoadedNativePlugin[];
|
|
174
|
+
|
|
175
|
+
/** Plugin-provided Go directory states that the actual builds were keyed on. */
|
|
176
|
+
pluginSources: Record<string, string>;
|
|
177
|
+
|
|
178
|
+
/** Resolved project values and logical/physical configuration identity. */
|
|
179
|
+
project: ITtscParsedProjectConfig;
|
|
180
|
+
} {
|
|
181
|
+
// Snapshot the caller environment before `withPluginLoaderEnv` injects
|
|
182
|
+
// host-owned Node/ttsx locators into process.env. Under a Bun parent the
|
|
183
|
+
// direct descriptor evaluator must remain Bun unless the caller explicitly
|
|
184
|
+
// selected another runtime.
|
|
185
|
+
const effectiveEnv = SidecarEnvironment.merge(options.env ?? process.env);
|
|
186
|
+
const projectSnapshot = readProjectHostInputSnapshot({
|
|
187
|
+
cwd: options.cwd,
|
|
188
|
+
file: options.file,
|
|
189
|
+
includePluginDiscovery: options.entries === undefined,
|
|
190
|
+
projectRoot: options.projectRoot,
|
|
191
|
+
tsconfig: options.tsconfig,
|
|
192
|
+
});
|
|
193
|
+
const { project } = projectSnapshot;
|
|
194
|
+
const projectHostInputs = projectSnapshot.hostInputs;
|
|
195
|
+
const projectHostInputHashes = projectSnapshot.hostInputHashes;
|
|
196
|
+
const projectHostInputRealpaths = projectSnapshot.hostInputRealpaths;
|
|
197
|
+
const entries: ProjectPluginEntries.ProjectPluginEntry[] =
|
|
198
|
+
options.entries === false
|
|
199
|
+
? []
|
|
200
|
+
: ProjectPluginEntries.resolvePluginEntries(
|
|
201
|
+
project,
|
|
202
|
+
options.entries,
|
|
203
|
+
).filter((entry) => entry.config.enabled !== false);
|
|
204
|
+
if (entries.length === 0) {
|
|
205
|
+
options.onWatchInputs?.([]);
|
|
206
|
+
return {
|
|
207
|
+
...collectHostInputSnapshot(
|
|
208
|
+
project,
|
|
209
|
+
{},
|
|
210
|
+
[],
|
|
211
|
+
projectHostInputs,
|
|
212
|
+
revalidateHostInputHashes(projectHostInputHashes, projectHostInputs),
|
|
213
|
+
revalidateHostInputRealpaths(
|
|
214
|
+
projectHostInputRealpaths,
|
|
215
|
+
projectHostInputs,
|
|
216
|
+
),
|
|
217
|
+
),
|
|
218
|
+
descriptorReadsDeclared: true,
|
|
219
|
+
discoveryInputsComplete: project.configInputsComplete === true,
|
|
220
|
+
nativePlugins: [],
|
|
221
|
+
pluginSources: {},
|
|
222
|
+
project,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
227
|
+
const context = {
|
|
228
|
+
binary: options.binary,
|
|
229
|
+
cwd,
|
|
230
|
+
...(options.pluginConfigDir === undefined || options.pluginConfigDir === ""
|
|
231
|
+
? {}
|
|
232
|
+
: { pluginConfigDir: path.resolve(cwd, options.pluginConfigDir) }),
|
|
233
|
+
projectRoot: project.root,
|
|
234
|
+
tsconfig: project.path,
|
|
235
|
+
};
|
|
236
|
+
// Where isolated descriptor evaluations keep their answers across launches
|
|
237
|
+
// (`PluginDescriptorEvaluationCache`).
|
|
238
|
+
const descriptorCache: DescriptorCacheOptions = {
|
|
239
|
+
cacheDir: options.cacheDir,
|
|
240
|
+
version: pluginBuildVersions(project.root).ttsc,
|
|
241
|
+
};
|
|
242
|
+
const loadedEntries = withPluginLoaderEnv(() =>
|
|
243
|
+
entries.map((entry) => {
|
|
244
|
+
const specifier = entry.config.transform;
|
|
245
|
+
if (typeof specifier !== "string" || specifier.length === 0) {
|
|
246
|
+
throw new Error(
|
|
247
|
+
`ttsc: plugin entry is missing a string "transform" field`,
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
const entryParent = path.join(entry.baseDir, "package.json");
|
|
251
|
+
const probedCandidates = collectModuleResolutionCandidates(
|
|
252
|
+
specifier,
|
|
253
|
+
entryParent,
|
|
254
|
+
undefined,
|
|
255
|
+
);
|
|
256
|
+
// Capture every candidate before resolution chooses the descriptor entry.
|
|
257
|
+
// A post-resolution snapshot could bless a higher-priority file created
|
|
258
|
+
// after the resolver had already selected the old entry.
|
|
259
|
+
const probedCandidateHashes = hashHostInputPaths(probedCandidates);
|
|
260
|
+
const probedCandidateRealpaths = realpathHostInputPaths(probedCandidates);
|
|
261
|
+
const request = PluginPackageResolution.resolvePluginRequest(
|
|
262
|
+
specifier,
|
|
263
|
+
entry.baseDir,
|
|
264
|
+
);
|
|
265
|
+
// Keep the candidates of the search roots up to the one the entry
|
|
266
|
+
// resolved in: the lookup never read the roots after it
|
|
267
|
+
// (`moduleResolutionBaseSelects`).
|
|
268
|
+
const read = new Set(
|
|
269
|
+
collectModuleResolutionCandidates(specifier, entryParent, request).map(
|
|
270
|
+
(candidate) => path.resolve(candidate),
|
|
271
|
+
),
|
|
272
|
+
);
|
|
273
|
+
const entryCandidates = probedCandidates.filter((candidate) =>
|
|
274
|
+
read.has(path.resolve(candidate)),
|
|
275
|
+
);
|
|
276
|
+
const entryCandidateHashes = pickHostInputEntries(
|
|
277
|
+
probedCandidateHashes,
|
|
278
|
+
entryCandidates,
|
|
279
|
+
);
|
|
280
|
+
const entryCandidateRealpaths = pickHostInputEntries(
|
|
281
|
+
probedCandidateRealpaths,
|
|
282
|
+
entryCandidates,
|
|
283
|
+
);
|
|
284
|
+
const loaded = loadPluginEntry(
|
|
285
|
+
entry.config,
|
|
286
|
+
{ ...context, plugin: entry.config },
|
|
287
|
+
request,
|
|
288
|
+
effectiveEnv,
|
|
289
|
+
descriptorCache,
|
|
290
|
+
);
|
|
291
|
+
const loadedHostInputHashes = mergeObservedHostInputHashes(
|
|
292
|
+
loaded.hostInputHashes,
|
|
293
|
+
hashHostInputPaths(Object.keys(loaded.hostInputHashes)),
|
|
294
|
+
);
|
|
295
|
+
const loadedHostInputRealpaths = mergeObservedHostInputRealpaths(
|
|
296
|
+
loaded.hostInputRealpaths,
|
|
297
|
+
realpathHostInputPaths(Object.keys(loaded.hostInputRealpaths)),
|
|
298
|
+
);
|
|
299
|
+
const hostInputHashes = mergeObservedHostInputHashes(
|
|
300
|
+
entryCandidateHashes,
|
|
301
|
+
loadedHostInputHashes,
|
|
302
|
+
);
|
|
303
|
+
const hostInputRealpaths = mergeObservedHostInputRealpaths(
|
|
304
|
+
entryCandidateRealpaths,
|
|
305
|
+
loadedHostInputRealpaths,
|
|
306
|
+
);
|
|
307
|
+
for (const input of loaded.hostInputs) {
|
|
308
|
+
const absolute = path.resolve(input);
|
|
309
|
+
if (
|
|
310
|
+
!Object.prototype.hasOwnProperty.call(loadedHostInputHashes, absolute)
|
|
311
|
+
) {
|
|
312
|
+
delete hostInputHashes[absolute];
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
...loaded,
|
|
317
|
+
hostInputHashes,
|
|
318
|
+
hostInputRealpaths,
|
|
319
|
+
hostInputs: [...loaded.hostInputs, ...entryCandidates],
|
|
320
|
+
request,
|
|
321
|
+
};
|
|
322
|
+
}),
|
|
323
|
+
);
|
|
324
|
+
const plugins = composePluginSources(
|
|
325
|
+
entries,
|
|
326
|
+
loadedEntries.map((entry) => entry.plugin),
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
const { ttsc: ttscVersion, tsgo: tsgoVersion } = pluginBuildVersions(
|
|
330
|
+
context.projectRoot,
|
|
331
|
+
);
|
|
332
|
+
const candidates = plugins.map((plugin, index) => {
|
|
333
|
+
const stage = PluginDescriptorAdmission.stage(plugin);
|
|
334
|
+
validatePluginSource(plugin);
|
|
335
|
+
const contributors = validatePluginContributors(plugin);
|
|
336
|
+
const source = resolvePluginSource(plugin.source, context.projectRoot);
|
|
337
|
+
const label = pluginLabel(plugin, entries[index]!.config, index);
|
|
338
|
+
requirePluginSource(source, label);
|
|
339
|
+
return { plugin, index, stage, contributors, source, label };
|
|
340
|
+
}).map((candidate) => ({
|
|
341
|
+
...candidate,
|
|
342
|
+
...resolvePluginGoModule(candidate.source, candidate.label),
|
|
343
|
+
}));
|
|
344
|
+
const watchReplacements = options.onWatchInputs === undefined
|
|
345
|
+
? undefined
|
|
346
|
+
: new Map<string, readonly string[]>();
|
|
347
|
+
if (options.onWatchInputs !== undefined) {
|
|
348
|
+
// The prospective context reads the admitted module layout and anchors its
|
|
349
|
+
// tool there before kind exists. Keep both possible final-root baselines:
|
|
350
|
+
// a linked package keeps packageDir, and an executable keeps moduleRoot.
|
|
351
|
+
const interests = new Set(candidates.flatMap((candidate) => [
|
|
352
|
+
candidate.moduleRoot,
|
|
353
|
+
candidate.packageDir,
|
|
354
|
+
...(candidate.contributors ?? []).map((input) => input.source),
|
|
355
|
+
]).filter(reportsPluginSource));
|
|
356
|
+
options.onWatchInputs([...interests].sort());
|
|
357
|
+
const initialSize = interests.size;
|
|
358
|
+
for (const candidate of candidates) {
|
|
359
|
+
// Nested source-only proposals replace the outer root manifests. Do not
|
|
360
|
+
// activate their irrelevant module graph just to discover watch inputs.
|
|
361
|
+
if (candidate.stage === "transform" && candidate.entry !== ".") continue;
|
|
362
|
+
for (const directory of pluginReplacementWatchDirectories(
|
|
363
|
+
candidate.moduleRoot, effectiveEnv, watchReplacements,
|
|
364
|
+
)) if (reportsPluginSource(directory)) interests.add(directory);
|
|
365
|
+
}
|
|
366
|
+
if (interests.size !== initialSize)
|
|
367
|
+
options.onWatchInputs([...interests].sort());
|
|
368
|
+
}
|
|
369
|
+
const packageReaders = new Map<string, SourcePluginWorkspace.GoModReader>();
|
|
370
|
+
const proposals = NativeSourcePackages.propose(
|
|
371
|
+
candidates.map((candidate) => ({
|
|
372
|
+
...candidate, ownModule: candidate.stage !== "transform",
|
|
373
|
+
})), effectiveEnv, packageReaders,
|
|
374
|
+
);
|
|
375
|
+
const records = candidates.map(({ plugin, index, stage, contributors, source, packageDir }) => {
|
|
376
|
+
const { kind, moduleRoot } = resolveNativeSource(source, plugin, entries[index]!.config, index, {
|
|
377
|
+
env: effectiveEnv, observation: proposals[index]!.observation,
|
|
378
|
+
});
|
|
379
|
+
if (kind === "linked" && stage !== "transform") {
|
|
380
|
+
throw new Error(
|
|
381
|
+
`ttsc: plugin "${pluginLabel(plugin, entries[index]!.config, index)}" source is a linked Go package, but only transform-stage plugins can be linked into a compiler host`,
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
const linkedContributorName =
|
|
385
|
+
kind === "linked"
|
|
386
|
+
? `linked_${String(index).padStart(6, "0")}`
|
|
387
|
+
: undefined;
|
|
388
|
+
const hostInputs = validatePluginHostInputs(plugin, index);
|
|
389
|
+
const pluginHostInputHashes = validatePluginHostInputHashes(
|
|
390
|
+
plugin,
|
|
391
|
+
index,
|
|
392
|
+
hostInputs,
|
|
393
|
+
);
|
|
394
|
+
const pluginHostInputRealpaths = validatePluginHostInputRealpaths(
|
|
395
|
+
plugin,
|
|
396
|
+
index,
|
|
397
|
+
hostInputs,
|
|
398
|
+
);
|
|
399
|
+
return {
|
|
400
|
+
capabilities: plugin.capabilities,
|
|
401
|
+
contributors,
|
|
402
|
+
config: entries[index]!.config,
|
|
403
|
+
kind,
|
|
404
|
+
label: pluginLabel(plugin, entries[index]!.config, index),
|
|
405
|
+
linkedContributorName,
|
|
406
|
+
name: plugin.name,
|
|
407
|
+
reportsTypeScriptDiagnostics:
|
|
408
|
+
plugin.reportsTypeScriptDiagnostics === true,
|
|
409
|
+
request: loadedEntries[index]!.request,
|
|
410
|
+
hostInputHashes: mergePluginHostInputHashes(
|
|
411
|
+
loadedEntries[index]!.hostInputHashes,
|
|
412
|
+
pluginHostInputHashes,
|
|
413
|
+
loadedEntries[index]!.hostInputs,
|
|
414
|
+
hostInputs,
|
|
415
|
+
),
|
|
416
|
+
hostInputRealpaths: mergePluginHostInputHashes(
|
|
417
|
+
loadedEntries[index]!.hostInputRealpaths,
|
|
418
|
+
pluginHostInputRealpaths,
|
|
419
|
+
loadedEntries[index]!.hostInputs,
|
|
420
|
+
hostInputs,
|
|
421
|
+
),
|
|
422
|
+
hostInputs: [...loadedEntries[index]!.hostInputs, ...hostInputs],
|
|
423
|
+
moduleRoot,
|
|
424
|
+
packageDir,
|
|
425
|
+
source,
|
|
426
|
+
stage,
|
|
427
|
+
};
|
|
428
|
+
});
|
|
429
|
+
const executableCandidates = candidates.filter((candidate) =>
|
|
430
|
+
records[candidate.index]!.kind === "executable" && !proposals[candidate.index]!.ownModule);
|
|
431
|
+
// Admission can now narrow the provisional interests without restamping the
|
|
432
|
+
// retained package/module baselines. Final host errors still keep these roots.
|
|
433
|
+
options.onWatchInputs?.(pluginBuildDirectories(records, effectiveEnv, watchReplacements));
|
|
434
|
+
const linkedContributors = records
|
|
435
|
+
.filter((record) => record.stage === "transform")
|
|
436
|
+
.flatMap((record) =>
|
|
437
|
+
record.kind === "linked"
|
|
438
|
+
? [{ name: record.linkedContributorName!, source: record.source }]
|
|
439
|
+
: [],
|
|
440
|
+
);
|
|
441
|
+
const transformHosts = records.filter(
|
|
442
|
+
(record) => record.stage === "transform" && record.kind === "executable",
|
|
443
|
+
);
|
|
444
|
+
const hostContributors =
|
|
445
|
+
linkedContributors.length === 0 ? undefined : linkedContributors;
|
|
446
|
+
// Every host compiles the linked sources under its own module/tool context.
|
|
447
|
+
// Equivalent entries in one module share this metadata command and reader;
|
|
448
|
+
// a second executable host can select a genuinely different Go context.
|
|
449
|
+
const admittedExecutables = new Set<string>();
|
|
450
|
+
if (linkedContributors.length !== 0) {
|
|
451
|
+
const hosts = transformHosts.length === 0
|
|
452
|
+
? [{ source: path.join(ttscPackageRoot(), "cmd", "utility-host"), label: "linked-plugin-host" }]
|
|
453
|
+
: transformHosts;
|
|
454
|
+
const contexts = new Map<string, { source: string; label: string; records: typeof transformHosts }>();
|
|
455
|
+
for (const host of hosts) {
|
|
456
|
+
const moduleRoot = resolvePluginGoModule(host.source, host.label).moduleRoot;
|
|
457
|
+
let context = contexts.get(moduleRoot);
|
|
458
|
+
if (context === undefined) {
|
|
459
|
+
context = { source: host.source, label: host.label, records: [] };
|
|
460
|
+
contexts.set(moduleRoot, context);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
for (const record of transformHosts) contexts.get(record.moduleRoot)!.records.push(record);
|
|
464
|
+
for (const host of contexts.values()) {
|
|
465
|
+
const moduleHosts = host.records;
|
|
466
|
+
const hostEntries = moduleHosts.map((record) => ({
|
|
467
|
+
entry: resolvePluginGoModule(record.source, record.label).entry,
|
|
468
|
+
}));
|
|
469
|
+
const observations = NativeSourcePackages.inspect({
|
|
470
|
+
source: host.source, pluginName: host.label, env: effectiveEnv,
|
|
471
|
+
readers: packageReaders,
|
|
472
|
+
packages: [
|
|
473
|
+
...hostEntries,
|
|
474
|
+
...linkedContributors.map((input) => ({
|
|
475
|
+
...input, entry: `./contrib/${input.name}`,
|
|
476
|
+
})),
|
|
477
|
+
],
|
|
478
|
+
});
|
|
479
|
+
moduleHosts.forEach((record, index) => {
|
|
480
|
+
NativeSourcePackages.kind(observations[index]!, record.label, "executable");
|
|
481
|
+
admittedExecutables.add(record.source);
|
|
482
|
+
});
|
|
483
|
+
linkedContributors.forEach((input, index) => {
|
|
484
|
+
NativeSourcePackages.kind(observations[hostEntries.length + index]!, `${input.name} inside host ${host.label}`, "linked");
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
// A nested main proposal still needs its actual owning manifests. Hosts
|
|
489
|
+
// with linked contributors were admitted together above; other equivalent
|
|
490
|
+
// entries share one standalone observation, with no repeated host copy.
|
|
491
|
+
const standaloneCandidates = executableCandidates.filter((candidate) =>
|
|
492
|
+
!admittedExecutables.has(candidate.source));
|
|
493
|
+
const executablePackages = NativeSourcePackages.ownPackages(
|
|
494
|
+
standaloneCandidates, effectiveEnv, packageReaders,
|
|
495
|
+
);
|
|
496
|
+
standaloneCandidates.forEach((candidate, index) => {
|
|
497
|
+
NativeSourcePackages.kind(executablePackages[index]!, candidate.label, "executable");
|
|
498
|
+
});
|
|
499
|
+
const packageOwnership = (source: string, label: string, linked: boolean) => [
|
|
500
|
+
{ entry: resolvePluginGoModule(source, label).entry, kind: "executable" as const },
|
|
501
|
+
...(linked ? linkedContributors.map((input) => ({
|
|
502
|
+
entry: `./contrib/${input.name}`, kind: "linked" as const,
|
|
503
|
+
})) : []),
|
|
504
|
+
];
|
|
505
|
+
// One reading of each source directory, shared by every build below and
|
|
506
|
+
// reported as the state the binaries were keyed on.
|
|
507
|
+
const sourceDigests = new Map<string, string>();
|
|
508
|
+
// And one reading of the environment each build directory is keyed on, which
|
|
509
|
+
// a plugin module root's state reports as it is.
|
|
510
|
+
const environmentDigests = new Map<string, string>();
|
|
511
|
+
const builtTransformHosts = new Map<object, string>();
|
|
512
|
+
for (const record of transformHosts) {
|
|
513
|
+
builtTransformHosts.set(
|
|
514
|
+
record,
|
|
515
|
+
buildSourcePlugin({
|
|
516
|
+
baseDir: context.projectRoot,
|
|
517
|
+
cacheDir: options.cacheDir,
|
|
518
|
+
contributors: mergeContributors(record.contributors, hostContributors),
|
|
519
|
+
env: effectiveEnv,
|
|
520
|
+
pluginName: record.label,
|
|
521
|
+
packageOwnership: packageOwnership(record.source, record.label, true),
|
|
522
|
+
source: record.source,
|
|
523
|
+
environmentDigests,
|
|
524
|
+
sourceDigests,
|
|
525
|
+
ttscVersion,
|
|
526
|
+
tsgoVersion,
|
|
527
|
+
}),
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
const fallbackDriverHost =
|
|
531
|
+
transformHosts.length === 0 && linkedContributors.length !== 0
|
|
532
|
+
? buildSourcePlugin({
|
|
533
|
+
baseDir: context.projectRoot,
|
|
534
|
+
cacheDir: options.cacheDir,
|
|
535
|
+
contributors: linkedContributors,
|
|
536
|
+
env: effectiveEnv,
|
|
537
|
+
label: "linked plugin host",
|
|
538
|
+
pluginName: "linked-plugin-host",
|
|
539
|
+
source: path.join(ttscPackageRoot(), "cmd", "utility-host"),
|
|
540
|
+
packageOwnership: packageOwnership(
|
|
541
|
+
path.join(ttscPackageRoot(), "cmd", "utility-host"), "linked-plugin-host", true,
|
|
542
|
+
),
|
|
543
|
+
environmentDigests,
|
|
544
|
+
sourceDigests,
|
|
545
|
+
ttscVersion,
|
|
546
|
+
tsgoVersion,
|
|
547
|
+
})
|
|
548
|
+
: undefined;
|
|
549
|
+
const selectedTransformHost =
|
|
550
|
+
transformHosts.length === 0
|
|
551
|
+
? fallbackDriverHost
|
|
552
|
+
: builtTransformHosts.get(transformHosts[0]!);
|
|
553
|
+
const nativePlugins: ITtscLoadedNativePlugin[] = records.map((record) => {
|
|
554
|
+
const binary =
|
|
555
|
+
record.stage === "transform" && record.kind === "linked"
|
|
556
|
+
? selectedTransformHost
|
|
557
|
+
: record.stage === "transform"
|
|
558
|
+
? builtTransformHosts.get(record)
|
|
559
|
+
: buildSourcePlugin({
|
|
560
|
+
baseDir: context.projectRoot,
|
|
561
|
+
cacheDir: options.cacheDir,
|
|
562
|
+
contributors: record.contributors,
|
|
563
|
+
env: effectiveEnv,
|
|
564
|
+
pluginName: record.label,
|
|
565
|
+
packageOwnership: packageOwnership(record.source, record.label, false),
|
|
566
|
+
source: record.source,
|
|
567
|
+
environmentDigests,
|
|
568
|
+
sourceDigests,
|
|
569
|
+
ttscVersion,
|
|
570
|
+
tsgoVersion,
|
|
571
|
+
});
|
|
572
|
+
if (binary === undefined) {
|
|
573
|
+
throw new Error(
|
|
574
|
+
`ttsc: plugin "${record.label}" is a linked Go package, but no compiler host is available`,
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
return {
|
|
578
|
+
binary,
|
|
579
|
+
// This fallback is compiled from our utility-host, whose actual writer
|
|
580
|
+
// publishes provenance and supports a separate compiler argument cwd.
|
|
581
|
+
// A separately selected executable host must opt
|
|
582
|
+
// in itself; a linked library cannot certify that foreign host.
|
|
583
|
+
capabilities:
|
|
584
|
+
record.stage === "transform" &&
|
|
585
|
+
record.kind === "linked" &&
|
|
586
|
+
fallbackDriverHost !== undefined
|
|
587
|
+
? {
|
|
588
|
+
...record.capabilities,
|
|
589
|
+
compilerArgsCwd: true,
|
|
590
|
+
emitProvenance: true,
|
|
591
|
+
}
|
|
592
|
+
: record.capabilities,
|
|
593
|
+
config: record.config,
|
|
594
|
+
contributors: record.contributors,
|
|
595
|
+
kind: record.kind,
|
|
596
|
+
name: record.name,
|
|
597
|
+
reportsTypeScriptDiagnostics: record.reportsTypeScriptDiagnostics,
|
|
598
|
+
source: record.source,
|
|
599
|
+
stage: record.stage,
|
|
600
|
+
};
|
|
601
|
+
});
|
|
602
|
+
return {
|
|
603
|
+
...collectHostInputSnapshot(
|
|
604
|
+
project,
|
|
605
|
+
context,
|
|
606
|
+
records,
|
|
607
|
+
projectHostInputs,
|
|
608
|
+
revalidateHostInputHashes(projectHostInputHashes, projectHostInputs),
|
|
609
|
+
revalidateHostInputRealpaths(
|
|
610
|
+
projectHostInputRealpaths,
|
|
611
|
+
projectHostInputs,
|
|
612
|
+
),
|
|
613
|
+
),
|
|
614
|
+
descriptorReadsDeclared: loadedEntries.every(
|
|
615
|
+
(entry) =>
|
|
616
|
+
entry.observationsComplete && declaresHostInputReads(entry.plugin),
|
|
617
|
+
),
|
|
618
|
+
discoveryInputsComplete: project.configInputsComplete === true,
|
|
619
|
+
nativePlugins: orderNativePlugins(nativePlugins),
|
|
620
|
+
...(loadedEntries.some((entry) => !entry.observationsComplete)
|
|
621
|
+
? { observationsComplete: false as const }
|
|
622
|
+
: {}),
|
|
623
|
+
// The directories the watch inputs named before the builds, as the builds
|
|
624
|
+
// read them.
|
|
625
|
+
pluginSources: Object.fromEntries(
|
|
626
|
+
[...sourceDigests]
|
|
627
|
+
.filter(([directory]) => reportsPluginSource(directory))
|
|
628
|
+
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
|
629
|
+
.map(([directory, sourceDigest]) => [
|
|
630
|
+
directory,
|
|
631
|
+
pluginSourceState(directory, {
|
|
632
|
+
env: effectiveEnv,
|
|
633
|
+
sourceDigest,
|
|
634
|
+
...(environmentDigests.has(directory)
|
|
635
|
+
? { environment: environmentDigests.get(directory)! }
|
|
636
|
+
: {}),
|
|
637
|
+
}),
|
|
638
|
+
]),
|
|
639
|
+
),
|
|
640
|
+
project,
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
type ProjectHostInputSnapshot = {
|
|
645
|
+
hostInputHashes: Record<string, string | null>;
|
|
646
|
+
hostInputRealpaths: Record<string, string | null>;
|
|
647
|
+
hostInputs: string[];
|
|
648
|
+
project: ITtscParsedProjectConfig;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Collect exact JavaScript-host files that universally influence the loaded
|
|
653
|
+
* transform. Program files belong to the native reference graph; this list is
|
|
654
|
+
* deliberately limited to config ancestry, descriptor entries, the project
|
|
655
|
+
* manifest controlling auto-discovery, and explicit plugin config files.
|
|
656
|
+
*/
|
|
657
|
+
function collectHostInputSnapshot(
|
|
658
|
+
project: ITtscParsedProjectConfig,
|
|
659
|
+
context: { pluginConfigDir?: string },
|
|
660
|
+
records: readonly {
|
|
661
|
+
config: ITtscProjectPluginConfig;
|
|
662
|
+
hostInputHashes: Readonly<Record<string, string | null>>;
|
|
663
|
+
hostInputRealpaths: Readonly<Record<string, string | null>>;
|
|
664
|
+
hostInputs: readonly string[];
|
|
665
|
+
request: string;
|
|
666
|
+
}[],
|
|
667
|
+
baselineInputs: readonly string[],
|
|
668
|
+
baselineHashes: Readonly<Record<string, string | null>>,
|
|
669
|
+
baselineRealpaths: Readonly<Record<string, string | null>>,
|
|
670
|
+
): {
|
|
671
|
+
deferredHostInputs: string[];
|
|
672
|
+
hostInputHashes: Record<string, string | null>;
|
|
673
|
+
hostInputRealpaths: Record<string, string | null>;
|
|
674
|
+
hostInputs: string[];
|
|
675
|
+
} {
|
|
676
|
+
const inputs = new Set<string>(
|
|
677
|
+
baselineInputs.map((file) => path.resolve(file)),
|
|
678
|
+
);
|
|
679
|
+
// A path consumed by any JavaScript-host stage keeps that stage's proof
|
|
680
|
+
// obligation, even when another plugin merely forwards the same spelling as
|
|
681
|
+
// its conventional native `configFile`. Otherwise one non-consuming record
|
|
682
|
+
// could let the native result replace a missing/raced JavaScript proof for a
|
|
683
|
+
// different record that really read the file.
|
|
684
|
+
const consumed = new Set<string>(
|
|
685
|
+
baselineInputs.map((file) => path.resolve(file)),
|
|
686
|
+
);
|
|
687
|
+
for (const record of records) {
|
|
688
|
+
for (const hostInput of record.hostInputs) {
|
|
689
|
+
consumed.add(path.resolve(hostInput));
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
const deferred = new Set<string>();
|
|
693
|
+
const configBase = context.pluginConfigDir ?? path.dirname(project.path);
|
|
694
|
+
for (const record of records) {
|
|
695
|
+
inputs.add(path.resolve(record.request));
|
|
696
|
+
for (const hostInput of record.hostInputs) {
|
|
697
|
+
inputs.add(path.resolve(hostInput));
|
|
698
|
+
}
|
|
699
|
+
const descriptorManifest = PluginPackageResolution.findNearestPackageJson(
|
|
700
|
+
record.request,
|
|
701
|
+
);
|
|
702
|
+
if (descriptorManifest !== undefined) {
|
|
703
|
+
inputs.add(path.resolve(descriptorManifest));
|
|
704
|
+
}
|
|
705
|
+
const configFile = record.config.configFile;
|
|
706
|
+
if (typeof configFile === "string" && configFile.trim() !== "") {
|
|
707
|
+
const absolute = path.isAbsolute(configFile)
|
|
708
|
+
? path.resolve(configFile)
|
|
709
|
+
: path.resolve(configBase, configFile);
|
|
710
|
+
inputs.add(absolute);
|
|
711
|
+
// `configFile` is a convention forwarded to the native plugin, not a
|
|
712
|
+
// file the JavaScript loader reads. Its compile-time proof must therefore
|
|
713
|
+
// come back from that plugin. A descriptor that separately reports the
|
|
714
|
+
// same path did consume it here and remains subject to its own proof.
|
|
715
|
+
if (!consumed.has(absolute)) {
|
|
716
|
+
deferred.add(absolute);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
const hostInputs = [...inputs].sort();
|
|
721
|
+
const evaluationHashes = mergeObservedHostInputHashes(
|
|
722
|
+
baselineHashes,
|
|
723
|
+
...records.map((record) => record.hostInputHashes),
|
|
724
|
+
);
|
|
725
|
+
const evaluationRealpaths = mergeObservedHostInputRealpaths(
|
|
726
|
+
baselineRealpaths,
|
|
727
|
+
...records.map((record) => record.hostInputRealpaths),
|
|
728
|
+
);
|
|
729
|
+
for (const record of records) {
|
|
730
|
+
for (const input of record.hostInputs) {
|
|
731
|
+
const absolute = path.resolve(input);
|
|
732
|
+
if (
|
|
733
|
+
!Object.prototype.hasOwnProperty.call(record.hostInputHashes, absolute)
|
|
734
|
+
) {
|
|
735
|
+
delete evaluationHashes[absolute];
|
|
736
|
+
}
|
|
737
|
+
if (
|
|
738
|
+
!Object.prototype.hasOwnProperty.call(
|
|
739
|
+
record.hostInputRealpaths,
|
|
740
|
+
absolute,
|
|
741
|
+
)
|
|
742
|
+
) {
|
|
743
|
+
delete evaluationRealpaths[absolute];
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
const hostInputHashes = Object.fromEntries(
|
|
748
|
+
hostInputs.flatMap((file) =>
|
|
749
|
+
Object.prototype.hasOwnProperty.call(evaluationHashes, file)
|
|
750
|
+
? ([[file, evaluationHashes[file]!]] as const)
|
|
751
|
+
: [],
|
|
752
|
+
),
|
|
753
|
+
);
|
|
754
|
+
const hostInputRealpaths = Object.fromEntries(
|
|
755
|
+
hostInputs.flatMap((file) =>
|
|
756
|
+
Object.prototype.hasOwnProperty.call(evaluationRealpaths, file)
|
|
757
|
+
? ([[file, evaluationRealpaths[file]!]] as const)
|
|
758
|
+
: [],
|
|
759
|
+
),
|
|
760
|
+
);
|
|
761
|
+
return {
|
|
762
|
+
deferredHostInputs: [...deferred].sort(),
|
|
763
|
+
hostInputHashes,
|
|
764
|
+
hostInputRealpaths,
|
|
765
|
+
hostInputs,
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Read one project configuration while its complete discovery surface remains
|
|
771
|
+
* unchanged. The preliminary read discovers the input set; the accepted read is
|
|
772
|
+
* bracketed by equal fingerprints for that same set. A repeatedly changing
|
|
773
|
+
* project is still returned so compilation can make progress, but without any
|
|
774
|
+
* cache proof for the ambiguous snapshot.
|
|
775
|
+
*/
|
|
776
|
+
function readProjectHostInputSnapshot(options: {
|
|
777
|
+
cwd?: string;
|
|
778
|
+
file?: string;
|
|
779
|
+
includePluginDiscovery: boolean;
|
|
780
|
+
projectRoot?: string;
|
|
781
|
+
tsconfig?: string;
|
|
782
|
+
}): ProjectHostInputSnapshot {
|
|
783
|
+
const { includePluginDiscovery, ...projectOptions } = options;
|
|
784
|
+
let project = readProjectConfig(projectOptions);
|
|
785
|
+
let hostInputs = collectProjectHostInputs(project, includePluginDiscovery);
|
|
786
|
+
const observedInputs = new Set(hostInputs);
|
|
787
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
788
|
+
const before = hashHostInputPaths(hostInputs);
|
|
789
|
+
const beforeRealpaths = realpathHostInputPaths(hostInputs);
|
|
790
|
+
const beforeSignatures = hostInputMetadataSignatures(hostInputs);
|
|
791
|
+
const candidateProject = readProjectConfig(projectOptions);
|
|
792
|
+
const candidateInputs = collectProjectHostInputs(
|
|
793
|
+
candidateProject,
|
|
794
|
+
includePluginDiscovery,
|
|
795
|
+
);
|
|
796
|
+
for (const input of candidateInputs) observedInputs.add(input);
|
|
797
|
+
const after = hashHostInputPaths(candidateInputs);
|
|
798
|
+
const afterRealpaths = realpathHostInputPaths(candidateInputs);
|
|
799
|
+
const afterSignatures = hostInputMetadataSignatures(candidateInputs);
|
|
800
|
+
if (
|
|
801
|
+
equalHostInputLists(hostInputs, candidateInputs) &&
|
|
802
|
+
equalHostInputHashes(before, after) &&
|
|
803
|
+
equalHostInputHashes(beforeRealpaths, afterRealpaths) &&
|
|
804
|
+
beforeSignatures !== undefined &&
|
|
805
|
+
afterSignatures !== undefined &&
|
|
806
|
+
equalHostInputHashes(beforeSignatures, afterSignatures)
|
|
807
|
+
) {
|
|
808
|
+
return {
|
|
809
|
+
hostInputHashes: after,
|
|
810
|
+
hostInputRealpaths: afterRealpaths,
|
|
811
|
+
hostInputs: candidateInputs,
|
|
812
|
+
project: candidateProject,
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
project = candidateProject;
|
|
816
|
+
hostInputs = candidateInputs;
|
|
817
|
+
}
|
|
818
|
+
return {
|
|
819
|
+
hostInputHashes: {},
|
|
820
|
+
hostInputRealpaths: {},
|
|
821
|
+
hostInputs: [...observedInputs].sort(),
|
|
822
|
+
project,
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function equalHostInputLists(
|
|
827
|
+
first: readonly string[],
|
|
828
|
+
second: readonly string[],
|
|
829
|
+
): boolean {
|
|
830
|
+
return (
|
|
831
|
+
first.length === second.length &&
|
|
832
|
+
first.every(
|
|
833
|
+
(file, index) => path.resolve(file) === path.resolve(second[index]!),
|
|
834
|
+
)
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
function equalHostInputHashes(
|
|
839
|
+
first: Readonly<Record<string, string | null>>,
|
|
840
|
+
second: Readonly<Record<string, string | null>>,
|
|
841
|
+
): boolean {
|
|
842
|
+
const files = Object.keys(first);
|
|
843
|
+
return (
|
|
844
|
+
files.length === Object.keys(second).length &&
|
|
845
|
+
files.every(
|
|
846
|
+
(file) =>
|
|
847
|
+
Object.prototype.hasOwnProperty.call(second, file) &&
|
|
848
|
+
first[file] === second[file],
|
|
849
|
+
)
|
|
850
|
+
);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/** Retain proof only for inputs whose initial and final observations agree. */
|
|
854
|
+
function revalidateHostInputHashes(
|
|
855
|
+
initial: Readonly<Record<string, string | null>>,
|
|
856
|
+
inputs: readonly string[],
|
|
857
|
+
): Record<string, string | null> {
|
|
858
|
+
const current = hashHostInputPaths(inputs);
|
|
859
|
+
const output: Record<string, string | null> = {};
|
|
860
|
+
for (const input of inputs) {
|
|
861
|
+
const absolute = path.resolve(input);
|
|
862
|
+
if (
|
|
863
|
+
Object.prototype.hasOwnProperty.call(initial, absolute) &&
|
|
864
|
+
initial[absolute] === current[absolute]
|
|
865
|
+
) {
|
|
866
|
+
output[absolute] = current[absolute]!;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
return output;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/** Keep physical-identity proof only while the same path resolves identically. */
|
|
873
|
+
function revalidateHostInputRealpaths(
|
|
874
|
+
initial: Readonly<Record<string, string | null>>,
|
|
875
|
+
inputs: readonly string[],
|
|
876
|
+
): Record<string, string | null> {
|
|
877
|
+
const current = realpathHostInputPaths(inputs);
|
|
878
|
+
return Object.fromEntries(
|
|
879
|
+
inputs.flatMap((input) => {
|
|
880
|
+
const absolute = path.resolve(input);
|
|
881
|
+
return Object.prototype.hasOwnProperty.call(initial, absolute) &&
|
|
882
|
+
initial[absolute] === current[absolute]
|
|
883
|
+
? ([[absolute, current[absolute]!]] as const)
|
|
884
|
+
: [];
|
|
885
|
+
}),
|
|
886
|
+
);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Metadata identity that survives content-preserving reads but exposes A-B-A
|
|
891
|
+
* replacement. Missing paths are tied to the nearest existing ancestor whose
|
|
892
|
+
* directory metadata changes when the missing branch appears or disappears.
|
|
893
|
+
*/
|
|
894
|
+
function hostInputMetadataSignature(file: string): string | undefined {
|
|
895
|
+
const requested = path.resolve(file);
|
|
896
|
+
let current = requested;
|
|
897
|
+
for (;;) {
|
|
898
|
+
try {
|
|
899
|
+
const link = fs.lstatSync(current, { bigint: true });
|
|
900
|
+
let target = link;
|
|
901
|
+
if (link.isSymbolicLink()) {
|
|
902
|
+
try {
|
|
903
|
+
target = fs.statSync(current, { bigint: true });
|
|
904
|
+
} catch {
|
|
905
|
+
// A broken link's own metadata cannot expose its target appearing
|
|
906
|
+
// and disappearing during evaluation. Decline cache proof instead.
|
|
907
|
+
return undefined;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
return [
|
|
911
|
+
path.relative(current, requested),
|
|
912
|
+
link.dev,
|
|
913
|
+
link.ino,
|
|
914
|
+
link.mode,
|
|
915
|
+
link.size,
|
|
916
|
+
link.mtimeNs,
|
|
917
|
+
link.ctimeNs,
|
|
918
|
+
target.dev,
|
|
919
|
+
target.ino,
|
|
920
|
+
target.mode,
|
|
921
|
+
target.size,
|
|
922
|
+
target.mtimeNs,
|
|
923
|
+
target.ctimeNs,
|
|
924
|
+
].join(":");
|
|
925
|
+
} catch (error) {
|
|
926
|
+
if (!isMissingPathError(error)) return undefined;
|
|
927
|
+
const parent = path.dirname(current);
|
|
928
|
+
if (parent === current) return undefined;
|
|
929
|
+
current = parent;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
function hostInputMetadataSignatures(
|
|
935
|
+
files: readonly string[],
|
|
936
|
+
): Record<string, string> | undefined {
|
|
937
|
+
const output: Record<string, string> = {};
|
|
938
|
+
for (const file of files) {
|
|
939
|
+
const signature = hostInputMetadataSignature(file);
|
|
940
|
+
if (signature === undefined) return undefined;
|
|
941
|
+
output[path.resolve(file)] = signature;
|
|
942
|
+
}
|
|
943
|
+
return output;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
function isMissingPathError(error: unknown): boolean {
|
|
947
|
+
const code = (error as NodeJS.ErrnoException | undefined)?.code;
|
|
948
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// The direct evaluator preloads ttsx's supported Node hook, whose
|
|
952
|
+
// extensionless rescue order includes TypeScript and ESM/CJS spellings in
|
|
953
|
+
// addition to Node's ordinary CommonJS probes.
|
|
954
|
+
const MODULE_PROBE_EXTENSIONS = [
|
|
955
|
+
".ts",
|
|
956
|
+
".tsx",
|
|
957
|
+
".mts",
|
|
958
|
+
".cts",
|
|
959
|
+
".js",
|
|
960
|
+
".mjs",
|
|
961
|
+
".cjs",
|
|
962
|
+
".json",
|
|
963
|
+
".node",
|
|
964
|
+
] as const;
|
|
965
|
+
|
|
966
|
+
/** Record every file whose later appearance can change one module resolution. */
|
|
967
|
+
function collectModuleResolutionCandidates(
|
|
968
|
+
specifier: string,
|
|
969
|
+
parentFile: string,
|
|
970
|
+
resolvedFile: string | undefined,
|
|
971
|
+
): string[] {
|
|
972
|
+
const inputs = new Set<string>();
|
|
973
|
+
const recordedBases = new Set<string>();
|
|
974
|
+
const candidates = (base: string): string[] => [
|
|
975
|
+
base,
|
|
976
|
+
...MODULE_PROBE_EXTENSIONS.map((extension) => base + extension),
|
|
977
|
+
path.join(base, "package.json"),
|
|
978
|
+
...MODULE_PROBE_EXTENSIONS.map((extension) =>
|
|
979
|
+
path.join(base, `index${extension}`),
|
|
980
|
+
),
|
|
981
|
+
];
|
|
982
|
+
const recordManifestTargets = (
|
|
983
|
+
value: unknown,
|
|
984
|
+
directory: string,
|
|
985
|
+
allowBare: boolean = false,
|
|
986
|
+
): void => {
|
|
987
|
+
if (typeof value === "string") {
|
|
988
|
+
if (
|
|
989
|
+
value !== "" &&
|
|
990
|
+
(allowBare || value.startsWith("./") || value.startsWith("../"))
|
|
991
|
+
) {
|
|
992
|
+
recordBase(path.resolve(directory, value));
|
|
993
|
+
}
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
if (Array.isArray(value)) {
|
|
997
|
+
for (const item of value) {
|
|
998
|
+
recordManifestTargets(item, directory, allowBare);
|
|
999
|
+
}
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
if (PluginPackageResolution.isRecord(value)) {
|
|
1003
|
+
for (const item of Object.values(value)) {
|
|
1004
|
+
recordManifestTargets(item, directory, allowBare);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
const recordBase = (base: string): void => {
|
|
1009
|
+
const resolvedBase = path.resolve(base);
|
|
1010
|
+
if (recordedBases.has(resolvedBase)) return;
|
|
1011
|
+
recordedBases.add(resolvedBase);
|
|
1012
|
+
for (const candidate of candidates(resolvedBase)) {
|
|
1013
|
+
inputs.add(path.resolve(candidate));
|
|
1014
|
+
}
|
|
1015
|
+
try {
|
|
1016
|
+
const manifest = readJsonFile(path.join(resolvedBase, "package.json"));
|
|
1017
|
+
if (PluginPackageResolution.isRecord(manifest)) {
|
|
1018
|
+
recordManifestTargets(manifest.exports, resolvedBase);
|
|
1019
|
+
recordManifestTargets(manifest.module, resolvedBase, true);
|
|
1020
|
+
recordManifestTargets(manifest.main, resolvedBase, true);
|
|
1021
|
+
}
|
|
1022
|
+
} catch {
|
|
1023
|
+
// A malformed selected manifest is reported by normal resolution/load.
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
const localBases = (): string[] => {
|
|
1027
|
+
if (specifier.startsWith("file:")) return [fileURLToPath(specifier)];
|
|
1028
|
+
const directory = path.dirname(parentFile);
|
|
1029
|
+
const raw = path.resolve(directory, specifier);
|
|
1030
|
+
const suffixStart = specifier.search(/[?#]/);
|
|
1031
|
+
if (suffixStart === -1) return [raw];
|
|
1032
|
+
const pathname = specifier.slice(0, suffixStart);
|
|
1033
|
+
return pathname === ""
|
|
1034
|
+
? [raw]
|
|
1035
|
+
: [...new Set([raw, path.resolve(directory, pathname)])];
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
if (
|
|
1039
|
+
specifier.startsWith(".") ||
|
|
1040
|
+
path.isAbsolute(specifier) ||
|
|
1041
|
+
specifier.startsWith("file:")
|
|
1042
|
+
) {
|
|
1043
|
+
try {
|
|
1044
|
+
for (const base of localBases()) {
|
|
1045
|
+
// An existing exact file wins before extension and directory probes.
|
|
1046
|
+
// Its own recorded identity is therefore sufficient; siblings cannot
|
|
1047
|
+
// supersede it while it exists.
|
|
1048
|
+
if (
|
|
1049
|
+
selectedByExactFile(base, resolvedFile) ||
|
|
1050
|
+
(resolvedFile === undefined &&
|
|
1051
|
+
PluginPackageResolution.existingFile(base))
|
|
1052
|
+
) {
|
|
1053
|
+
inputs.add(path.resolve(base));
|
|
1054
|
+
} else {
|
|
1055
|
+
recordBase(base);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
} catch {
|
|
1059
|
+
// Invalid URL spellings are diagnosed by the real resolver.
|
|
1060
|
+
}
|
|
1061
|
+
return [...inputs];
|
|
1062
|
+
}
|
|
1063
|
+
// A `#` specifier is looked up in the importer's own package `imports`, whose
|
|
1064
|
+
// manifest is recorded with the importer. When that maps it to a bare
|
|
1065
|
+
// package, the package's candidates up to the root that selected it are
|
|
1066
|
+
// inputs.
|
|
1067
|
+
if (specifier.startsWith("#")) {
|
|
1068
|
+
visitImportMappedCandidates(
|
|
1069
|
+
parentFile,
|
|
1070
|
+
resolvedFile,
|
|
1071
|
+
MODULE_PROBE_EXTENSIONS,
|
|
1072
|
+
undefined,
|
|
1073
|
+
(file) => inputs.add(path.resolve(file)),
|
|
1074
|
+
);
|
|
1075
|
+
return [...inputs];
|
|
1076
|
+
}
|
|
1077
|
+
const parts = specifier.split("/");
|
|
1078
|
+
const packageParts = parts[0]?.startsWith("@")
|
|
1079
|
+
? parts.slice(0, 2)
|
|
1080
|
+
: parts.slice(0, 1);
|
|
1081
|
+
if (packageParts.some((part) => part === undefined || part === "")) {
|
|
1082
|
+
return [...inputs];
|
|
1083
|
+
}
|
|
1084
|
+
const packageName = packageParts.join("/");
|
|
1085
|
+
const subpath = parts.slice(packageParts.length);
|
|
1086
|
+
const searchPaths = createRequire(parentFile).resolve.paths(specifier) ?? [];
|
|
1087
|
+
for (const searchPath of searchPaths) {
|
|
1088
|
+
const packageDirectory = path.join(searchPath, packageName);
|
|
1089
|
+
recordBase(packageDirectory);
|
|
1090
|
+
if (subpath.length !== 0) {
|
|
1091
|
+
recordBase(path.join(packageDirectory, ...subpath));
|
|
1092
|
+
}
|
|
1093
|
+
if (
|
|
1094
|
+
moduleResolutionBaseSelects(
|
|
1095
|
+
packageDirectory,
|
|
1096
|
+
resolvedFile,
|
|
1097
|
+
MODULE_PROBE_EXTENSIONS,
|
|
1098
|
+
)
|
|
1099
|
+
)
|
|
1100
|
+
break;
|
|
1101
|
+
}
|
|
1102
|
+
return [...inputs];
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
function selectedByExactFile(
|
|
1106
|
+
candidate: string,
|
|
1107
|
+
selected: string | undefined,
|
|
1108
|
+
): boolean {
|
|
1109
|
+
if (selected === undefined) return false;
|
|
1110
|
+
try {
|
|
1111
|
+
return (
|
|
1112
|
+
fs.realpathSync.native(candidate) === fs.realpathSync.native(selected)
|
|
1113
|
+
);
|
|
1114
|
+
} catch {
|
|
1115
|
+
return path.resolve(candidate) === path.resolve(selected);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
function orderNativePlugins(
|
|
1120
|
+
plugins: readonly ITtscLoadedNativePlugin[],
|
|
1121
|
+
): ITtscLoadedNativePlugin[] {
|
|
1122
|
+
return [
|
|
1123
|
+
...plugins.filter((plugin) => plugin.stage === "check"),
|
|
1124
|
+
...plugins.filter((plugin) => plugin.stage === "transform"),
|
|
1125
|
+
];
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
function loadPluginEntry(
|
|
1129
|
+
entry: ITtscProjectPluginConfig,
|
|
1130
|
+
base: Omit<ITtscPluginFactoryContext, "dirname" | "filename">,
|
|
1131
|
+
request: string,
|
|
1132
|
+
effectiveEnv: NodeJS.ProcessEnv,
|
|
1133
|
+
descriptorCache: DescriptorCacheOptions,
|
|
1134
|
+
): {
|
|
1135
|
+
hostInputHashes: Record<string, string | null>;
|
|
1136
|
+
hostInputRealpaths: Record<string, string | null>;
|
|
1137
|
+
hostInputs: string[];
|
|
1138
|
+
observationsComplete: boolean;
|
|
1139
|
+
plugin: ITtscPlugin;
|
|
1140
|
+
} {
|
|
1141
|
+
const specifier = entry.transform;
|
|
1142
|
+
if (typeof specifier !== "string" || specifier.length === 0) {
|
|
1143
|
+
throw new Error(`ttsc: plugin entry is missing a string "transform" field`);
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
// `dirname`/`filename` are per-entry: each plugin entry resolves to its own
|
|
1147
|
+
// descriptor module, so they are derived here from the resolved `request`
|
|
1148
|
+
// rather than carried on the shared base context. They give factories a
|
|
1149
|
+
// load-mode-independent stand-in for `__dirname`/`__filename`, which are
|
|
1150
|
+
// normally absent from an ESM descriptor's own module scope.
|
|
1151
|
+
const context: ITtscPluginFactoryContext = {
|
|
1152
|
+
...base,
|
|
1153
|
+
dirname: path.dirname(request),
|
|
1154
|
+
filename: request,
|
|
1155
|
+
};
|
|
1156
|
+
const loaded = loadPluginDescriptor(
|
|
1157
|
+
request,
|
|
1158
|
+
context,
|
|
1159
|
+
effectiveEnv,
|
|
1160
|
+
descriptorCache,
|
|
1161
|
+
);
|
|
1162
|
+
const plugin = PluginDescriptorAdmission.descriptor(
|
|
1163
|
+
loaded.descriptor,
|
|
1164
|
+
specifier,
|
|
1165
|
+
);
|
|
1166
|
+
rejectJsTransformFunctions(specifier, plugin);
|
|
1167
|
+
return {
|
|
1168
|
+
hostInputHashes: loaded.hostInputHashes,
|
|
1169
|
+
hostInputRealpaths: loaded.hostInputRealpaths,
|
|
1170
|
+
hostInputs: loaded.inputs,
|
|
1171
|
+
observationsComplete: loaded.observationsComplete,
|
|
1172
|
+
plugin,
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Require a plugin descriptor entry, falling back to `ttsx` when Node cannot
|
|
1178
|
+
* load a `.ts` source entry directly.
|
|
1179
|
+
*
|
|
1180
|
+
* A descriptor entry that is `.ts` source — especially a package root that
|
|
1181
|
+
* re-exports a runtime alongside the descriptor — fails Node's loader on its
|
|
1182
|
+
* first extensionless import or un-stripped type, and its imports can fan out
|
|
1183
|
+
* into a whole transitive graph of source packages. Rather than reimplement
|
|
1184
|
+
* that graph build, run the entry through `ttsx`, which already builds each
|
|
1185
|
+
* `.ts` dependency on demand. The run is forced plugins-off across the whole
|
|
1186
|
+
* graph (`--no-plugins` for the entry, `TTSC_PLUGIN_DESCRIPTOR_LOAD` for every
|
|
1187
|
+
* dependency), so the descriptor's own — possibly self-hosting — transform
|
|
1188
|
+
* never runs and cannot deadlock. A package that loads directly (a compiled
|
|
1189
|
+
* descriptor, or Bun's native `.ts`) never reaches the fallback.
|
|
1190
|
+
*/
|
|
1191
|
+
function loadPluginDescriptor(
|
|
1192
|
+
request: string,
|
|
1193
|
+
context: ITtscPluginFactoryContext,
|
|
1194
|
+
effectiveEnv: NodeJS.ProcessEnv,
|
|
1195
|
+
descriptorCache: DescriptorCacheOptions,
|
|
1196
|
+
): IsolatedPluginDescriptor {
|
|
1197
|
+
try {
|
|
1198
|
+
return loadCommonJsDescriptor(
|
|
1199
|
+
request,
|
|
1200
|
+
context,
|
|
1201
|
+
effectiveEnv,
|
|
1202
|
+
descriptorCache,
|
|
1203
|
+
);
|
|
1204
|
+
} catch (error) {
|
|
1205
|
+
if (
|
|
1206
|
+
!TS_SOURCE_PATTERN.test(request) ||
|
|
1207
|
+
!(error instanceof CommonJsDescriptorLoadError) ||
|
|
1208
|
+
!error.retryWithTtsx
|
|
1209
|
+
) {
|
|
1210
|
+
throw error;
|
|
1211
|
+
}
|
|
1212
|
+
const loaded = loadDescriptorViaTtsx(request, context, effectiveEnv);
|
|
1213
|
+
if (loaded === undefined) {
|
|
1214
|
+
throw error;
|
|
1215
|
+
}
|
|
1216
|
+
return loaded;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
/** What an isolated descriptor evaluation's cache entry is keyed under. */
|
|
1221
|
+
interface DescriptorCacheOptions {
|
|
1222
|
+
/** The plugin cache directory the caller selected, if any. */
|
|
1223
|
+
cacheDir: string | undefined;
|
|
1224
|
+
|
|
1225
|
+
/** This ttsc build's version. */
|
|
1226
|
+
version: string;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
interface IsolatedPluginDescriptor {
|
|
1230
|
+
descriptor: unknown;
|
|
1231
|
+
hostInputHashes: Record<string, string | null>;
|
|
1232
|
+
hostInputRealpaths: Record<string, string | null>;
|
|
1233
|
+
inputs: string[];
|
|
1234
|
+
observationsComplete: boolean;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
class CommonJsDescriptorLoadError extends Error {
|
|
1238
|
+
public constructor(
|
|
1239
|
+
message: string,
|
|
1240
|
+
public readonly retryWithTtsx: boolean,
|
|
1241
|
+
) {
|
|
1242
|
+
super(message);
|
|
1243
|
+
this.name = "CommonJsDescriptorLoadError";
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* Evaluate one CommonJS descriptor in a fresh runtime module-cache generation.
|
|
1249
|
+
*
|
|
1250
|
+
* Reloading an external descriptor dependency inside this process has no safe
|
|
1251
|
+
* cache operation: retaining it serves stale exports, while deleting it splits
|
|
1252
|
+
* any application singleton that required the same module first. Isolation
|
|
1253
|
+
* gives every descriptor load current bytes without mutating the host's cache.
|
|
1254
|
+
* The child invokes the factory before walking its graph, so lazy `require()`
|
|
1255
|
+
* calls are included, and a failed first load cannot strand poisoned children.
|
|
1256
|
+
*
|
|
1257
|
+
* The answer of a descriptor that declares the files it reads is kept across
|
|
1258
|
+
* launches while every input the evaluation proved still holds
|
|
1259
|
+
* (`PluginDescriptorEvaluationCache`): an unchanged project pays a proof of its
|
|
1260
|
+
* descriptor inputs instead of a runtime start and a graph load.
|
|
1261
|
+
*/
|
|
1262
|
+
function loadCommonJsDescriptor(
|
|
1263
|
+
request: string,
|
|
1264
|
+
context: ITtscPluginFactoryContext,
|
|
1265
|
+
effectiveEnv: NodeJS.ProcessEnv,
|
|
1266
|
+
descriptorCache: DescriptorCacheOptions,
|
|
1267
|
+
): IsolatedPluginDescriptor {
|
|
1268
|
+
const runtime = pluginDescriptorRuntimeBinary(effectiveEnv);
|
|
1269
|
+
const ttsx = effectiveEnv.TTSC_TTSX_BINARY ?? process.env.TTSC_TTSX_BINARY;
|
|
1270
|
+
const runtimeCapabilities = javascriptRuntimeCapabilities(
|
|
1271
|
+
runtime,
|
|
1272
|
+
effectiveEnv,
|
|
1273
|
+
context.projectRoot,
|
|
1274
|
+
);
|
|
1275
|
+
const node =
|
|
1276
|
+
!runtimeCapabilities.bun &&
|
|
1277
|
+
runtimeCapabilities.registerHooks &&
|
|
1278
|
+
runtimeCapabilities.executable !== undefined
|
|
1279
|
+
? runtimeCapabilities.executable
|
|
1280
|
+
: resolveNodeBinary(effectiveEnv, context.projectRoot);
|
|
1281
|
+
const cacheAuthority = {
|
|
1282
|
+
additionalRuntime: node,
|
|
1283
|
+
cacheDir: descriptorCache.cacheDir,
|
|
1284
|
+
context,
|
|
1285
|
+
// Everything the child receives besides the per-evaluation output paths.
|
|
1286
|
+
env: {
|
|
1287
|
+
...effectiveEnv,
|
|
1288
|
+
...(node === undefined ? {} : { TTSC_NODE_BINARY: node }),
|
|
1289
|
+
TTSC_TTSX_BINARY: ttsx,
|
|
1290
|
+
},
|
|
1291
|
+
projectRoot: context.projectRoot,
|
|
1292
|
+
request,
|
|
1293
|
+
runtime,
|
|
1294
|
+
version: descriptorCache.version,
|
|
1295
|
+
};
|
|
1296
|
+
let cacheFile: string | null = null;
|
|
1297
|
+
try {
|
|
1298
|
+
// A wrapper can consult inputs before the descriptor recorder starts.
|
|
1299
|
+
// Only a probe that actually ran the selected executable proves the
|
|
1300
|
+
// runtime authority this key can represent.
|
|
1301
|
+
if (
|
|
1302
|
+
path.isAbsolute(runtime) &&
|
|
1303
|
+
runtimeCapabilities.executable !== undefined &&
|
|
1304
|
+
fs.realpathSync.native(runtime) ===
|
|
1305
|
+
fs.realpathSync.native(runtimeCapabilities.executable)
|
|
1306
|
+
)
|
|
1307
|
+
cacheFile = PluginDescriptorEvaluationCache.locate(cacheAuthority);
|
|
1308
|
+
} catch {
|
|
1309
|
+
// Unproved runtime identity still permits an uncached actual evaluation.
|
|
1310
|
+
}
|
|
1311
|
+
const cached =
|
|
1312
|
+
cacheFile === null ? null : PluginDescriptorEvaluationCache.read(cacheFile);
|
|
1313
|
+
if (
|
|
1314
|
+
cached !== null &&
|
|
1315
|
+
PluginDescriptorEvaluationCache.locate(cacheAuthority) === cacheFile
|
|
1316
|
+
)
|
|
1317
|
+
return cached;
|
|
1318
|
+
const dir = createEvaluationTempDir();
|
|
1319
|
+
const out = path.join(dir, "descriptor.json");
|
|
1320
|
+
const inputsOut = path.join(dir, "descriptor-inputs.ndjson");
|
|
1321
|
+
const diagnostics = path.join(dir, "descriptor.stderr");
|
|
1322
|
+
const bunConfig = path.join(dir, "bunfig.toml");
|
|
1323
|
+
// The runtime hooks recognize only this evaluator-owned output sibling.
|
|
1324
|
+
const shim = `${out}.cjs`;
|
|
1325
|
+
const runtimeHookPreload = path.join(
|
|
1326
|
+
__dirname,
|
|
1327
|
+
"..",
|
|
1328
|
+
"..",
|
|
1329
|
+
"..",
|
|
1330
|
+
"launcher",
|
|
1331
|
+
"internal",
|
|
1332
|
+
"runtimeHookPreload.js",
|
|
1333
|
+
);
|
|
1334
|
+
try {
|
|
1335
|
+
// Node's CommonJS -e evaluator installs __filename/__dirname and other
|
|
1336
|
+
// CommonJS bindings on globalThis. Those globals leak into ESM descriptors
|
|
1337
|
+
// even when their checked output and loader format are correctly ESM.
|
|
1338
|
+
// A real CommonJS entry keeps the evaluator's bindings module-local.
|
|
1339
|
+
fs.writeFileSync(shim, COMMONJS_PLUGIN_DESCRIPTOR_SHIM_SOURCE);
|
|
1340
|
+
if (runtimeCapabilities.bun) {
|
|
1341
|
+
// A descriptor receives exactly the environment supplied by its ttsc
|
|
1342
|
+
// invocation. Bun otherwise auto-loads project `.env*`, local/global
|
|
1343
|
+
// bunfig preloads and loaders, and may install a missing package from the
|
|
1344
|
+
// network. Those implicit authorities are neither part of Node's loader
|
|
1345
|
+
// contract nor reproducible host inputs, so isolate this evaluator from
|
|
1346
|
+
// them while retaining Bun's native TypeScript/module semantics.
|
|
1347
|
+
fs.writeFileSync(bunConfig, "", "utf8");
|
|
1348
|
+
}
|
|
1349
|
+
const diagnosticsFd = fs.openSync(diagnostics, "w");
|
|
1350
|
+
let result: ReturnType<typeof childProcess.spawnSync>;
|
|
1351
|
+
try {
|
|
1352
|
+
result = spawnSyncResilient(
|
|
1353
|
+
runtime,
|
|
1354
|
+
[
|
|
1355
|
+
...(runtimeCapabilities.bun
|
|
1356
|
+
? [
|
|
1357
|
+
"--no-env-file",
|
|
1358
|
+
"--no-install",
|
|
1359
|
+
`--config=${bunConfig}`,
|
|
1360
|
+
`--tsconfig-override=${context.tsconfig}`,
|
|
1361
|
+
]
|
|
1362
|
+
: []),
|
|
1363
|
+
...(runtimeCapabilities.registerHooks
|
|
1364
|
+
? ["--require", runtimeHookPreload]
|
|
1365
|
+
: []),
|
|
1366
|
+
// NODE_OPTIONS may select a string-input type. This evaluator is a
|
|
1367
|
+
// .cjs file, so clear only that input-mode setting in Node's argv.
|
|
1368
|
+
...(runtimeCapabilities.bun ? [] : ["--input-type", ""]),
|
|
1369
|
+
shim,
|
|
1370
|
+
],
|
|
1371
|
+
{
|
|
1372
|
+
cwd: context.projectRoot,
|
|
1373
|
+
env: {
|
|
1374
|
+
...effectiveEnv,
|
|
1375
|
+
// The direct evaluator may be Bun, but ttsx and native config
|
|
1376
|
+
// loaders require a real Node runtime with synchronous hooks.
|
|
1377
|
+
...(node === undefined ? {} : { TTSC_NODE_BINARY: node }),
|
|
1378
|
+
TTSC_TTSX_BINARY: ttsx,
|
|
1379
|
+
TTSC_PLUGIN_CONTEXT: JSON.stringify(context),
|
|
1380
|
+
TTSC_PLUGIN_DESCRIPTOR_LOAD: "1",
|
|
1381
|
+
TTSC_PLUGIN_DESCRIPTOR_OUT: out,
|
|
1382
|
+
// User --import preloads run after the hooks install and before
|
|
1383
|
+
// the entry. Record them too; only the exact generated bootstrap
|
|
1384
|
+
// and its synchronous implementation imports are excluded.
|
|
1385
|
+
TTSC_PLUGIN_DESCRIPTOR_INPUTS_ACTIVE: "1",
|
|
1386
|
+
TTSC_PLUGIN_DESCRIPTOR_INPUTS_OUT: inputsOut,
|
|
1387
|
+
TTSC_PLUGIN_ENTRY: request,
|
|
1388
|
+
},
|
|
1389
|
+
// Hold direct-evaluator diagnostics until its retry decision is
|
|
1390
|
+
// known. A successful ttsx fallback must not inherit the expected
|
|
1391
|
+
// loader stack from the discarded first attempt.
|
|
1392
|
+
stdio: ["ignore", diagnosticsFd, diagnosticsFd],
|
|
1393
|
+
windowsHide: true,
|
|
1394
|
+
},
|
|
1395
|
+
{ stderr: diagnostics, stdout: diagnostics },
|
|
1396
|
+
);
|
|
1397
|
+
} finally {
|
|
1398
|
+
fs.closeSync(diagnosticsFd);
|
|
1399
|
+
}
|
|
1400
|
+
const failure = commonJsDescriptorProcessFailure(result, request);
|
|
1401
|
+
if (failure !== undefined) {
|
|
1402
|
+
const reason = pluginDescriptorFailureReason(out);
|
|
1403
|
+
const retryWithTtsx = commonJsDescriptorRetryWithTtsx(out);
|
|
1404
|
+
if (!retryWithTtsx) replayEvaluationDiagnostics(diagnostics);
|
|
1405
|
+
throw new CommonJsDescriptorLoadError(
|
|
1406
|
+
reason === "" ? failure.message : `${failure.message}\n${reason}`,
|
|
1407
|
+
retryWithTtsx,
|
|
1408
|
+
);
|
|
1409
|
+
}
|
|
1410
|
+
replayEvaluationDiagnostics(diagnostics);
|
|
1411
|
+
if (!fs.existsSync(out)) {
|
|
1412
|
+
throw new Error(
|
|
1413
|
+
`ttsc: plugin descriptor "${request}" evaluation in an isolated process produced no descriptor output.`,
|
|
1414
|
+
);
|
|
1415
|
+
}
|
|
1416
|
+
let parsed: unknown;
|
|
1417
|
+
try {
|
|
1418
|
+
parsed = JSON.parse(fs.readFileSync(out, "utf8"));
|
|
1419
|
+
} catch (error) {
|
|
1420
|
+
throw new Error(
|
|
1421
|
+
`ttsc: plugin descriptor "${request}" produced invalid isolated output: ${errorMessage(error)}`,
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
if (
|
|
1425
|
+
!PluginPackageResolution.isRecord(parsed) ||
|
|
1426
|
+
!Array.isArray(parsed.inputs)
|
|
1427
|
+
) {
|
|
1428
|
+
throw new Error(
|
|
1429
|
+
`ttsc: plugin descriptor "${request}" produced an invalid isolated result`,
|
|
1430
|
+
);
|
|
1431
|
+
}
|
|
1432
|
+
const parsedHashes = PluginPackageResolution.isRecord(parsed.inputHashes)
|
|
1433
|
+
? Object.fromEntries(
|
|
1434
|
+
Object.entries(parsed.inputHashes).flatMap(([file, hash]) =>
|
|
1435
|
+
typeof hash === "string" || hash === null
|
|
1436
|
+
? [[path.resolve(file), hash]]
|
|
1437
|
+
: [],
|
|
1438
|
+
),
|
|
1439
|
+
)
|
|
1440
|
+
: {};
|
|
1441
|
+
const parsedRealpaths = PluginPackageResolution.isRecord(
|
|
1442
|
+
parsed.inputRealpaths,
|
|
1443
|
+
)
|
|
1444
|
+
? Object.fromEntries(
|
|
1445
|
+
Object.entries(parsed.inputRealpaths).flatMap(([file, realpath]) =>
|
|
1446
|
+
(typeof realpath === "string" && path.isAbsolute(realpath)) ||
|
|
1447
|
+
realpath === null
|
|
1448
|
+
? [
|
|
1449
|
+
[
|
|
1450
|
+
path.resolve(file),
|
|
1451
|
+
realpath === null ? null : path.resolve(realpath),
|
|
1452
|
+
],
|
|
1453
|
+
]
|
|
1454
|
+
: [],
|
|
1455
|
+
),
|
|
1456
|
+
)
|
|
1457
|
+
: {};
|
|
1458
|
+
const stableParsedRealpaths = mergeObservedHostInputRealpaths(
|
|
1459
|
+
parsedRealpaths,
|
|
1460
|
+
realpathHostInputPaths(Object.keys(parsedRealpaths)),
|
|
1461
|
+
);
|
|
1462
|
+
for (const input of parsed.inputs) {
|
|
1463
|
+
const absolute = path.resolve(String(input));
|
|
1464
|
+
if (
|
|
1465
|
+
!Object.prototype.hasOwnProperty.call(stableParsedRealpaths, absolute)
|
|
1466
|
+
) {
|
|
1467
|
+
delete parsedHashes[absolute];
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
const runtimeInputs = readTtsxDescriptorInputs(
|
|
1471
|
+
inputsOut,
|
|
1472
|
+
request,
|
|
1473
|
+
parsed.observation,
|
|
1474
|
+
);
|
|
1475
|
+
const evaluation: IsolatedPluginDescriptor = {
|
|
1476
|
+
descriptor: parsed.descriptor,
|
|
1477
|
+
observationsComplete: runtimeInputs.complete,
|
|
1478
|
+
hostInputHashes: omitUnstableHostInputHashes(
|
|
1479
|
+
mergeObservedHostInputHashes(
|
|
1480
|
+
parsedHashes,
|
|
1481
|
+
runtimeInputs.hostInputHashes,
|
|
1482
|
+
),
|
|
1483
|
+
runtimeInputs.unstableInputs,
|
|
1484
|
+
),
|
|
1485
|
+
hostInputRealpaths: mergeObservedHostInputRealpaths(
|
|
1486
|
+
stableParsedRealpaths,
|
|
1487
|
+
runtimeInputs.hostInputRealpaths,
|
|
1488
|
+
),
|
|
1489
|
+
inputs: [
|
|
1490
|
+
...new Set([
|
|
1491
|
+
...parsed.inputs.map((input) => String(input)),
|
|
1492
|
+
...runtimeInputs.inputs,
|
|
1493
|
+
]),
|
|
1494
|
+
].sort(),
|
|
1495
|
+
};
|
|
1496
|
+
// A hit replays no diagnostics, so only an evaluation with an empty
|
|
1497
|
+
// captured diagnostics file is kept.
|
|
1498
|
+
if (
|
|
1499
|
+
cacheFile !== null &&
|
|
1500
|
+
fs.statSync(diagnostics).size === 0 &&
|
|
1501
|
+
PluginDescriptorEvaluationCache.locate(cacheAuthority) === cacheFile
|
|
1502
|
+
) {
|
|
1503
|
+
PluginDescriptorEvaluationCache.write(
|
|
1504
|
+
cacheFile,
|
|
1505
|
+
evaluation,
|
|
1506
|
+
!descriptorCache.cacheDir && !effectiveEnv.TTSC_CACHE_DIR
|
|
1507
|
+
? path.dirname(path.dirname(cacheFile))
|
|
1508
|
+
: undefined,
|
|
1509
|
+
);
|
|
1510
|
+
}
|
|
1511
|
+
return evaluation;
|
|
1512
|
+
} finally {
|
|
1513
|
+
removeEvaluationTempDir(dir);
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
/** Validate plugin-declared universal host inputs. */
|
|
1518
|
+
function validatePluginHostInputs(
|
|
1519
|
+
plugin: ITtscPlugin,
|
|
1520
|
+
index: number,
|
|
1521
|
+
): string[] {
|
|
1522
|
+
const label = plugin.name ?? `#${index + 1}`;
|
|
1523
|
+
if (plugin.hostInputs === undefined) return [];
|
|
1524
|
+
if (!Array.isArray(plugin.hostInputs)) {
|
|
1525
|
+
throw new Error(
|
|
1526
|
+
`ttsc: plugin ${JSON.stringify(label)} has invalid "hostInputs"; expected an array of absolute paths`,
|
|
1527
|
+
);
|
|
1528
|
+
}
|
|
1529
|
+
return plugin.hostInputs.map((file) => {
|
|
1530
|
+
if (typeof file !== "string" || !path.isAbsolute(file)) {
|
|
1531
|
+
throw new Error(
|
|
1532
|
+
`ttsc: plugin ${JSON.stringify(label)} has invalid "hostInputs" entry ${JSON.stringify(file)}; expected an absolute path`,
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
return path.resolve(file);
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
/** Validate descriptor-supplied evaluation fingerprints for host inputs. */
|
|
1540
|
+
function validatePluginHostInputHashes(
|
|
1541
|
+
plugin: ITtscPlugin,
|
|
1542
|
+
index: number,
|
|
1543
|
+
hostInputs: readonly string[],
|
|
1544
|
+
): Record<string, string | null> {
|
|
1545
|
+
const label = plugin.name ?? `#${index + 1}`;
|
|
1546
|
+
if (plugin.hostInputHashes === undefined) return {};
|
|
1547
|
+
if (
|
|
1548
|
+
!PluginPackageResolution.isRecord(plugin.hostInputHashes) ||
|
|
1549
|
+
Array.isArray(plugin.hostInputHashes)
|
|
1550
|
+
) {
|
|
1551
|
+
throw new Error(
|
|
1552
|
+
`ttsc: plugin ${JSON.stringify(label)} has invalid "hostInputHashes"; expected an object keyed by absolute hostInputs paths`,
|
|
1553
|
+
);
|
|
1554
|
+
}
|
|
1555
|
+
const allowed = new Set(hostInputs.map((file) => path.resolve(file)));
|
|
1556
|
+
const output: Record<string, string | null> = {};
|
|
1557
|
+
for (const [file, hash] of Object.entries(plugin.hostInputHashes)) {
|
|
1558
|
+
if (!path.isAbsolute(file)) {
|
|
1559
|
+
throw new Error(
|
|
1560
|
+
`ttsc: plugin ${JSON.stringify(label)} has invalid "hostInputHashes" key ${JSON.stringify(file)}; expected an absolute path`,
|
|
1561
|
+
);
|
|
1562
|
+
}
|
|
1563
|
+
const absolute = path.resolve(file);
|
|
1564
|
+
if (!allowed.has(absolute)) {
|
|
1565
|
+
throw new Error(
|
|
1566
|
+
`ttsc: plugin ${JSON.stringify(label)} fingerprints ${JSON.stringify(file)} without listing it in "hostInputs"`,
|
|
1567
|
+
);
|
|
1568
|
+
}
|
|
1569
|
+
if (
|
|
1570
|
+
hash !== null &&
|
|
1571
|
+
(typeof hash !== "string" || !/^[0-9a-f]{64}$/.test(hash))
|
|
1572
|
+
) {
|
|
1573
|
+
throw new Error(
|
|
1574
|
+
`ttsc: plugin ${JSON.stringify(label)} has invalid fingerprint for ${JSON.stringify(file)}; expected a lowercase SHA-256 digest or null`,
|
|
1575
|
+
);
|
|
1576
|
+
}
|
|
1577
|
+
output[absolute] = hash;
|
|
1578
|
+
}
|
|
1579
|
+
return output;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/** Validate descriptor-supplied physical identities for host inputs. */
|
|
1583
|
+
function validatePluginHostInputRealpaths(
|
|
1584
|
+
plugin: ITtscPlugin,
|
|
1585
|
+
index: number,
|
|
1586
|
+
hostInputs: readonly string[],
|
|
1587
|
+
): Record<string, string | null> {
|
|
1588
|
+
const label = plugin.name ?? `#${index + 1}`;
|
|
1589
|
+
if (plugin.hostInputRealpaths === undefined) return {};
|
|
1590
|
+
if (
|
|
1591
|
+
!PluginPackageResolution.isRecord(plugin.hostInputRealpaths) ||
|
|
1592
|
+
Array.isArray(plugin.hostInputRealpaths)
|
|
1593
|
+
) {
|
|
1594
|
+
throw new Error(
|
|
1595
|
+
`ttsc: plugin ${JSON.stringify(label)} has invalid "hostInputRealpaths"; expected an object keyed by absolute hostInputs paths`,
|
|
1596
|
+
);
|
|
1597
|
+
}
|
|
1598
|
+
const allowed = new Set(hostInputs.map((file) => path.resolve(file)));
|
|
1599
|
+
const output: Record<string, string | null> = {};
|
|
1600
|
+
for (const [file, realpath] of Object.entries(plugin.hostInputRealpaths)) {
|
|
1601
|
+
if (!path.isAbsolute(file)) {
|
|
1602
|
+
throw new Error(
|
|
1603
|
+
`ttsc: plugin ${JSON.stringify(label)} has invalid "hostInputRealpaths" key ${JSON.stringify(file)}; expected an absolute path`,
|
|
1604
|
+
);
|
|
1605
|
+
}
|
|
1606
|
+
const absolute = path.resolve(file);
|
|
1607
|
+
if (!allowed.has(absolute)) {
|
|
1608
|
+
throw new Error(
|
|
1609
|
+
`ttsc: plugin ${JSON.stringify(label)} identifies ${JSON.stringify(file)} without listing it in "hostInputs"`,
|
|
1610
|
+
);
|
|
1611
|
+
}
|
|
1612
|
+
if (
|
|
1613
|
+
realpath !== null &&
|
|
1614
|
+
(typeof realpath !== "string" || !path.isAbsolute(realpath))
|
|
1615
|
+
) {
|
|
1616
|
+
throw new Error(
|
|
1617
|
+
`ttsc: plugin ${JSON.stringify(label)} has invalid physical identity for ${JSON.stringify(file)}; expected an absolute realpath or null`,
|
|
1618
|
+
);
|
|
1619
|
+
}
|
|
1620
|
+
output[absolute] =
|
|
1621
|
+
realpath === null ? null : path.resolve(realpath as string);
|
|
1622
|
+
}
|
|
1623
|
+
return output;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
/** Merge snapshots and omit every path observed in contradictory states. */
|
|
1627
|
+
function mergeObservedHostInputHashes(
|
|
1628
|
+
...sources: Readonly<Record<string, string | null>>[]
|
|
1629
|
+
): Record<string, string | null> {
|
|
1630
|
+
const conflicts = new Set<string>();
|
|
1631
|
+
const output: Record<string, string | null> = {};
|
|
1632
|
+
for (const source of sources) {
|
|
1633
|
+
for (const [file, hash] of Object.entries(source)) {
|
|
1634
|
+
const absolute = path.resolve(file);
|
|
1635
|
+
if (conflicts.has(absolute)) continue;
|
|
1636
|
+
if (
|
|
1637
|
+
Object.prototype.hasOwnProperty.call(output, absolute) &&
|
|
1638
|
+
output[absolute] !== hash
|
|
1639
|
+
) {
|
|
1640
|
+
delete output[absolute];
|
|
1641
|
+
conflicts.add(absolute);
|
|
1642
|
+
continue;
|
|
1643
|
+
}
|
|
1644
|
+
output[absolute] = hash;
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
return output;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
const mergeObservedHostInputRealpaths = mergeObservedHostInputHashes;
|
|
1651
|
+
|
|
1652
|
+
/** The observations of exactly `inputs`, keyed by resolved path. */
|
|
1653
|
+
function pickHostInputEntries(
|
|
1654
|
+
observations: Readonly<Record<string, string | null>>,
|
|
1655
|
+
inputs: readonly string[],
|
|
1656
|
+
): Record<string, string | null> {
|
|
1657
|
+
return Object.fromEntries(
|
|
1658
|
+
inputs.flatMap((input) => {
|
|
1659
|
+
const absolute = path.resolve(input);
|
|
1660
|
+
return Object.prototype.hasOwnProperty.call(observations, absolute)
|
|
1661
|
+
? ([[absolute, observations[absolute]!]] as const)
|
|
1662
|
+
: [];
|
|
1663
|
+
}),
|
|
1664
|
+
);
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
/** Prevent a later plugin claim from reviving an unstable loader input. */
|
|
1668
|
+
function mergePluginHostInputHashes(
|
|
1669
|
+
first: Readonly<Record<string, string | null>>,
|
|
1670
|
+
second: Readonly<Record<string, string | null>>,
|
|
1671
|
+
loaderInputs: readonly string[],
|
|
1672
|
+
pluginInputs: readonly string[],
|
|
1673
|
+
): Record<string, string | null> {
|
|
1674
|
+
const output = { ...first };
|
|
1675
|
+
const guarded = new Set(loaderInputs.map((file) => path.resolve(file)));
|
|
1676
|
+
for (const input of pluginInputs) {
|
|
1677
|
+
const absolute = path.resolve(input);
|
|
1678
|
+
if (!Object.prototype.hasOwnProperty.call(second, absolute)) {
|
|
1679
|
+
delete output[absolute];
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
for (const [file, hash] of Object.entries(second)) {
|
|
1683
|
+
const absolute = path.resolve(file);
|
|
1684
|
+
if (
|
|
1685
|
+
guarded.has(absolute) &&
|
|
1686
|
+
!Object.prototype.hasOwnProperty.call(first, absolute)
|
|
1687
|
+
) {
|
|
1688
|
+
continue;
|
|
1689
|
+
}
|
|
1690
|
+
if (
|
|
1691
|
+
Object.prototype.hasOwnProperty.call(output, absolute) &&
|
|
1692
|
+
output[absolute] !== hash
|
|
1693
|
+
) {
|
|
1694
|
+
delete output[absolute];
|
|
1695
|
+
continue;
|
|
1696
|
+
}
|
|
1697
|
+
output[absolute] = hash;
|
|
1698
|
+
}
|
|
1699
|
+
return output;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
function omitUnstableHostInputHashes(
|
|
1703
|
+
hashes: Record<string, string | null>,
|
|
1704
|
+
unstableInputs: readonly string[],
|
|
1705
|
+
): Record<string, string | null> {
|
|
1706
|
+
for (const input of unstableInputs) delete hashes[path.resolve(input)];
|
|
1707
|
+
return hashes;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/** Read the isolated loader's explicit retry classification. */
|
|
1711
|
+
function commonJsDescriptorRetryWithTtsx(file: string): boolean {
|
|
1712
|
+
try {
|
|
1713
|
+
const parsed = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
1714
|
+
return (
|
|
1715
|
+
PluginPackageResolution.isRecord(parsed) &&
|
|
1716
|
+
parsed.__ttscRetryWithTtsx === true
|
|
1717
|
+
);
|
|
1718
|
+
} catch {
|
|
1719
|
+
return false;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
function commonJsDescriptorProcessFailure(
|
|
1724
|
+
result: {
|
|
1725
|
+
error?: Error;
|
|
1726
|
+
signal: NodeJS.Signals | null;
|
|
1727
|
+
status: number | null;
|
|
1728
|
+
},
|
|
1729
|
+
request: string,
|
|
1730
|
+
): Error | undefined {
|
|
1731
|
+
if (result.error !== undefined) {
|
|
1732
|
+
return new Error(
|
|
1733
|
+
`ttsc: failed to launch an isolated process for plugin descriptor "${request}": ${result.error.message}`,
|
|
1734
|
+
);
|
|
1735
|
+
}
|
|
1736
|
+
if (result.signal !== null) {
|
|
1737
|
+
return new Error(
|
|
1738
|
+
`ttsc: plugin descriptor "${request}" isolated evaluation was killed by signal ${result.signal}.`,
|
|
1739
|
+
);
|
|
1740
|
+
}
|
|
1741
|
+
if (result.status !== 0) {
|
|
1742
|
+
return new Error(
|
|
1743
|
+
`ttsc: plugin descriptor "${request}" isolated evaluation failed with exit code ${String(result.status)}`,
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
return undefined;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
const TS_SOURCE_PATTERN = /\.(?:[cm]?ts|tsx)$/i;
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Evaluate a `.ts` plugin descriptor entry in a child `ttsx` process and return
|
|
1753
|
+
* the descriptor it produces. A generated shim imports the entry, invokes its
|
|
1754
|
+
* factory with `context`, and writes the descriptor as JSON; `ttsx` runs the
|
|
1755
|
+
* shim with plugins disabled across the whole graph. Returns `undefined` when
|
|
1756
|
+
* `ttsx` is unavailable, so the caller can rethrow the original load error.
|
|
1757
|
+
*/
|
|
1758
|
+
function loadDescriptorViaTtsx(
|
|
1759
|
+
request: string,
|
|
1760
|
+
context: ITtscPluginFactoryContext,
|
|
1761
|
+
effectiveEnv: NodeJS.ProcessEnv,
|
|
1762
|
+
): IsolatedPluginDescriptor | undefined {
|
|
1763
|
+
// Binary discovery prefers the instance environment, then the ambient
|
|
1764
|
+
// process.env (where `withPluginLoaderEnv` injects ttsc's own node/ttsx paths
|
|
1765
|
+
// just before this runs), then the running interpreter.
|
|
1766
|
+
const node = resolveNodeBinary(effectiveEnv, context.projectRoot);
|
|
1767
|
+
const ttsx = effectiveEnv.TTSC_TTSX_BINARY ?? process.env.TTSC_TTSX_BINARY;
|
|
1768
|
+
if (node === undefined || ttsx === undefined || ttsx.length === 0) {
|
|
1769
|
+
return undefined;
|
|
1770
|
+
}
|
|
1771
|
+
const dir = createEvaluationTempDir();
|
|
1772
|
+
const out = path.join(dir, "descriptor.json");
|
|
1773
|
+
const inputsOut = path.join(dir, "descriptor-inputs.ndjson");
|
|
1774
|
+
const shim = path.join(dir, "load-descriptor.mts");
|
|
1775
|
+
// ttsx type-checks and builds the shim's own project, so it needs a tsconfig
|
|
1776
|
+
// to anchor on; a minimal one is enough (the shim is `@ts-nocheck`).
|
|
1777
|
+
try {
|
|
1778
|
+
fs.writeFileSync(
|
|
1779
|
+
path.join(dir, "tsconfig.json"),
|
|
1780
|
+
JSON.stringify({
|
|
1781
|
+
compilerOptions: {
|
|
1782
|
+
module: "nodenext",
|
|
1783
|
+
moduleResolution: "nodenext",
|
|
1784
|
+
skipLibCheck: true,
|
|
1785
|
+
target: "es2022",
|
|
1786
|
+
},
|
|
1787
|
+
}),
|
|
1788
|
+
);
|
|
1789
|
+
fs.writeFileSync(shim, PLUGIN_DESCRIPTOR_SHIM_SOURCE);
|
|
1790
|
+
const trace = E2ETrace.begin(
|
|
1791
|
+
node,
|
|
1792
|
+
[ttsx, "--no-plugins", shim],
|
|
1793
|
+
{ cwd: context.projectRoot },
|
|
1794
|
+
"plugin-descriptor",
|
|
1795
|
+
);
|
|
1796
|
+
const result = spawnOwnedDescriptor(node, [ttsx, "--no-plugins", shim], {
|
|
1797
|
+
cwd: context.projectRoot,
|
|
1798
|
+
encoding: "utf8",
|
|
1799
|
+
env: {
|
|
1800
|
+
...effectiveEnv,
|
|
1801
|
+
// Carry ttsc's own node/ttsx locators explicitly so the child (which
|
|
1802
|
+
// may recurse into further descriptor loads) finds them even when the
|
|
1803
|
+
// instance-env snapshot predates `withPluginLoaderEnv`.
|
|
1804
|
+
TTSC_NODE_BINARY: node,
|
|
1805
|
+
TTSC_TTSX_BINARY: ttsx,
|
|
1806
|
+
TTSC_PLUGIN_CONTEXT: JSON.stringify({
|
|
1807
|
+
binary: context.binary,
|
|
1808
|
+
cwd: context.cwd,
|
|
1809
|
+
dirname: context.dirname,
|
|
1810
|
+
filename: context.filename,
|
|
1811
|
+
plugin: context.plugin,
|
|
1812
|
+
pluginConfigDir: context.pluginConfigDir,
|
|
1813
|
+
projectRoot: context.projectRoot,
|
|
1814
|
+
tsconfig: context.tsconfig,
|
|
1815
|
+
}),
|
|
1816
|
+
TTSC_PLUGIN_DESCRIPTOR_LOAD: "1",
|
|
1817
|
+
TTSC_PLUGIN_DESCRIPTOR_OUT: out,
|
|
1818
|
+
// The generated shim arms its own descriptor observation only after
|
|
1819
|
+
// its bootstrap imports have completed, even under an armed caller.
|
|
1820
|
+
TTSC_PLUGIN_DESCRIPTOR_INPUTS_ACTIVE: "0",
|
|
1821
|
+
TTSC_PLUGIN_DESCRIPTOR_INPUTS_OUT: inputsOut,
|
|
1822
|
+
TTSC_PLUGIN_ENTRY: request,
|
|
1823
|
+
},
|
|
1824
|
+
// Both child streams are human output, and they go straight to this
|
|
1825
|
+
// process's stderr as they are written. The descriptor itself travels
|
|
1826
|
+
// through a file, so nothing here needs collecting, and streaming the
|
|
1827
|
+
// human output needs no output ceiling.
|
|
1828
|
+
stdio: ["ignore", 2, 2],
|
|
1829
|
+
windowsHide: true,
|
|
1830
|
+
});
|
|
1831
|
+
E2ETrace.result(trace, result);
|
|
1832
|
+
const processFailure = pluginDescriptorProcessFailure(result, request);
|
|
1833
|
+
if (processFailure) {
|
|
1834
|
+
// The descriptor's stack already reached the user's stderr as it ran.
|
|
1835
|
+
// What it could not put there is a reason a caller can act on, so that
|
|
1836
|
+
// arrives through the result file instead.
|
|
1837
|
+
const reason = pluginDescriptorFailureReason(out);
|
|
1838
|
+
throw reason === ""
|
|
1839
|
+
? processFailure
|
|
1840
|
+
: new Error(`${processFailure.message}
|
|
1841
|
+
${reason}`);
|
|
1842
|
+
}
|
|
1843
|
+
if (!fs.existsSync(out)) {
|
|
1844
|
+
throw new Error(
|
|
1845
|
+
`ttsc: plugin descriptor "${request}" evaluation through ttsx produced no descriptor output.`,
|
|
1846
|
+
);
|
|
1847
|
+
}
|
|
1848
|
+
const text = fs.readFileSync(out, "utf8");
|
|
1849
|
+
try {
|
|
1850
|
+
const parsed: unknown = JSON.parse(text);
|
|
1851
|
+
if (!PluginPackageResolution.isRecord(parsed)) {
|
|
1852
|
+
throw new Error("isolated output must contain a descriptor envelope");
|
|
1853
|
+
}
|
|
1854
|
+
const inputSnapshot = readTtsxDescriptorInputs(
|
|
1855
|
+
inputsOut,
|
|
1856
|
+
request,
|
|
1857
|
+
parsed.observation,
|
|
1858
|
+
);
|
|
1859
|
+
return {
|
|
1860
|
+
descriptor: parsed.descriptor,
|
|
1861
|
+
observationsComplete: inputSnapshot.complete,
|
|
1862
|
+
hostInputHashes: omitUnstableHostInputHashes(
|
|
1863
|
+
inputSnapshot.hostInputHashes,
|
|
1864
|
+
inputSnapshot.unstableInputs,
|
|
1865
|
+
),
|
|
1866
|
+
hostInputRealpaths: inputSnapshot.hostInputRealpaths,
|
|
1867
|
+
inputs: inputSnapshot.inputs,
|
|
1868
|
+
};
|
|
1869
|
+
} catch (error) {
|
|
1870
|
+
throw new Error(
|
|
1871
|
+
`ttsc: plugin descriptor "${request}" produced invalid JSON: ${errorMessage(error)}`,
|
|
1872
|
+
);
|
|
1873
|
+
}
|
|
1874
|
+
} finally {
|
|
1875
|
+
removeEvaluationTempDir(dir);
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
interface TtsxDescriptorResolutionRecord {
|
|
1880
|
+
hash?: string | null;
|
|
1881
|
+
parent?: string;
|
|
1882
|
+
realpath?: string | null;
|
|
1883
|
+
resolved?: string;
|
|
1884
|
+
signature?: string;
|
|
1885
|
+
specifier?: string;
|
|
1886
|
+
unstable?: boolean;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Expand the ttsx runtime's selected module edges into the same exact and
|
|
1891
|
+
* missing resolution inputs used by the direct isolated evaluator.
|
|
1892
|
+
*
|
|
1893
|
+
* The final owned snapshot transfers status independently of the optional
|
|
1894
|
+
* NDJSON channel. Records on disk can supplement it, but cannot turn an absent
|
|
1895
|
+
* or failed completion proof into a reusable evaluation. Malformed channel data
|
|
1896
|
+
* likewise refuses completeness without losing the descriptor.
|
|
1897
|
+
*/
|
|
1898
|
+
function readTtsxDescriptorInputs(
|
|
1899
|
+
file: string,
|
|
1900
|
+
request: string,
|
|
1901
|
+
observation: unknown,
|
|
1902
|
+
): {
|
|
1903
|
+
complete: boolean;
|
|
1904
|
+
hostInputHashes: Record<string, string | null>;
|
|
1905
|
+
hostInputRealpaths: Record<string, string | null>;
|
|
1906
|
+
inputs: string[];
|
|
1907
|
+
unstableInputs: string[];
|
|
1908
|
+
} {
|
|
1909
|
+
const inputs = new Set<string>([path.resolve(request)]);
|
|
1910
|
+
const hashes = new Map<string, string | null>();
|
|
1911
|
+
const realpaths = new Map<string, string | null>();
|
|
1912
|
+
const signatures = new Map<string, string>();
|
|
1913
|
+
const unstableInputs = new Set<string>();
|
|
1914
|
+
let complete = false;
|
|
1915
|
+
let text = "";
|
|
1916
|
+
if (
|
|
1917
|
+
PluginPackageResolution.isRecord(observation) &&
|
|
1918
|
+
Array.isArray(observation.lines) &&
|
|
1919
|
+
observation.lines.every((line: unknown) => typeof line === "string")
|
|
1920
|
+
) {
|
|
1921
|
+
complete = observation.complete === true;
|
|
1922
|
+
text = observation.lines.join("");
|
|
1923
|
+
}
|
|
1924
|
+
try {
|
|
1925
|
+
text += fs.readFileSync(file, "utf8");
|
|
1926
|
+
} catch {
|
|
1927
|
+
// The directly serialized observation copy remains authoritative when
|
|
1928
|
+
// no side-channel file was produced. A missing completion copy is never
|
|
1929
|
+
// repaired by whichever partial lines happen to remain on disk.
|
|
1930
|
+
}
|
|
1931
|
+
for (const line of text.split(/\r?\n/)) {
|
|
1932
|
+
if (line.trim() === "") continue;
|
|
1933
|
+
let record: TtsxDescriptorResolutionRecord;
|
|
1934
|
+
try {
|
|
1935
|
+
const parsed: unknown = JSON.parse(line);
|
|
1936
|
+
if (!PluginPackageResolution.isRecord(parsed) || Array.isArray(parsed)) {
|
|
1937
|
+
complete = false;
|
|
1938
|
+
continue;
|
|
1939
|
+
}
|
|
1940
|
+
record = parsed;
|
|
1941
|
+
} catch {
|
|
1942
|
+
complete = false;
|
|
1943
|
+
continue;
|
|
1944
|
+
}
|
|
1945
|
+
if (typeof record.resolved === "string") {
|
|
1946
|
+
const resolved = path.resolve(record.resolved);
|
|
1947
|
+
inputs.add(resolved);
|
|
1948
|
+
if (record.unstable === true) {
|
|
1949
|
+
hashes.delete(resolved);
|
|
1950
|
+
realpaths.delete(resolved);
|
|
1951
|
+
signatures.delete(resolved);
|
|
1952
|
+
unstableInputs.add(resolved);
|
|
1953
|
+
continue;
|
|
1954
|
+
}
|
|
1955
|
+
if (
|
|
1956
|
+
typeof record.signature !== "string" ||
|
|
1957
|
+
(signatures.has(resolved) &&
|
|
1958
|
+
signatures.get(resolved) !== record.signature)
|
|
1959
|
+
) {
|
|
1960
|
+
hashes.delete(resolved);
|
|
1961
|
+
realpaths.delete(resolved);
|
|
1962
|
+
signatures.delete(resolved);
|
|
1963
|
+
unstableInputs.add(resolved);
|
|
1964
|
+
continue;
|
|
1965
|
+
}
|
|
1966
|
+
signatures.set(resolved, record.signature);
|
|
1967
|
+
if (
|
|
1968
|
+
(typeof record.realpath === "string" &&
|
|
1969
|
+
path.isAbsolute(record.realpath)) ||
|
|
1970
|
+
record.realpath === null
|
|
1971
|
+
) {
|
|
1972
|
+
const observed =
|
|
1973
|
+
record.realpath === null ? null : path.resolve(record.realpath);
|
|
1974
|
+
if (realpaths.has(resolved) && realpaths.get(resolved) !== observed) {
|
|
1975
|
+
hashes.delete(resolved);
|
|
1976
|
+
realpaths.delete(resolved);
|
|
1977
|
+
signatures.delete(resolved);
|
|
1978
|
+
unstableInputs.add(resolved);
|
|
1979
|
+
continue;
|
|
1980
|
+
}
|
|
1981
|
+
realpaths.set(resolved, observed);
|
|
1982
|
+
}
|
|
1983
|
+
if (typeof record.hash === "string" || record.hash === null) {
|
|
1984
|
+
if (unstableInputs.has(resolved)) {
|
|
1985
|
+
// Keep a previously observed contradiction unstable.
|
|
1986
|
+
} else if (
|
|
1987
|
+
hashes.has(resolved) &&
|
|
1988
|
+
hashes.get(resolved) !== record.hash
|
|
1989
|
+
) {
|
|
1990
|
+
hashes.delete(resolved);
|
|
1991
|
+
realpaths.delete(resolved);
|
|
1992
|
+
signatures.delete(resolved);
|
|
1993
|
+
unstableInputs.add(resolved);
|
|
1994
|
+
} else {
|
|
1995
|
+
hashes.set(resolved, record.hash);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
if (
|
|
2000
|
+
typeof record.specifier === "string" &&
|
|
2001
|
+
typeof record.parent === "string"
|
|
2002
|
+
) {
|
|
2003
|
+
for (const candidate of collectModuleResolutionCandidates(
|
|
2004
|
+
record.specifier,
|
|
2005
|
+
record.parent,
|
|
2006
|
+
record.resolved,
|
|
2007
|
+
)) {
|
|
2008
|
+
inputs.add(path.resolve(candidate));
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
for (const [resolved, observed] of realpaths) {
|
|
2013
|
+
if (
|
|
2014
|
+
realpathHostInput(resolved) === observed &&
|
|
2015
|
+
signatures.get(resolved) === hostInputMetadataSignature(resolved)
|
|
2016
|
+
) {
|
|
2017
|
+
continue;
|
|
2018
|
+
}
|
|
2019
|
+
hashes.delete(resolved);
|
|
2020
|
+
realpaths.delete(resolved);
|
|
2021
|
+
signatures.delete(resolved);
|
|
2022
|
+
unstableInputs.add(resolved);
|
|
2023
|
+
}
|
|
2024
|
+
return {
|
|
2025
|
+
complete,
|
|
2026
|
+
hostInputHashes: Object.fromEntries(hashes),
|
|
2027
|
+
hostInputRealpaths: Object.fromEntries(realpaths),
|
|
2028
|
+
inputs: [...inputs].sort(),
|
|
2029
|
+
unstableInputs: [...unstableInputs],
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
function errorMessage(error: unknown): string {
|
|
2034
|
+
return error instanceof Error ? error.message : String(error);
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
function withPluginLoaderEnv<T>(run: () => T): T {
|
|
2038
|
+
const previousNode = process.env.TTSC_NODE_BINARY;
|
|
2039
|
+
const previousTtsx = process.env.TTSC_TTSX_BINARY;
|
|
2040
|
+
const node = resolveNodeBinary({}, process.cwd());
|
|
2041
|
+
if (process.env.TTSC_NODE_BINARY === undefined && node !== undefined) {
|
|
2042
|
+
process.env.TTSC_NODE_BINARY = node;
|
|
2043
|
+
}
|
|
2044
|
+
process.env.TTSC_TTSX_BINARY ??= path.join(
|
|
2045
|
+
__dirname,
|
|
2046
|
+
"..",
|
|
2047
|
+
"..",
|
|
2048
|
+
"..",
|
|
2049
|
+
"launcher",
|
|
2050
|
+
"ttsx.js",
|
|
2051
|
+
);
|
|
2052
|
+
try {
|
|
2053
|
+
return run();
|
|
2054
|
+
} finally {
|
|
2055
|
+
restoreEnv("TTSC_NODE_BINARY", previousNode);
|
|
2056
|
+
restoreEnv("TTSC_TTSX_BINARY", previousTtsx);
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
/**
|
|
2061
|
+
* Select the executable for isolated descriptor evaluation.
|
|
2062
|
+
*
|
|
2063
|
+
* Under Bun, `process.execPath` names Bun itself. Bun implements enough of the
|
|
2064
|
+
* Node module surface to evaluate descriptors natively, but not Node's
|
|
2065
|
+
* synchronous `module.registerHooks` preload. The caller therefore recognizes
|
|
2066
|
+
* this default and omits the Node-only preload while retaining the fresh
|
|
2067
|
+
* process boundary. An explicitly configured Node executable remains
|
|
2068
|
+
* authoritative and receives the preload as usual.
|
|
2069
|
+
*/
|
|
2070
|
+
function pluginDescriptorRuntimeBinary(env: NodeJS.ProcessEnv): string {
|
|
2071
|
+
if (
|
|
2072
|
+
env.TTSC_NODE_BINARY === undefined &&
|
|
2073
|
+
typeof (process.versions as Record<string, string | undefined>).bun ===
|
|
2074
|
+
"string"
|
|
2075
|
+
) {
|
|
2076
|
+
return process.execPath;
|
|
2077
|
+
}
|
|
2078
|
+
return (
|
|
2079
|
+
env.TTSC_NODE_BINARY ?? process.env.TTSC_NODE_BINARY ?? process.execPath
|
|
2080
|
+
);
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
/** Replay a child's human output without imposing a fixed output ceiling. */
|
|
2084
|
+
function replayEvaluationDiagnostics(file: string): void {
|
|
2085
|
+
let fd: number | undefined;
|
|
2086
|
+
try {
|
|
2087
|
+
fd = fs.openSync(file, "r");
|
|
2088
|
+
const buffer = Buffer.allocUnsafe(64 * 1024);
|
|
2089
|
+
for (;;) {
|
|
2090
|
+
const length = fs.readSync(fd, buffer, 0, buffer.length, null);
|
|
2091
|
+
if (length === 0) break;
|
|
2092
|
+
fs.writeSync(2, buffer, 0, length);
|
|
2093
|
+
}
|
|
2094
|
+
} catch {
|
|
2095
|
+
// Diagnostic replay must never replace the descriptor result.
|
|
2096
|
+
} finally {
|
|
2097
|
+
if (fd !== undefined) fs.closeSync(fd);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
function restoreEnv(
|
|
2102
|
+
key: "TTSC_NODE_BINARY" | "TTSC_TTSX_BINARY",
|
|
2103
|
+
value: string | undefined,
|
|
2104
|
+
): void {
|
|
2105
|
+
if (value === undefined) {
|
|
2106
|
+
delete process.env[key];
|
|
2107
|
+
} else {
|
|
2108
|
+
process.env[key] = value;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
function resolvePluginSource(source: string, projectRoot: string): string {
|
|
2113
|
+
return PluginPackageResolution.resolveRealPath(
|
|
2114
|
+
path.isAbsolute(source) ? source : path.resolve(projectRoot, source),
|
|
2115
|
+
);
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
/**
|
|
2119
|
+
* The directories the plugin builds of one load key their binaries on, which a
|
|
2120
|
+
* watch session observes: the module root of every plugin built as an
|
|
2121
|
+
* executable, since the build copies and keys the whole module
|
|
2122
|
+
* (`computeCacheKey`), the source of every plugin linked into a host, and every
|
|
2123
|
+
* contributor's source, which a host build keys as it is. They are the
|
|
2124
|
+
* directories the load then reports as `pluginSources`, resolved before any
|
|
2125
|
+
* build runs, and ttsc's own sources are left out of both. An executable
|
|
2126
|
+
* plugin's module also names, through its `go.mod`, every directory outside it
|
|
2127
|
+
* that it replaces a module with, which the build compiles in place
|
|
2128
|
+
* (`pluginModuleReplaceDirectories`).
|
|
2129
|
+
*/
|
|
2130
|
+
function pluginBuildDirectories(
|
|
2131
|
+
records: readonly {
|
|
2132
|
+
contributors?: readonly { source: string }[];
|
|
2133
|
+
kind: "executable" | "linked";
|
|
2134
|
+
moduleRoot: string;
|
|
2135
|
+
packageDir: string;
|
|
2136
|
+
}[],
|
|
2137
|
+
env: NodeJS.ProcessEnv,
|
|
2138
|
+
replacements?: Map<string, readonly string[]>,
|
|
2139
|
+
): string[] {
|
|
2140
|
+
const directories = new Set<string>();
|
|
2141
|
+
for (const record of records) {
|
|
2142
|
+
directories.add(
|
|
2143
|
+
path.resolve(
|
|
2144
|
+
record.kind === "linked" ? record.packageDir : record.moduleRoot,
|
|
2145
|
+
),
|
|
2146
|
+
);
|
|
2147
|
+
if (record.kind === "executable") {
|
|
2148
|
+
for (const directory of pluginReplacementWatchDirectories(
|
|
2149
|
+
record.moduleRoot, env, replacements,
|
|
2150
|
+
)) directories.add(directory);
|
|
2151
|
+
}
|
|
2152
|
+
for (const contributor of record.contributors ?? [])
|
|
2153
|
+
directories.add(path.resolve(contributor.source));
|
|
2154
|
+
}
|
|
2155
|
+
return [...directories].filter(reportsPluginSource).sort();
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
/**
|
|
2159
|
+
* Discover known external replacement interests after the module is observed.
|
|
2160
|
+
* The load shares this best-effort watch projection, not package validity or a
|
|
2161
|
+
* cross-load manifest cache. Go metadata/build admission still owns errors.
|
|
2162
|
+
*/
|
|
2163
|
+
function pluginReplacementWatchDirectories(
|
|
2164
|
+
moduleRoot: string,
|
|
2165
|
+
env: NodeJS.ProcessEnv,
|
|
2166
|
+
observed?: Map<string, readonly string[]>,
|
|
2167
|
+
): readonly string[] {
|
|
2168
|
+
const previous = observed?.get(moduleRoot);
|
|
2169
|
+
if (previous !== undefined) return previous;
|
|
2170
|
+
let directories: readonly string[];
|
|
2171
|
+
try {
|
|
2172
|
+
directories = pluginModuleReplaceDirectories(moduleRoot, env)
|
|
2173
|
+
.map((replacement) => replacement.directory);
|
|
2174
|
+
} catch {
|
|
2175
|
+
// An unreadable manifest/tool is not valid metadata. The already observed
|
|
2176
|
+
// module retains its repair path; actual proposal/build refusal propagates.
|
|
2177
|
+
directories = [];
|
|
2178
|
+
}
|
|
2179
|
+
observed?.set(moduleRoot, directories);
|
|
2180
|
+
return directories;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
/**
|
|
2184
|
+
* Whether a directory a plugin build keys on is reported, as a watch input and
|
|
2185
|
+
* among `pluginSources`. ttsc's own sources change only with ttsc, whose
|
|
2186
|
+
* version its consumer already runs; reporting them would have every consumer
|
|
2187
|
+
* read and watch the whole installed package as if it were a plugin's.
|
|
2188
|
+
*/
|
|
2189
|
+
function reportsPluginSource(directory: string): boolean {
|
|
2190
|
+
return !isPathWithin(directory, ttscPackageRoot());
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
function mergeContributors(
|
|
2194
|
+
first: readonly ITtscPluginContributor[] | undefined,
|
|
2195
|
+
second: readonly ITtscPluginContributor[] | undefined,
|
|
2196
|
+
): readonly ITtscPluginContributor[] | undefined {
|
|
2197
|
+
const out = [...(first ?? []), ...(second ?? [])];
|
|
2198
|
+
return out.length === 0 ? undefined : out;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
function ttscPackageRoot(): string {
|
|
2202
|
+
return path.resolve(__dirname, "..", "..", "..", "..");
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* Create an evaluator directory whose cleanup path cannot follow a retargeted
|
|
2207
|
+
* parent alias.
|
|
2208
|
+
*/
|
|
2209
|
+
function createEvaluationTempDir(): string {
|
|
2210
|
+
return createCanonicalTempDirectory("ttsc-plugin-descriptor-");
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
/**
|
|
2214
|
+
* Remove an evaluation temp directory without letting cleanup replace a result.
|
|
2215
|
+
*
|
|
2216
|
+
* This runs from a `finally`, so a throw here would surface instead of the
|
|
2217
|
+
* evaluation's own outcome — and on Windows a grandchild that inherited a
|
|
2218
|
+
* handle, or a scanner holding the file, can make removal fail. Leaving bytes
|
|
2219
|
+
* in the system temp directory is by far the lesser outcome.
|
|
2220
|
+
*/
|
|
2221
|
+
function removeEvaluationTempDir(directory: string): void {
|
|
2222
|
+
try {
|
|
2223
|
+
fs.rmSync(directory, { force: true, recursive: true });
|
|
2224
|
+
} catch {
|
|
2225
|
+
// Best effort.
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
/**
|
|
2230
|
+
* Delegate an owned resolver's descriptor process without changing ordinary
|
|
2231
|
+
* callers.
|
|
2232
|
+
*/
|
|
2233
|
+
function spawnOwnedDescriptor(
|
|
2234
|
+
command: string,
|
|
2235
|
+
args: readonly string[],
|
|
2236
|
+
options: childProcess.SpawnSyncOptionsWithStringEncoding,
|
|
2237
|
+
): childProcess.SpawnSyncReturns<string> {
|
|
2238
|
+
return (
|
|
2239
|
+
OwnedSynchronousProcess.launch<string>(command, args, options) ??
|
|
2240
|
+
childProcess.spawnSync(command, args, options)
|
|
2241
|
+
);
|
|
2242
|
+
}
|