ttsc 0.33.0 → 0.34.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/README.md +2 -0
- package/cmd/ttsc/api_compile.go +3 -2
- package/cmd/ttsc/api_transform.go +1 -1
- package/cmd/ttsc/build.go +5 -4
- package/cmd/ttsc-cache/account.go +16 -0
- package/cmd/ttsc-cache/account_test.go +91 -0
- package/cmd/ttsc-cache/main.go +1 -1
- package/cmd/ttsc-cache/protocol_test.go +2 -2
- package/cmd/ttsc-cache/publisher_seal_test.go +1 -1
- package/cmd/ttsc-cache/stock_go_failure_test.go +1 -1
- package/cmd/ttsc-cache/stock_go_test.go +2 -2
- package/cmd/ttsc-cache/store.go +5 -0
- package/cmd/ttsc-cache/tuple.go +6 -2
- package/cmd/ttsc-cache/tuple_test.go +1 -1
- package/cmd/ttscgraph/main.go +6 -1
- package/cmd/ttscgraph/run_help_version_and_bad_flags_exit_codes_test.go +6 -1
- package/cmd/ttscgraph/serve.go +22 -20
- package/cmd/ttscgraph/serve_alternative_members_and_reads_refresh_test.go +95 -0
- package/cmd/ttscgraph/serve_shards.go +26 -15
- package/cmd/ttscgraph/serve_shards_abandoned_generation_converges_on_retry_test.go +2 -2
- package/cmd/ttscgraph/serve_shards_delete_removed_source_test.go +3 -3
- package/cmd/ttscgraph/serve_shards_prune_unreferenced_external_endpoints_test.go +1 -1
- package/cmd/ttscgraph/serve_shards_publish_created_source_test.go +3 -3
- package/cmd/ttscgraph/serve_shards_refresh_cross_file_implementation_test.go +2 -2
- package/cmd/ttscgraph/serve_shards_refresh_dependent_diagnostics_test.go +3 -3
- package/cmd/ttscgraph/serve_shards_rename_moves_source_identity_test.go +5 -5
- package/cmd/ttscgraph/serve_shards_reuse_unaffected_sources_test.go +8 -8
- package/cmd/ttscgraph/serve_source_encoding_test.go +2 -2
- package/driver/build_information_uses_selected_output_identity_test.go +5 -4
- package/driver/check_observations.go +1 -1
- package/driver/config_discovery.go +5 -1
- package/driver/declaration_shape.go +15 -21
- package/driver/diagnostics_preamble.go +2 -2
- package/driver/emit_containment.go +11 -14
- package/driver/emit_plugin.go +51 -43
- package/driver/emit_plugin_output.go +6 -5
- package/driver/emit_provenance.go +12 -15
- package/driver/graph.go +8 -8
- package/driver/host.go +15 -5
- package/driver/input_observation.go +22 -21
- package/driver/input_observation_test.go +11 -10
- package/driver/overlay.go +11 -11
- package/driver/program.go +102 -51
- package/driver/resolution_candidates.go +50 -32
- package/driver/resolution_candidates_test.go +18 -5
- package/driver/rewrite.go +11 -13
- package/driver/session.go +13 -7
- package/driver/target_ts70.go +85 -0
- package/driver/target_ts71.go +97 -0
- package/driver/transform_dependencies.go +1 -1
- package/driver/transform_source_map.go +21 -20
- package/go.mod +3 -3
- package/go.sum +4 -4
- package/internal/graph/alternative_member_declarations_resolve_uses_test.go +145 -0
- package/internal/graph/assigned_implementations_of_declaration_file_symbols_leave_no_edge_source_test.go +2 -2
- package/internal/graph/assigned_implementations_of_node_modules_symbols_leave_no_edge_source_test.go +2 -2
- package/internal/graph/build.go +75 -33
- package/internal/graph/build_files_reuses_committed_cross_file_endpoints_test.go +4 -4
- package/internal/graph/build_records_a_node_per_top_level_declaration_test.go +1 -1
- package/internal/graph/declaration_members.go +143 -0
- package/internal/graph/decorators_capture_name_and_literal_arguments_test.go +3 -3
- package/internal/graph/doc_tags.go +2 -2
- package/internal/graph/dump_paths.go +6 -5
- package/internal/graph/duplicate_variable_object_members_keep_first_declaration_test.go +1 -1
- package/internal/graph/edges.go +151 -68
- package/internal/graph/edges_cover_class_level_references_test.go +5 -5
- package/internal/graph/enum_initializer_calls_are_edges_test.go +2 -2
- package/internal/graph/enum_members_carry_their_names_on_the_enum_node_test.go +6 -6
- package/internal/graph/exports.go +6 -6
- package/internal/graph/file_diagnostics_match_tsgo_code_and_location_test.go +2 -2
- package/internal/graph/file_diagnostics_report_code_column_and_message_test.go +1 -1
- package/internal/graph/function_locals_do_not_collide_test.go +3 -3
- package/internal/graph/heritage_edges_cover_implements_and_interface_extends_test.go +5 -5
- package/internal/graph/heritage_edges_keep_extends_and_implements_to_same_base_test.go +2 -2
- package/internal/graph/heritage_edges_record_extends_versus_implements_origin_test.go +3 -3
- package/internal/graph/heritage_edges_traverse_barrels_and_stop_at_external_leaves_test.go +3 -3
- package/internal/graph/literals.go +3 -3
- package/internal/graph/literals_are_absent_when_the_type_admits_more_than_it_can_name_test.go +2 -2
- package/internal/graph/literals_cover_enum_members_the_graph_has_no_nodes_for_test.go +4 -4
- package/internal/graph/literals_do_not_depend_on_declaration_line_wrapping_test.go +2 -2
- package/internal/graph/literals_render_every_value_in_typescript_source_form_test.go +1 -1
- package/internal/graph/literals_resolve_through_alias_indirection_test.go +3 -3
- package/internal/graph/member_relation_edges_follow_checker_validity_test.go +7 -7
- package/internal/graph/member_relation_edges_preserve_checker_boundaries_test.go +19 -19
- package/internal/graph/member_relation_edges_reject_checker_invalid_pairs_test.go +11 -11
- package/internal/graph/namespace_dotted_form_qualifies_deeply_test.go +2 -2
- package/internal/graph/namespace_members_become_qualified_nodes_and_edges_test.go +7 -7
- package/internal/graph/namespace_private_declarations_keep_lexical_identity_test.go +85 -0
- package/internal/graph/nodes_are_marked_exported_through_the_export_table_test.go +2 -2
- package/internal/graph/object_literal_declarations_resolve_calls_test.go +9 -9
- package/internal/graph/object_literal_members_ride_on_the_snapshot_test.go +1 -1
- package/internal/graph/overload_implementation_replaces_signature_test.go +2 -2
- package/internal/graph/property_member_edges_remain_owner_visible_test.go +6 -6
- package/internal/graph/resolve.go +37 -12
- package/internal/graph/resolve_unwraps_barrel_reexport_to_real_declaration_test.go +6 -6
- package/internal/graph/source.go +1 -1
- package/internal/graph/type_ref_edges_cover_typeof_as_satisfies_test.go +7 -7
- package/internal/graph/type_ref_edges_resolve_named_types_across_files_test.go +2 -2
- package/internal/graph/value_access_edges_cover_properties_test.go +5 -5
- package/internal/graph/value_call_edges_attribute_function_assignments_to_members_test.go +3 -3
- package/internal/graph/value_call_edges_cover_jsx_components_test.go +2 -2
- package/internal/graph/value_call_edges_cover_methods_and_constructors_test.go +3 -3
- package/internal/graph/value_call_edges_cover_variable_bound_callables_test.go +2 -2
- package/internal/graph/value_call_edges_do_not_double_record_invoked_member_access_test.go +4 -4
- package/internal/graph/value_call_edges_record_construct_versus_call_origin_test.go +3 -3
- package/internal/graph/value_call_edges_resolve_across_files_and_dedupe_test.go +2 -2
- package/internal/graph/value_call_edges_skip_self_and_unresolved_test.go +4 -4
- package/internal/graph/value_reads_cover_expression_positions_test.go +88 -0
- package/lib/compiler/internal/buildNativeCompiler.d.ts +5 -2
- package/lib/compiler/internal/buildNativeCompiler.js +12 -4
- package/lib/compiler/internal/buildNativeCompiler.js.map +1 -1
- package/lib/flags/COMPILER_ENUM_WHITESPACE.js +1 -1
- package/lib/flags/COMPILER_ENUM_WHITESPACE.js.map +1 -1
- package/lib/flags/COMPILER_OPTIONS.js +1079 -149
- package/lib/flags/COMPILER_OPTIONS.js.map +1 -1
- package/lib/flags/COMPILER_OPTION_ASCII_FOLDS.js +1 -1
- package/lib/flags/COMPILER_OPTION_ASCII_FOLDS.js.map +1 -1
- package/lib/flags/COMPILER_OPTION_KINDS.js +1 -1
- package/lib/flags/COMPILER_OPTION_KINDS.js.map +1 -1
- package/lib/flags/CompilerOptionSpec.d.ts +9 -2
- package/lib/internal/pluginSource.d.ts +1 -0
- package/lib/internal/pluginSource.js +1 -0
- package/lib/internal/pluginSource.js.map +1 -1
- package/lib/launcher/internal/TypeScriptSyncApi.d.ts +140 -0
- package/lib/launcher/internal/TypeScriptSyncApi.js +99 -0
- package/lib/launcher/internal/TypeScriptSyncApi.js.map +1 -0
- package/lib/launcher/internal/buildSingleRootInMemory.d.ts +80 -0
- package/lib/launcher/internal/buildSingleRootInMemory.js +253 -0
- package/lib/launcher/internal/buildSingleRootInMemory.js.map +1 -0
- package/lib/launcher/internal/buildSingleRootProject.d.ts +22 -18
- package/lib/launcher/internal/buildSingleRootProject.js +27 -18
- package/lib/launcher/internal/buildSingleRootProject.js.map +1 -1
- package/lib/launcher/internal/compilerArgsAsConfigOptions.d.ts +39 -0
- package/lib/launcher/internal/compilerArgsAsConfigOptions.js +115 -0
- package/lib/launcher/internal/compilerArgsAsConfigOptions.js.map +1 -0
- package/lib/plugin/CapabilityPluginResolver.js +3 -0
- package/lib/plugin/CapabilityPluginResolver.js.map +1 -1
- package/lib/plugin/internal/load/loadProjectPlugins.js +6 -2
- package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -1
- package/lib/plugin/internal/source/CompilerTarget.d.ts +127 -0
- package/lib/plugin/internal/source/CompilerTarget.js +231 -0
- package/lib/plugin/internal/source/CompilerTarget.js.map +1 -0
- package/lib/plugin/internal/source/NativeSourcePackages.js +6 -5
- package/lib/plugin/internal/source/NativeSourcePackages.js.map +1 -1
- package/lib/plugin/internal/source/SourcePluginAdmission.d.ts +18 -1
- package/lib/plugin/internal/source/SourcePluginAdmission.js +24 -2
- package/lib/plugin/internal/source/SourcePluginAdmission.js.map +1 -1
- package/lib/plugin/internal/source/SourcePluginWorkspace.d.ts +6 -3
- package/lib/plugin/internal/source/SourcePluginWorkspace.js +31 -13
- package/lib/plugin/internal/source/SourcePluginWorkspace.js.map +1 -1
- package/lib/plugin/internal/source/buildSourcePlugin.js +3 -1
- package/lib/plugin/internal/source/buildSourcePlugin.js.map +1 -1
- package/lib/plugin/internal/source/hashPluginBuildEnvironment.d.ts +1 -1
- package/lib/plugin/internal/source/hashPluginBuildEnvironment.js +9 -1
- package/lib/plugin/internal/source/hashPluginBuildEnvironment.js.map +1 -1
- package/package.json +14 -9
- package/shim/ast/enums_gen.go +1 -0
- package/shim/ast/go.mod +2 -2
- package/shim/ast/go.sum +4 -4
- package/shim/ast/neutral.go +141 -0
- package/shim/astnav/go.mod +2 -2
- package/shim/astnav/go.sum +4 -4
- package/shim/bundled/go.mod +2 -2
- package/shim/bundled/go.sum +4 -4
- package/shim/checker/go.mod +2 -2
- package/shim/checker/go.sum +4 -4
- package/shim/compiler/go.mod +2 -2
- package/shim/compiler/go.sum +4 -4
- package/shim/compiler/neutral.go +213 -0
- package/shim/core/go.mod +2 -2
- package/shim/core/go.sum +4 -4
- package/shim/diagnosticwriter/go.mod +2 -2
- package/shim/diagnosticwriter/go.sum +4 -4
- package/shim/lsp/go.mod +2 -2
- package/shim/lsp/go.sum +4 -4
- package/shim/parser/go.mod +2 -2
- package/shim/parser/go.sum +4 -4
- package/shim/printer/go.mod +2 -2
- package/shim/printer/go.sum +4 -4
- package/shim/scanner/go.mod +2 -2
- package/shim/scanner/go.sum +4 -4
- package/shim/stringutil/go.mod +1 -1
- package/shim/stringutil/go.sum +2 -2
- package/shim/stringutil/shim.go +15 -0
- package/shim/transformers/go.mod +2 -2
- package/shim/transformers/go.sum +4 -4
- package/shim/tsoptions/go.mod +2 -2
- package/shim/tsoptions/go.sum +4 -4
- package/shim/tsoptions/neutral.go +56 -0
- package/shim/tspath/go.mod +1 -1
- package/shim/tspath/go.sum +2 -2
- package/shim/tspath/neutral.go +150 -0
- package/shim/tspath/typed_paths.go +266 -0
- package/shim/vfs/cachedvfs/go.mod +2 -2
- package/shim/vfs/cachedvfs/go.sum +4 -4
- package/shim/vfs/go.mod +2 -2
- package/shim/vfs/go.sum +4 -4
- package/shim/vfs/neutral.go +20 -0
- package/shim/vfs/osvfs/go.mod +2 -2
- package/shim/vfs/osvfs/go.sum +4 -4
- package/src/compiler/internal/buildNativeCompiler.ts +13 -4
- package/src/flags/COMPILER_ENUM_WHITESPACE.ts +1 -1
- package/src/flags/COMPILER_OPTIONS.ts +1080 -150
- package/src/flags/COMPILER_OPTION_ASCII_FOLDS.ts +1 -1
- package/src/flags/COMPILER_OPTION_KINDS.ts +1 -1
- package/src/flags/CompilerOptionSpec.ts +11 -2
- package/src/internal/pluginSource.ts +1 -0
- package/src/launcher/internal/TypeScriptSyncApi.ts +186 -0
- package/src/launcher/internal/buildSingleRootInMemory.ts +319 -0
- package/src/launcher/internal/buildSingleRootProject.ts +26 -18
- package/src/launcher/internal/compilerArgsAsConfigOptions.ts +112 -0
- package/src/plugin/CapabilityPluginResolver.ts +4 -1
- package/src/plugin/internal/load/loadProjectPlugins.ts +12 -2
- package/src/plugin/internal/source/CompilerTarget.ts +249 -0
- package/src/plugin/internal/source/NativeSourcePackages.ts +10 -4
- package/src/plugin/internal/source/SourcePluginAdmission.ts +28 -2
- package/src/plugin/internal/source/SourcePluginWorkspace.ts +45 -19
- package/src/plugin/internal/source/buildSourcePlugin.ts +3 -1
- package/src/plugin/internal/source/hashPluginBuildEnvironment.ts +9 -1
- package/targets/7.1/bridge/ast/enums_gen.go +174 -0
- package/targets/7.1/bridge/ast/extra-shim.json +4 -0
- package/targets/7.1/bridge/ast/go.mod +14 -0
- package/targets/7.1/bridge/ast/go.sum +20 -0
- package/targets/7.1/bridge/ast/lint.go +1412 -0
- package/targets/7.1/bridge/ast/neutral.go +141 -0
- package/targets/7.1/bridge/ast/parent.go +60 -0
- package/targets/7.1/bridge/ast/safe_text.go +108 -0
- package/targets/7.1/bridge/ast/shim.go +1656 -0
- package/targets/7.1/bridge/ast/surface.go +686 -0
- package/targets/7.1/bridge/ast/test/next_jsdoc_comment_location_reaches_variable_statement_test.go +51 -0
- package/targets/7.1/bridge/ast/test/node_text_joins_multi_hop_qualified_name_test.go +47 -0
- package/targets/7.1/bridge/ast/test/node_text_joins_one_hop_qualified_name_test.go +35 -0
- package/targets/7.1/bridge/ast/test/node_text_returns_empty_for_nil_test.go +31 -0
- package/targets/7.1/bridge/ast/test/node_text_returns_identifier_text_test.go +34 -0
- package/targets/7.1/bridge/ast/test/node_text_skips_empty_qualified_left_test.go +60 -0
- package/targets/7.1/bridge/astnav/go.mod +14 -0
- package/targets/7.1/bridge/astnav/go.sum +22 -0
- package/targets/7.1/bridge/astnav/shim.go +24 -0
- package/targets/7.1/bridge/bundled/extra-shim.json +1 -0
- package/targets/7.1/bridge/bundled/go.mod +10 -0
- package/targets/7.1/bridge/bundled/go.sum +10 -0
- package/targets/7.1/bridge/bundled/shim.go +24 -0
- package/targets/7.1/bridge/checker/enums_gen.go +150 -0
- package/targets/7.1/bridge/checker/extra-shim.json +37 -0
- package/targets/7.1/bridge/checker/go.mod +15 -0
- package/targets/7.1/bridge/checker/go.sum +24 -0
- package/targets/7.1/bridge/checker/node_builder_fields_gen.go +19 -0
- package/targets/7.1/bridge/checker/shim.go +1390 -0
- package/targets/7.1/bridge/compiler/contentmapper_process.go +70 -0
- package/targets/7.1/bridge/compiler/emit_sourcemap.go +296 -0
- package/targets/7.1/bridge/compiler/emitassemble.go +81 -0
- package/targets/7.1/bridge/compiler/emithook.go +44 -0
- package/targets/7.1/bridge/compiler/extra-shim.json +4 -0
- package/targets/7.1/bridge/compiler/go.mod +15 -0
- package/targets/7.1/bridge/compiler/go.sum +24 -0
- package/targets/7.1/bridge/compiler/incremental.go +185 -0
- package/targets/7.1/bridge/compiler/neutral.go +256 -0
- package/targets/7.1/bridge/compiler/resolution.go +571 -0
- package/targets/7.1/bridge/compiler/shim.go +70 -0
- package/targets/7.1/bridge/core/enums_gen.go +15 -0
- package/targets/7.1/bridge/core/extra-shim.json +4 -0
- package/targets/7.1/bridge/core/go.mod +7 -0
- package/targets/7.1/bridge/core/go.sum +8 -0
- package/targets/7.1/bridge/core/modulekind.go +19 -0
- package/targets/7.1/bridge/core/shim.go +272 -0
- package/targets/7.1/bridge/diagnosticwriter/go.mod +14 -0
- package/targets/7.1/bridge/diagnosticwriter/go.sum +20 -0
- package/targets/7.1/bridge/diagnosticwriter/lint.go +411 -0
- package/targets/7.1/bridge/diagnosticwriter/shim.go +56 -0
- package/targets/7.1/bridge/lsp/extra-shim.json +4 -0
- package/targets/7.1/bridge/lsp/go.mod +16 -0
- package/targets/7.1/bridge/lsp/go.sum +26 -0
- package/targets/7.1/bridge/lsp/shim.go +112 -0
- package/targets/7.1/bridge/parser/extra-shim.json +4 -0
- package/targets/7.1/bridge/parser/go.mod +14 -0
- package/targets/7.1/bridge/parser/go.sum +24 -0
- package/targets/7.1/bridge/parser/shim.go +61 -0
- package/targets/7.1/bridge/printer/emithost.go +69 -0
- package/targets/7.1/bridge/printer/go.mod +15 -0
- package/targets/7.1/bridge/printer/go.sum +24 -0
- package/targets/7.1/bridge/printer/shim.go +168 -0
- package/targets/7.1/bridge/printer/sourcemap.go +49 -0
- package/targets/7.1/bridge/scanner/extra-shim.json +4 -0
- package/targets/7.1/bridge/scanner/go.mod +14 -0
- package/targets/7.1/bridge/scanner/go.sum +20 -0
- package/targets/7.1/bridge/scanner/regexp.go +42 -0
- package/targets/7.1/bridge/scanner/shim.go +137 -0
- package/targets/7.1/bridge/stringutil/extra-shim.json +1 -0
- package/targets/7.1/bridge/stringutil/go.mod +5 -0
- package/targets/7.1/bridge/stringutil/go.sum +2 -0
- package/targets/7.1/bridge/stringutil/shim.go +131 -0
- package/targets/7.1/bridge/transformers/go.mod +15 -0
- package/targets/7.1/bridge/transformers/go.sum +24 -0
- package/targets/7.1/bridge/transformers/shim.go +24 -0
- package/targets/7.1/bridge/tsoptions/command_line_raw.go +44 -0
- package/targets/7.1/bridge/tsoptions/extra-shim.json +4 -0
- package/targets/7.1/bridge/tsoptions/go.mod +15 -0
- package/targets/7.1/bridge/tsoptions/go.sum +24 -0
- package/targets/7.1/bridge/tsoptions/neutral.go +47 -0
- package/targets/7.1/bridge/tsoptions/shim.go +193 -0
- package/targets/7.1/bridge/tspath/extra-shim.json +4 -0
- package/targets/7.1/bridge/tspath/go.mod +5 -0
- package/targets/7.1/bridge/tspath/go.sum +6 -0
- package/targets/7.1/bridge/tspath/neutral.go +142 -0
- package/targets/7.1/bridge/tspath/shim.go +382 -0
- package/targets/7.1/bridge/vfs/cachedvfs/extra-shim.json +4 -0
- package/targets/7.1/bridge/vfs/cachedvfs/go.mod +5 -0
- package/targets/7.1/bridge/vfs/cachedvfs/go.sum +10 -0
- package/targets/7.1/bridge/vfs/cachedvfs/shim.go +12 -0
- package/targets/7.1/bridge/vfs/decode.go +26 -0
- package/targets/7.1/bridge/vfs/decode_test.go +42 -0
- package/targets/7.1/bridge/vfs/extra-shim.json +4 -0
- package/targets/7.1/bridge/vfs/go.mod +10 -0
- package/targets/7.1/bridge/vfs/go.sum +10 -0
- package/targets/7.1/bridge/vfs/neutral.go +23 -0
- package/targets/7.1/bridge/vfs/osvfs/extra-shim.json +4 -0
- package/targets/7.1/bridge/vfs/osvfs/go.mod +10 -0
- package/targets/7.1/bridge/vfs/osvfs/go.sum +10 -0
- package/targets/7.1/bridge/vfs/osvfs/shim.go +14 -0
- package/targets/7.1/bridge/vfs/shim.go +27 -0
- package/targets/7.1/facade/ast/facade_gen.go +2691 -0
- package/targets/7.1/facade/ast/go.mod +20 -0
- package/targets/7.1/facade/ast/go.sum +20 -0
- package/targets/7.1/facade/astnav/facade_gen.go +15 -0
- package/targets/7.1/facade/astnav/go.mod +22 -0
- package/targets/7.1/facade/astnav/go.sum +22 -0
- package/targets/7.1/facade/bundled/facade_gen.go +32 -0
- package/targets/7.1/facade/bundled/go.mod +21 -0
- package/targets/7.1/facade/bundled/go.sum +10 -0
- package/targets/7.1/facade/checker/facade_gen.go +563 -0
- package/targets/7.1/facade/checker/go.mod +26 -0
- package/targets/7.1/facade/checker/go.sum +24 -0
- package/targets/7.1/facade/compiler/facade_gen.go +198 -0
- package/targets/7.1/facade/compiler/go.mod +41 -0
- package/targets/7.1/facade/compiler/go.sum +24 -0
- package/targets/7.1/facade/core/facade_gen.go +130 -0
- package/targets/7.1/facade/core/go.mod +12 -0
- package/targets/7.1/facade/core/go.sum +8 -0
- package/targets/7.1/facade/diagnosticwriter/facade_gen.go +36 -0
- package/targets/7.1/facade/diagnosticwriter/go.mod +22 -0
- package/targets/7.1/facade/diagnosticwriter/go.sum +20 -0
- package/targets/7.1/facade/lsp/facade_gen.go +31 -0
- package/targets/7.1/facade/lsp/go.mod +19 -0
- package/targets/7.1/facade/lsp/go.sum +26 -0
- package/targets/7.1/facade/parser/facade_gen.go +102 -0
- package/targets/7.1/facade/parser/go.mod +25 -0
- package/targets/7.1/facade/parser/go.sum +24 -0
- package/targets/7.1/facade/printer/facade_gen.go +74 -0
- package/targets/7.1/facade/printer/go.mod +26 -0
- package/targets/7.1/facade/printer/go.sum +24 -0
- package/targets/7.1/facade/scanner/facade_gen.go +191 -0
- package/targets/7.1/facade/scanner/go.mod +25 -0
- package/targets/7.1/facade/scanner/go.sum +20 -0
- package/targets/7.1/facade/stringutil/facade_gen.go +176 -0
- package/targets/7.1/facade/stringutil/go.mod +9 -0
- package/targets/7.1/facade/stringutil/go.sum +2 -0
- package/targets/7.1/facade/transformers/facade_gen.go +12 -0
- package/targets/7.1/facade/transformers/go.mod +18 -0
- package/targets/7.1/facade/transformers/go.sum +24 -0
- package/targets/7.1/facade/tsoptions/facade_gen.go +274 -0
- package/targets/7.1/facade/tsoptions/go.mod +32 -0
- package/targets/7.1/facade/tsoptions/go.sum +24 -0
- package/targets/7.1/facade/tspath/facade_gen.go +550 -0
- package/targets/7.1/facade/tspath/go.mod +9 -0
- package/targets/7.1/facade/tspath/go.sum +6 -0
- package/targets/7.1/facade/vfs/cachedvfs/facade_gen.go +17 -0
- package/targets/7.1/facade/vfs/cachedvfs/go.mod +18 -0
- package/targets/7.1/facade/vfs/cachedvfs/go.sum +10 -0
- package/targets/7.1/facade/vfs/facade_gen.go +47 -0
- package/targets/7.1/facade/vfs/go.mod +18 -0
- package/targets/7.1/facade/vfs/go.sum +10 -0
- package/targets/7.1/facade/vfs/osvfs/facade_gen.go +20 -0
- package/targets/7.1/facade/vfs/osvfs/go.mod +21 -0
- package/targets/7.1/facade/vfs/osvfs/go.sum +10 -0
- package/tools/gen_facade/committed_facades_match_their_bridges_test.go +57 -0
- package/tools/gen_facade/facade_manifest_points_into_the_bridge_root_test.go +75 -0
- package/tools/gen_facade/facade_spells_internal_types_through_bridge_aliases_test.go +75 -0
- package/tools/gen_facade/facade_types_are_their_bridge_types_test.go +99 -0
- package/tools/gen_facade/go.mod +10 -0
- package/tools/gen_facade/go.sum +8 -0
- package/tools/gen_facade/main.go +734 -0
- package/tools/gen_shims/go.mod +4 -4
- package/tools/gen_shims/go.sum +6 -6
- package/tools/gen_shims/main.go +124 -66
- package/tools/gen_shims/mirror_structs_terminate_on_unexported_cycles_test.go +101 -0
- package/tools/shim_audit/baseline-7.1.json +720 -0
- package/tools/shim_audit/baseline.json +5 -4
- package/tools/shim_audit/go.mod +4 -4
- package/tools/shim_audit/go.sum +6 -6
- package/tools/shim_audit/linkname_signatures.go +178 -0
- package/tools/shim_audit/linkname_signatures_match_their_targets_test.go +64 -0
- package/tools/shim_audit/linkname_targets_follow_the_audited_compiler_test.go +38 -0
- package/tools/shim_audit/main.go +29 -4
- package/tools/shim_audit/neutral_api.go +160 -0
- package/tools/shim_audit/neutral_api_must_match_across_targets_test.go +74 -0
- package/utility/host.go +5 -4
- package/utility/preamble_output.go +15 -15
- package/utility/serve.go +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Code generated by packages/ttsc/scripts/gen-flags.mts. DO NOT EDIT.
|
|
2
|
-
// Source of truth: pinned
|
|
2
|
+
// Source of truth: pinned TypeScript 7.0 and 7.1 OptionsDeclarations and OptionsForWatch.
|
|
3
3
|
// Regenerate with: pnpm format
|
|
4
4
|
// Verify in CI with: node packages/ttsc/scripts/check-flags.cjs
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Code generated by packages/ttsc/scripts/gen-flags.mts. DO NOT EDIT.
|
|
2
|
-
// Source of truth: pinned
|
|
2
|
+
// Source of truth: pinned TypeScript 7.0 and 7.1 OptionsDeclarations and OptionsForWatch.
|
|
3
3
|
// Regenerate with: pnpm format
|
|
4
4
|
// Verify in CI with: node packages/ttsc/scripts/check-flags.cjs
|
|
5
5
|
import { COMPILER_OPTIONS } from "./COMPILER_OPTIONS";
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* configuration-only options have their own lookahead rules; non-configuration
|
|
4
4
|
* scalar options consume a following dash-prefixed token as data.
|
|
5
5
|
*
|
|
6
|
-
* @evidence contracts/common.md#principled-implementation Kind, list element and configuration-only status preserve the distinctions consumed by the pinned native parser instead of collapsing every nonboolean option into one arity.
|
|
6
|
+
* @evidence contracts/common.md#principled-implementation Kind, list element and configuration-only status preserve the distinctions consumed by the pinned native parser instead of collapsing every nonboolean option into one arity; path and command-line-only status are the declaration's own IsFilePath and IsCommandLineOnly, which decide how a command-line value moves into a tsconfig.
|
|
7
7
|
* @evidence contracts/common.md#clear-and-simple-design One immutable metadata record describes grammar; occurrence reading separately owns argv lookahead and launcher FlagSpec separately owns launcher semantics.
|
|
8
8
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts The generator obtains these fields from exported native declarations rather than help text, spelling exceptions or source-file suffix guesses.
|
|
9
|
-
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the scalar, list and configuration-only distinctions; member comments state the source
|
|
9
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the scalar, list and configuration-only distinctions; member comments state the source, optional element meaning, and which values are paths or command-line only.
|
|
10
10
|
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type declaration acquires and holds no runtime resource.
|
|
11
11
|
* @evidenceExclude contracts/performance.md#efficient-algorithms A type declaration chooses no processing strategy.
|
|
12
12
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work A type declaration computes nothing, so there is no work to share.
|
|
@@ -27,4 +27,13 @@ export interface CompilerOptionSpec {
|
|
|
27
27
|
* other kinds.
|
|
28
28
|
*/
|
|
29
29
|
readonly configOnly: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether a command-line value names a path the compiler resolves against the
|
|
33
|
+
* working directory; for a list, whether its elements do.
|
|
34
|
+
*/
|
|
35
|
+
readonly filePath: boolean;
|
|
36
|
+
|
|
37
|
+
/** Whether the compiler accepts the option only on the command line. */
|
|
38
|
+
readonly commandLineOnly: boolean;
|
|
30
39
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* the one module path such a consumer imports, so the implementation keeps one
|
|
15
15
|
* declaration per file.
|
|
16
16
|
*/
|
|
17
|
+
export * from "../plugin/internal/source/CompilerTarget";
|
|
17
18
|
export * from "../plugin/internal/source/collectPluginSourceFiles";
|
|
18
19
|
export * from "../plugin/internal/source/pluginBuildVersions";
|
|
19
20
|
export * from "../plugin/internal/source/pluginSourceCovers";
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The synchronous compiler API (`typescript/sync`) of the consuming project's
|
|
6
|
+
* own TypeScript, as far as an in-memory single-root build uses it.
|
|
7
|
+
*
|
|
8
|
+
* TypeScript 7.1 publishes the API at `typescript/sync`. It drives the same
|
|
9
|
+
* native executable the command line runs, over a pipe, and adds what the
|
|
10
|
+
* command line cannot do: a snapshot whose filesystem layer supplies files that
|
|
11
|
+
* exist only in memory, and an emit that returns its files instead of writing
|
|
12
|
+
* them. TypeScript 7.0 publishes `typescript/unstable/sync`, whose program has
|
|
13
|
+
* no emit, so a 7.0 project has no such API here.
|
|
14
|
+
*
|
|
15
|
+
* The declarations are structural: they name the members this package calls,
|
|
16
|
+
* with the shapes `typescript@7.1.0-beta` gives them, rather than importing a
|
|
17
|
+
* type ttsc's own TypeScript version does not have. `load` checks each member
|
|
18
|
+
* before returning the module.
|
|
19
|
+
*
|
|
20
|
+
* @evidence contracts/common.md#principled-implementation The module is resolved through the consumer package's own exports by its manifest name, so the API is the one that package publishes and drives the executable that package ships. Member presence is checked before use; shapes are those of the published beta. Diagnostics are gathered in the compiler's own report order.
|
|
21
|
+
* @evidence contracts/common.md#clear-and-simple-design One namespace holds the consumed API surface, its loader and the compiler's diagnostic order, apart from the build that uses them.
|
|
22
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The API is used as published; nothing in it is patched or replaced, and a package without it yields undefined rather than an emulation.
|
|
23
|
+
* @evidence contracts/common.md#meaningful-documentation The prose states which TypeScript lines publish the API, what it adds over the command line, and why the declarations are structural.
|
|
24
|
+
* @evidence contracts/portability.md#os-neutral-implementation Node's createRequire resolves the module from the package manifest's native path; no path is assembled by hand.
|
|
25
|
+
* @evidence contracts/performance.md#efficient-algorithms Loading reads one manifest and requires one module; Node's module cache serves later loads of the same package.
|
|
26
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Node's module cache shares the loaded module across builds of one process.
|
|
27
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The loaded module stays in Node's module cache for the process lifetime; sessions it creates are closed by their caller.
|
|
28
|
+
*/
|
|
29
|
+
export namespace TypeScriptSyncApi {
|
|
30
|
+
/**
|
|
31
|
+
* The loaded `typescript/sync` module.
|
|
32
|
+
*
|
|
33
|
+
* `API` starts a session whose child runs the package's native executable, or
|
|
34
|
+
* `tsserverPath` when given; the session's `close` ends it.
|
|
35
|
+
* `formatDiagnostics` renders diagnostics as the command line does without
|
|
36
|
+
* `--pretty`, with file names relative to the session's working directory.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation The members are the published 7.1 API's, typed structurally by the shapes this package calls.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design Only the two members the in-memory build reaches are declared.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The type describes the published module without wrapping or replacing it.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation The prose states what each member starts or renders and the session's ownership of its child.
|
|
42
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation A type declaration touches no filesystem, path or process.
|
|
43
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms A type declaration chooses no processing strategy.
|
|
44
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work A type declaration computes nothing.
|
|
45
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type declaration holds no resource.
|
|
46
|
+
*/
|
|
47
|
+
export interface Module {
|
|
48
|
+
API: new (options: { cwd?: string; tsserverPath?: string }) => Session;
|
|
49
|
+
formatDiagnostics: FormatDiagnostics;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Load the API of the TypeScript package whose manifest is `packageJson`.
|
|
54
|
+
*
|
|
55
|
+
* @returns The module, or `undefined` when the package publishes no `./sync`
|
|
56
|
+
* export, it cannot be loaded, or it lacks a member the build calls.
|
|
57
|
+
* @evidence contracts/common.md#principled-implementation Node resolves `<name>/sync` through the package's own exports from its manifest; each called member is checked on the loaded classes, so a package that lacks one is refused rather than failing mid-build.
|
|
58
|
+
* @evidence contracts/common.md#clear-and-simple-design Resolution, loading and member checks form one small function returning the module or undefined.
|
|
59
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Any load failure returns undefined so the caller keeps the command-line build; the version string is never consulted in place of the members.
|
|
60
|
+
* @evidence contracts/common.md#meaningful-documentation The returns tag names each case that yields undefined.
|
|
61
|
+
* @evidence contracts/portability.md#os-neutral-implementation createRequire takes the manifest's native path and Node's resolver handles the platform's path rules.
|
|
62
|
+
* @evidence contracts/performance.md#efficient-algorithms One manifest read and one require; later requires of the same module come from Node's cache.
|
|
63
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Node's module cache shares the module across calls; a failed resolution is retried per call, costing one export lookup.
|
|
64
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Node's module cache retains a loaded module for the process lifetime; nothing else is retained.
|
|
65
|
+
*/
|
|
66
|
+
export function load(packageJson: string): Module | undefined {
|
|
67
|
+
try {
|
|
68
|
+
const { name } = JSON.parse(fs.readFileSync(packageJson, "utf8")) as {
|
|
69
|
+
name?: unknown;
|
|
70
|
+
};
|
|
71
|
+
if (typeof name !== "string") return undefined;
|
|
72
|
+
const loaded = createRequire(packageJson)(`${name}/sync`) as Record<
|
|
73
|
+
string,
|
|
74
|
+
unknown
|
|
75
|
+
>;
|
|
76
|
+
const { API, Program, formatDiagnostics } = loaded;
|
|
77
|
+
if (
|
|
78
|
+
typeof API !== "function" ||
|
|
79
|
+
typeof Program !== "function" ||
|
|
80
|
+
typeof formatDiagnostics !== "function" ||
|
|
81
|
+
!["createSnapshot", "parseCommandLine", "close"].every(
|
|
82
|
+
(member) => member in API.prototype,
|
|
83
|
+
) ||
|
|
84
|
+
!("emitToString" in Program.prototype)
|
|
85
|
+
)
|
|
86
|
+
return undefined;
|
|
87
|
+
return loaded as unknown as Module;
|
|
88
|
+
} catch {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The diagnostics the command line reports for a program, in its order
|
|
95
|
+
* (`GetDiagnosticsOfAnyProgram`): configuration and syntax; then options and
|
|
96
|
+
* global diagnostics when syntax found none; then semantic diagnostics, and
|
|
97
|
+
* the global ones checking found, when those found none either.
|
|
98
|
+
*
|
|
99
|
+
* @evidence contracts/common.md#principled-implementation Mirrors TypeScript-Go's GetDiagnosticsOfAnyProgram: each later group is gathered only while no diagnostic beyond the configuration ones precedes it, and global diagnostics are asked again after checking. Declaration diagnostics are left out because the single-root build emits no declarations.
|
|
100
|
+
* @evidence contracts/common.md#clear-and-simple-design One function holds the report order the in-memory build needs for its check and failure messages.
|
|
101
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Every group comes from the compiler's own program; none is filtered or reworded.
|
|
102
|
+
* @evidence contracts/common.md#meaningful-documentation The prose gives the order and the condition for each later group.
|
|
103
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The function exchanges diagnostics with the compiler session and touches no filesystem path itself.
|
|
104
|
+
* @evidence contracts/performance.md#efficient-algorithms At most six requests to the session; semantic checking runs only when syntax, options and global diagnostics are clean, as on the command line.
|
|
105
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each call reads one program's diagnostics once; the caller asks once per build.
|
|
106
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The returned array holds the diagnostics until the caller discards it; the session owns everything else.
|
|
107
|
+
*/
|
|
108
|
+
export function reportedDiagnostics(program: Program): Diagnostic[] {
|
|
109
|
+
const reported = [...program.getConfigFileParsingDiagnostics()];
|
|
110
|
+
const configured = reported.length;
|
|
111
|
+
reported.push(...program.getSyntacticDiagnostics());
|
|
112
|
+
if (reported.length !== configured) return reported;
|
|
113
|
+
reported.push(
|
|
114
|
+
...program.getProgramDiagnostics(),
|
|
115
|
+
...program.getGlobalDiagnostics(),
|
|
116
|
+
);
|
|
117
|
+
if (reported.length !== configured) return reported;
|
|
118
|
+
reported.push(
|
|
119
|
+
...program.getSemanticDiagnostics(),
|
|
120
|
+
...program.getGlobalDiagnostics(),
|
|
121
|
+
);
|
|
122
|
+
return reported;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Renders diagnostics, with file names relative to the host's directory. */
|
|
127
|
+
type FormatDiagnostics = (
|
|
128
|
+
diagnostics: readonly Diagnostic[],
|
|
129
|
+
host: Session,
|
|
130
|
+
) => string;
|
|
131
|
+
|
|
132
|
+
/** One API session. */
|
|
133
|
+
interface Session {
|
|
134
|
+
/** Parses argv with the session compiler's own command-line parser. */
|
|
135
|
+
parseCommandLine(args: readonly string[]): {
|
|
136
|
+
readonly errors: readonly Diagnostic[];
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Opens projects in a new snapshot. A `layer` filesystem supplies files that
|
|
141
|
+
* take precedence over the disk.
|
|
142
|
+
*/
|
|
143
|
+
createSnapshot(params: {
|
|
144
|
+
openProjects: readonly string[];
|
|
145
|
+
fileSystem: { kind: "layer"; files: Record<string, string> };
|
|
146
|
+
}): Snapshot;
|
|
147
|
+
|
|
148
|
+
/** Ends the session's child process. */
|
|
149
|
+
close(): void;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** A snapshot of opened projects. */
|
|
153
|
+
interface Snapshot {
|
|
154
|
+
getConfiguredProject(configFileName: string): { id: unknown } | undefined;
|
|
155
|
+
getProgram(projectId: unknown): Program | undefined;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** The program of one opened project. */
|
|
159
|
+
interface Program {
|
|
160
|
+
getConfigFileParsingDiagnostics(): readonly Diagnostic[];
|
|
161
|
+
getProgramDiagnostics(): readonly Diagnostic[];
|
|
162
|
+
getGlobalDiagnostics(): readonly Diagnostic[];
|
|
163
|
+
getSyntacticDiagnostics(): readonly Diagnostic[];
|
|
164
|
+
getSemanticDiagnostics(): readonly Diagnostic[];
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Emits every file of the program the way the build would, returning the
|
|
168
|
+
* files instead of writing them. `sourceFileName` names the source an output
|
|
169
|
+
* was emitted from.
|
|
170
|
+
*/
|
|
171
|
+
emitToString(): {
|
|
172
|
+
readonly emitSkipped: boolean;
|
|
173
|
+
readonly diagnostics?: readonly Diagnostic[];
|
|
174
|
+
readonly outputFiles: Iterable<
|
|
175
|
+
readonly [
|
|
176
|
+
fileName: string,
|
|
177
|
+
file: { readonly text: string; readonly sourceFileName?: string },
|
|
178
|
+
]
|
|
179
|
+
>;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** A compiler diagnostic, opaque except for rendering. */
|
|
184
|
+
interface Diagnostic {
|
|
185
|
+
readonly code: number;
|
|
186
|
+
}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import { BuildExecution } from "../../compiler/internal/build/BuildExecution";
|
|
5
|
+
import { PassthroughFlags } from "../../compiler/internal/build/PassthroughFlags";
|
|
6
|
+
import type { RunBuildOptions } from "../../compiler/internal/build/RunBuildOptions";
|
|
7
|
+
import { TsgoArguments } from "../../compiler/internal/build/TsgoArguments";
|
|
8
|
+
import { readProjectConfig } from "../../compiler/internal/project/readProjectConfig";
|
|
9
|
+
import { readEffectiveCompilerOptions } from "../../compiler/internal/readEffectiveCompilerOptions";
|
|
10
|
+
import { resolveTsgo } from "../../compiler/internal/resolveTsgo";
|
|
11
|
+
import { SidecarEnvironment } from "../../compiler/internal/sharedHost/SidecarEnvironment";
|
|
12
|
+
import { readCompilerOptionValues } from "../../flags/readCompilerOptionValues";
|
|
13
|
+
import { hasProjectPluginEntries } from "../../plugin/internal/load/hasProjectPluginEntries";
|
|
14
|
+
import type { TtscCommonOptions } from "../../structures/internal/TtscCommonOptions";
|
|
15
|
+
import { TypeScriptSyncApi } from "./TypeScriptSyncApi";
|
|
16
|
+
import { compilerArgsAsConfigOptions } from "./compilerArgsAsConfigOptions";
|
|
17
|
+
import { DependencyBuildGeneration } from "./runtime/DependencyBuildGeneration";
|
|
18
|
+
import { runtimeCompilerArgs } from "./runtimeCompilerArgs";
|
|
19
|
+
import { runtimeEmitProfile } from "./runtimeEmitProfile";
|
|
20
|
+
import { singleRootProjectConfig } from "./singleRootProjectConfig";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Compile one root outside its project's file set through the consuming
|
|
24
|
+
* TypeScript's own API, with the single-root tsconfig held in memory, or report
|
|
25
|
+
* that this build cannot take that route.
|
|
26
|
+
*
|
|
27
|
+
* `buildSingleRootProject` compiles such a root through a tsconfig that extends
|
|
28
|
+
* the project and lists only the root. On the command line that tsconfig has to
|
|
29
|
+
* exist on disk, beside the project's own when a checked build needs its
|
|
30
|
+
* directory-relative lookups. TypeScript 7.1's `typescript/sync` API opens a
|
|
31
|
+
* project from a snapshot whose filesystem layer holds the tsconfig instead,
|
|
32
|
+
* and its emit returns the files rather than writing them. So here the tsconfig
|
|
33
|
+
* always sits, in memory, beside the project's own: `${configDir}`, the default
|
|
34
|
+
* `typeRoots` and every `types` entry resolve exactly as the user's config sees
|
|
35
|
+
* them, and nothing is created in the user's tree.
|
|
36
|
+
*
|
|
37
|
+
* The compiler options are the command-line build's. The arguments that build
|
|
38
|
+
* would pass after `-p` (`TsgoArguments.createTsgoBuildArgs` over the same run
|
|
39
|
+
* options) are written into the in-memory tsconfig's `compilerOptions` by
|
|
40
|
+
* `compilerArgsAsConfigOptions`, which keeps their precedence over the project.
|
|
41
|
+
* The session compiler's own command-line parser must accept them first, so an
|
|
42
|
+
* invalid argument still gets the command line's diagnostic. Outputs are
|
|
43
|
+
* written into `emitDir` only; one the options would place elsewhere is not
|
|
44
|
+
* written at all, as the command-line build's isolation keeps it inside. Each
|
|
45
|
+
* JavaScript output's source is the one the compiler emitted it from.
|
|
46
|
+
*
|
|
47
|
+
* The route is unavailable, and the caller keeps the command-line build, when
|
|
48
|
+
* the project's TypeScript publishes no such API (7.0), when a compiler binary
|
|
49
|
+
* other than that TypeScript's own or a compiler environment is selected (the
|
|
50
|
+
* binary ttsx hands its runtime is the one it resolved, so a root the running
|
|
51
|
+
* program reaches is admitted like an entry), when the build would run native
|
|
52
|
+
* plugins (they run inside ttsc's own host, which reads its tsconfig from
|
|
53
|
+
* disk), or when its arguments cannot be carried by a tsconfig: a response
|
|
54
|
+
* file, a terminal flag, or another command-line-only argument.
|
|
55
|
+
*
|
|
56
|
+
* The returned `project` is the owning project's parse. The in-memory tsconfig
|
|
57
|
+
* changes only the file set, the output layout and declaration emission, so its
|
|
58
|
+
* module options are the project's.
|
|
59
|
+
*
|
|
60
|
+
* @returns The build, or `undefined` when this route is unavailable.
|
|
61
|
+
* @throws When the build fails, with the messages of the command-line build: a
|
|
62
|
+
* checked build fails on any diagnostic, an emit-only build only when it
|
|
63
|
+
* produced no JavaScript.
|
|
64
|
+
* @evidence contracts/common.md#principled-implementation The command-line build's own argument composition supplies the options, translated into the extending config's compilerOptions where they keep command-line precedence, and validated by the consumer compiler's parseCommandLine. Diagnostics are gathered in the native report order (GetDiagnosticsOfAnyProgram: config and syntactic, then options and global, then semantic and the global diagnostics checking found, each later group only when no diagnostic beyond the config ones precedes), and the emit is the consumer compiler's own. Premise: a layer-filesystem config is parsed like one on disk at the same path, verified against typescript@7.1.0-beta and the 7.1 nightly the E2E lane installs.
|
|
65
|
+
* @evidence contracts/common.md#clear-and-simple-design Admission, option translation, the API session and output writing are each one step of this function, with translation and the API surface in their own modules; the caller keeps the command-line route for every refusal.
|
|
66
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Every unsupported build class returns undefined to the existing command-line route instead of an approximation; no consumer or fixture is special-cased and the compiler is used through its published API.
|
|
67
|
+
* @evidence contracts/common.md#meaningful-documentation The prose explains the in-memory placement, option equivalence, output isolation, provenance, every refusal class and the meaning of the returned project.
|
|
68
|
+
* @evidence contracts/portability.md#os-neutral-implementation Output names from the API are resolved with node:path before writing, and sources are recorded by their native real path, the spelling the command-line provenance records.
|
|
69
|
+
* @evidence contracts/performance.md#efficient-algorithms The compiler package is resolved and its API loaded first, so a 7.0 project costs one package resolution and a failed export lookup before the command-line build. An admitted build then makes one project parse, one execution resolution without plugin loading, one API session with one snapshot, one diagnostic pass when checked and one emit; an emit-only build gathers diagnostics only to explain a failure.
|
|
70
|
+
* @evidence contracts/performance.md#reuse-equivalent-work The project parse serves plugin admission, the runtime options and the execution context; the session's parse of the arguments precedes the single snapshot.
|
|
71
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The API session is closed in finally on success and failure: close destroys its pipes and signals the child to terminate without waiting for its exit, and the API kills a child still alive when the process exits. Emitted text is held until written; the caller owns emitDir.
|
|
72
|
+
*/
|
|
73
|
+
export function buildSingleRootInMemory(props: {
|
|
74
|
+
/** The root, in the physical spelling the runtime loads it by. */
|
|
75
|
+
source: string;
|
|
76
|
+
|
|
77
|
+
/** The owning `tsconfig.json`, whose options the root inherits. */
|
|
78
|
+
tsconfig: string;
|
|
79
|
+
|
|
80
|
+
/** Directory the build runs in. */
|
|
81
|
+
projectRoot: string;
|
|
82
|
+
|
|
83
|
+
/** Directory-safe token naming the in-memory tsconfig. */
|
|
84
|
+
key: string;
|
|
85
|
+
|
|
86
|
+
/** Where the JavaScript goes. The directory must be private to this build. */
|
|
87
|
+
emitDir: string;
|
|
88
|
+
|
|
89
|
+
/** Whether diagnostics stop the build. */
|
|
90
|
+
checked: boolean;
|
|
91
|
+
|
|
92
|
+
/** Names the root in a failure. */
|
|
93
|
+
role: "entry" | "root";
|
|
94
|
+
|
|
95
|
+
/** Root of the source's volume, the in-memory tsconfig's `rootDir`. */
|
|
96
|
+
volumeRoot: string;
|
|
97
|
+
|
|
98
|
+
/** Build options of the caller. */
|
|
99
|
+
options: TtscCommonOptions & { cacheDir?: string };
|
|
100
|
+
}):
|
|
101
|
+
| {
|
|
102
|
+
project: ReturnType<typeof readProjectConfig>;
|
|
103
|
+
rootDir: string;
|
|
104
|
+
emittedSources: Record<string, readonly string[]>;
|
|
105
|
+
emittedSourceProofFailures?: Record<string, string>;
|
|
106
|
+
}
|
|
107
|
+
| undefined {
|
|
108
|
+
const options = props.options;
|
|
109
|
+
if (
|
|
110
|
+
readCompilerOptionValues(options.passthrough).responseFiles.length !== 0 ||
|
|
111
|
+
(options.env !== undefined && Object.keys(options.env).length !== 0)
|
|
112
|
+
)
|
|
113
|
+
return undefined;
|
|
114
|
+
// Checked first: a 7.0 project, the common case, then costs one package
|
|
115
|
+
// resolution before the command-line build. The package is resolved past any
|
|
116
|
+
// selected binary, so the selection can be compared with it.
|
|
117
|
+
const packageEnv = SidecarEnvironment.merge(process.env);
|
|
118
|
+
SidecarEnvironment.write(packageEnv, "TTSC_TSGO_BINARY", undefined);
|
|
119
|
+
let compiler: ReturnType<typeof resolveTsgo>;
|
|
120
|
+
try {
|
|
121
|
+
compiler = resolveTsgo({
|
|
122
|
+
cwd: path.dirname(props.tsconfig),
|
|
123
|
+
env: packageEnv,
|
|
124
|
+
});
|
|
125
|
+
} catch {
|
|
126
|
+
// The command-line build reports a missing compiler in its own words.
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
// ttsx hands its runtime the compiler it resolved as `TTSC_TSGO_BINARY`, so
|
|
130
|
+
// only a selection naming another binary is a custom compiler.
|
|
131
|
+
const selected =
|
|
132
|
+
options.binary ?? SidecarEnvironment.read(process.env, "TTSC_TSGO_BINARY");
|
|
133
|
+
if (selected && !sameFile(selected, compiler.binary)) return undefined;
|
|
134
|
+
const api = TypeScriptSyncApi.load(compiler.packageJson);
|
|
135
|
+
if (api === undefined) return undefined;
|
|
136
|
+
const project = readProjectConfig({
|
|
137
|
+
cwd: props.projectRoot,
|
|
138
|
+
projectRoot: options.projectRoot,
|
|
139
|
+
tsconfig: props.tsconfig,
|
|
140
|
+
});
|
|
141
|
+
if (
|
|
142
|
+
hasProjectPluginEntries(project, options.plugins, options.pluginConfigDir)
|
|
143
|
+
)
|
|
144
|
+
return undefined;
|
|
145
|
+
const effectiveOptions = readEffectiveCompilerOptions(
|
|
146
|
+
project,
|
|
147
|
+
options.passthrough,
|
|
148
|
+
undefined,
|
|
149
|
+
process.env,
|
|
150
|
+
);
|
|
151
|
+
const runOptions: RunBuildOptions = {
|
|
152
|
+
checkers: options.checkers,
|
|
153
|
+
cwd: props.projectRoot,
|
|
154
|
+
emit: true,
|
|
155
|
+
outDir: props.emitDir,
|
|
156
|
+
isolateOutputsTo: props.emitDir,
|
|
157
|
+
passthrough: runtimeCompilerArgs(
|
|
158
|
+
project,
|
|
159
|
+
options.passthrough,
|
|
160
|
+
undefined,
|
|
161
|
+
effectiveOptions,
|
|
162
|
+
),
|
|
163
|
+
forceRuntimeSourceMap: runtimeEmitProfile(
|
|
164
|
+
project,
|
|
165
|
+
options.passthrough,
|
|
166
|
+
undefined,
|
|
167
|
+
effectiveOptions,
|
|
168
|
+
).forceRuntimeSourceMap,
|
|
169
|
+
plugins: options.plugins,
|
|
170
|
+
pluginConfigDir: options.pluginConfigDir,
|
|
171
|
+
projectRoot: options.projectRoot,
|
|
172
|
+
quiet: true,
|
|
173
|
+
resolvedProject: project,
|
|
174
|
+
singleThreaded: options.singleThreaded,
|
|
175
|
+
skipDiagnosticsCheck: !props.checked,
|
|
176
|
+
tsconfig: props.tsconfig,
|
|
177
|
+
};
|
|
178
|
+
const execution = BuildExecution.resolveExecutionContext(runOptions);
|
|
179
|
+
if (
|
|
180
|
+
execution.compilerSelection.inspectionError !== undefined ||
|
|
181
|
+
execution.pluginSetupFailure !== undefined ||
|
|
182
|
+
execution.nativePlugins.length !== 0 ||
|
|
183
|
+
!sameFile(execution.tsgo.binary, compiler.binary)
|
|
184
|
+
)
|
|
185
|
+
return undefined;
|
|
186
|
+
const buildOptions = BuildExecution.applyProjectNoEmit(runOptions, execution);
|
|
187
|
+
if (PassthroughFlags.forwardsTerminalTsgoFlag(buildOptions)) return undefined;
|
|
188
|
+
const args = TsgoArguments.createTsgoBuildArgs(execution, buildOptions, {
|
|
189
|
+
listEmittedFiles: false,
|
|
190
|
+
noEmitOnError: props.checked,
|
|
191
|
+
});
|
|
192
|
+
if (args[0] !== "-p" || args[1] !== execution.tsconfig) return undefined;
|
|
193
|
+
const assigned = compilerArgsAsConfigOptions(args.slice(2), execution.cwd);
|
|
194
|
+
if (assigned === undefined) return undefined;
|
|
195
|
+
|
|
196
|
+
const config = singleRootProjectConfig({
|
|
197
|
+
tsconfig: props.tsconfig,
|
|
198
|
+
source: props.source,
|
|
199
|
+
volumeRoot: props.volumeRoot,
|
|
200
|
+
checked: props.checked,
|
|
201
|
+
});
|
|
202
|
+
const configFile = path.join(
|
|
203
|
+
path.dirname(props.tsconfig),
|
|
204
|
+
`.ttsx-${props.role}.${props.key}.tsconfig.json`,
|
|
205
|
+
);
|
|
206
|
+
const session = new api.API({
|
|
207
|
+
cwd: execution.cwd,
|
|
208
|
+
tsserverPath: execution.tsgo.binary,
|
|
209
|
+
});
|
|
210
|
+
try {
|
|
211
|
+
if (session.parseCommandLine(args.slice(2)).errors.length !== 0)
|
|
212
|
+
return undefined;
|
|
213
|
+
const snapshot = session.createSnapshot({
|
|
214
|
+
openProjects: [configFile],
|
|
215
|
+
fileSystem: {
|
|
216
|
+
kind: "layer",
|
|
217
|
+
files: {
|
|
218
|
+
[configFile]: JSON.stringify({
|
|
219
|
+
...config,
|
|
220
|
+
compilerOptions: { ...config.compilerOptions, ...assigned },
|
|
221
|
+
}),
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
const opened = snapshot.getConfiguredProject(configFile);
|
|
226
|
+
const program =
|
|
227
|
+
opened === undefined ? undefined : snapshot.getProgram(opened.id);
|
|
228
|
+
if (program === undefined)
|
|
229
|
+
throw new Error(
|
|
230
|
+
`ttsx: TypeScript did not open the ${props.role} project for ${props.source}`,
|
|
231
|
+
);
|
|
232
|
+
const failure = (
|
|
233
|
+
summary: string,
|
|
234
|
+
diagnostics: Parameters<TypeScriptSyncApi.Module["formatDiagnostics"]>[0],
|
|
235
|
+
): Error =>
|
|
236
|
+
new Error(
|
|
237
|
+
[summary, api.formatDiagnostics(diagnostics, session)]
|
|
238
|
+
.filter((line) => line.trim().length !== 0)
|
|
239
|
+
.join("\n"),
|
|
240
|
+
);
|
|
241
|
+
const checkFailure = `ttsx: ${props.role} check failed for ${props.source}`;
|
|
242
|
+
if (props.checked) {
|
|
243
|
+
const diagnostics = TypeScriptSyncApi.reportedDiagnostics(program);
|
|
244
|
+
if (diagnostics.length !== 0) throw failure(checkFailure, diagnostics);
|
|
245
|
+
}
|
|
246
|
+
const emitted = program.emitToString();
|
|
247
|
+
if (props.checked && (emitted.diagnostics?.length ?? 0) !== 0)
|
|
248
|
+
throw failure(checkFailure, emitted.diagnostics!);
|
|
249
|
+
const emitDir = path.resolve(props.emitDir);
|
|
250
|
+
const emittedSources: Record<string, readonly string[]> =
|
|
251
|
+
Object.create(null);
|
|
252
|
+
const emittedSourceProofFailures: Record<string, string> =
|
|
253
|
+
Object.create(null);
|
|
254
|
+
fs.mkdirSync(emitDir, { recursive: true });
|
|
255
|
+
for (const [fileName, file] of emitted.outputFiles) {
|
|
256
|
+
const output = path.resolve(fileName);
|
|
257
|
+
const relative = path.relative(emitDir, output);
|
|
258
|
+
if (
|
|
259
|
+
relative === "" ||
|
|
260
|
+
relative.startsWith("..") ||
|
|
261
|
+
path.isAbsolute(relative)
|
|
262
|
+
)
|
|
263
|
+
continue;
|
|
264
|
+
fs.mkdirSync(path.dirname(output), { recursive: true });
|
|
265
|
+
fs.writeFileSync(output, file.text);
|
|
266
|
+
if (!/\.(?:js|jsx|mjs|cjs)$/i.test(output)) continue;
|
|
267
|
+
const owner = physicalSource(file.sourceFileName);
|
|
268
|
+
if (owner !== undefined) emittedSources[output] = [owner];
|
|
269
|
+
else {
|
|
270
|
+
emittedSources[output] = [];
|
|
271
|
+
emittedSourceProofFailures[output] =
|
|
272
|
+
file.sourceFileName === undefined
|
|
273
|
+
? "TypeScript reported no source for this output."
|
|
274
|
+
: `The source TypeScript emitted this output from no longer resolves: ${JSON.stringify(file.sourceFileName)}.`;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (!props.checked && !DependencyBuildGeneration.emittedAnything(emitDir))
|
|
278
|
+
throw failure(
|
|
279
|
+
`ttsx: ${props.role} build produced no output for ${props.source}`,
|
|
280
|
+
TypeScriptSyncApi.reportedDiagnostics(program),
|
|
281
|
+
);
|
|
282
|
+
return {
|
|
283
|
+
project,
|
|
284
|
+
rootDir:
|
|
285
|
+
typeof assigned.rootDir === "string"
|
|
286
|
+
? assigned.rootDir
|
|
287
|
+
: props.volumeRoot,
|
|
288
|
+
emittedSources,
|
|
289
|
+
emittedSourceProofFailures:
|
|
290
|
+
Object.keys(emittedSourceProofFailures).length === 0
|
|
291
|
+
? undefined
|
|
292
|
+
: emittedSourceProofFailures,
|
|
293
|
+
};
|
|
294
|
+
} finally {
|
|
295
|
+
session.close();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Whether two paths name the same existing file. */
|
|
300
|
+
function sameFile(left: string, right: string): boolean {
|
|
301
|
+
try {
|
|
302
|
+
return (
|
|
303
|
+
fs.realpathSync.native(path.resolve(left)) ===
|
|
304
|
+
fs.realpathSync.native(path.resolve(right))
|
|
305
|
+
);
|
|
306
|
+
} catch {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** The native real path of an emitted output's source, if it still exists. */
|
|
312
|
+
function physicalSource(fileName: string | undefined): string | undefined {
|
|
313
|
+
if (fileName === undefined) return undefined;
|
|
314
|
+
try {
|
|
315
|
+
return fs.realpathSync.native(path.resolve(fileName));
|
|
316
|
+
} catch {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
@@ -8,6 +8,7 @@ import { SidecarEnvironment } from "../../compiler/internal/sharedHost/SidecarEn
|
|
|
8
8
|
import { createFilesystemPathIdentityContext } from "../../internal/pathIdentity/createFilesystemPathIdentityContext";
|
|
9
9
|
import type { TtscBuildResult } from "../../structures/internal/TtscBuildResult";
|
|
10
10
|
import type { TtscCommonOptions } from "../../structures/internal/TtscCommonOptions";
|
|
11
|
+
import { buildSingleRootInMemory } from "./buildSingleRootInMemory";
|
|
11
12
|
import { DependencyBuildGeneration } from "./runtime/DependencyBuildGeneration";
|
|
12
13
|
import { runtimeCompilerArgs } from "./runtimeCompilerArgs";
|
|
13
14
|
import { runtimeEmitProfile } from "./runtimeEmitProfile";
|
|
@@ -35,20 +36,24 @@ import { singleRootProjectConfig } from "./singleRootProjectConfig";
|
|
|
35
36
|
* there. A checked build needs all of them exactly as the user's config sees
|
|
36
37
|
* them, so its tsconfig is written beside the real one, and a directory that
|
|
37
38
|
* refuses the write is reported by name. TypeScript-Go's command line cannot
|
|
38
|
-
* combine a project with a file list,
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
39
|
+
* combine a project with a file list, so no other placement is faithful for it.
|
|
40
|
+
* TypeScript 7.1's API can hold that tsconfig in memory, beside the real one,
|
|
41
|
+
* without creating a file: `buildSingleRootInMemory` takes the build first, and
|
|
42
|
+
* everything below runs only when that route is unavailable: for a TypeScript
|
|
43
|
+
* 7.0 project, native plugins, a custom compiler, or arguments a tsconfig
|
|
44
|
+
* cannot carry. An emit-only build ignores diagnostics, and none of those
|
|
45
|
+
* lookups changes what it emits, with one exception: `${configDir}` inside
|
|
46
|
+
* `paths` or `baseUrl` decides which module an import resolves to, and so
|
|
47
|
+
* whether a re-exported name is elided as a type. Unless its config chain uses
|
|
48
|
+
* `${configDir}`, an emit-only build's tsconfig is written beside `emitDir`
|
|
49
|
+
* instead, because such a build runs while the program is running, for an
|
|
50
|
+
* installed package whose directory may be read-only or for a plugin descriptor
|
|
51
|
+
* whose inputs are fingerprinted by their directory's metadata, and a file
|
|
52
|
+
* created and removed in the user's tree would disturb both. The overlay is
|
|
53
|
+
* created exclusively: an occupied name is refused without writing or removing
|
|
54
|
+
* that entry. After acquisition, closing its descriptor and removing the
|
|
55
|
+
* overlay are attempted on success or failure; native cleanup failures may
|
|
56
|
+
* leave the overlay behind.
|
|
52
57
|
*
|
|
53
58
|
* `rootDir` is the root of the source's volume. The layout of this emit is
|
|
54
59
|
* private, so `rootDir` decides nothing here but whether a file of the program
|
|
@@ -76,12 +81,12 @@ import { singleRootProjectConfig } from "./singleRootProjectConfig";
|
|
|
76
81
|
* synthesized from maps.
|
|
77
82
|
* @throws When the build fails. A checked build fails on any diagnostic; an
|
|
78
83
|
* emit-only build fails only when it produced no JavaScript at all.
|
|
79
|
-
* @evidence contracts/common.md#principled-implementation
|
|
80
|
-
* @evidence contracts/common.md#clear-and-simple-design This boundary owns single-root overlay construction and cleanup, delegates project parsing/building, and isolates writable-directory diagnostics in a private helper.
|
|
84
|
+
* @evidence contracts/common.md#principled-implementation The in-memory API route is tried first and owns its own admission; otherwise a transient extends overlay changes only roots and runtime output constraints, while preserving configDir-sensitive anchors; effective rootDir is returned for output ownership rather than inferred from emitted filenames.
|
|
85
|
+
* @evidence contracts/common.md#clear-and-simple-design This boundary selects the in-memory route when it is available and otherwise owns single-root overlay construction and cleanup, delegates project parsing/building, and isolates writable-directory diagnostics in a private helper.
|
|
81
86
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts Private emit layout, disabled declaration/composite products and checked versus installed-package diagnostics are runtime contract distinctions, not source patches or tests-only compiler modes.
|
|
82
|
-
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain overlay placement, wide rootDir, diagnostics and cleanup, while separately documented input members preserve their ownership facts.
|
|
87
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain the in-memory route and when it is unavailable, overlay placement, wide rootDir, diagnostics and cleanup, while separately documented input members preserve their ownership facts.
|
|
83
88
|
* @evidence contracts/portability.md#os-neutral-implementation Shared filesystem identity selects the source volume from resolved native identity when available and retained spelling otherwise; overlay JSON converts only native separators, preserving literal POSIX backslashes. Public exclusive creation refuses an occupied overlay name without overwriting it; explicit compiler paths avoid shell interpolation and blanket case folding.
|
|
84
|
-
* @evidence contracts/performance.md#efficient-algorithms Emit-only placement parses the config chain and scans its text for configDir anchors; checked placement skips that scan. Native identity resolution, overlay serialization/write, effective-options preparation and delegated compilation contribute path/input/output byte costs; this boundary performs no source-directory mirror or second whole-project compilation.
|
|
89
|
+
* @evidence contracts/performance.md#efficient-algorithms An admitted in-memory build replaces every step below with its own single API session; a refused one adds its admission (a project parse and an execution resolution without plugin loading) before them. Emit-only placement parses the config chain and scans its text for configDir anchors; checked placement skips that scan. Native identity resolution, overlay serialization/write, effective-options preparation and delegated compilation contribute path/input/output byte costs; this boundary performs no source-directory mirror or second whole-project compilation.
|
|
85
90
|
* @evidence contracts/performance.md#reuse-equivalent-work One effective-options reader for this overlay and exact forwarded tokens is shared by runtime lowering, emit classification and rootDir selection, avoiding duplicate response-file compiler queries. Callers own sharing of completed build generations.
|
|
86
91
|
* @evidence contracts/performance.md#bound-retention-and-release-resources Exclusive open establishes ownership of one transient tsconfig and descriptor. The descriptor is closed before parsing; finally attempts any remaining close and removal after write, close, parse or build failure, without removing a failed-acquisition entry. Native cleanup failures may retain the overlay; caller owns emit storage and delegated build lifetimes.
|
|
87
92
|
*/
|
|
@@ -139,6 +144,8 @@ export function buildSingleRootProject(props: {
|
|
|
139
144
|
throwOnRealpathError: false,
|
|
140
145
|
}).resolve(props.source).path,
|
|
141
146
|
).root;
|
|
147
|
+
const inMemory = buildSingleRootInMemory({ ...props, options, volumeRoot });
|
|
148
|
+
if (inMemory !== undefined) return inMemory;
|
|
142
149
|
const beside =
|
|
143
150
|
props.checked ||
|
|
144
151
|
readProjectConfig({ tsconfig: props.tsconfig }).configPaths.some((file) =>
|
|
@@ -300,6 +307,7 @@ function unwritableConfigDirectory(
|
|
|
300
307
|
`ttsx: cannot compile ${props.source} with the options of ${props.tsconfig}: ${directory} is not writable (${code}).`,
|
|
301
308
|
"The file is outside that project's file set, and ttsx compiles it through a temporary tsconfig placed beside the project's own for the length of the build.",
|
|
302
309
|
`Make the directory writable, or add the file to the project's "include" or "files".`,
|
|
310
|
+
"With TypeScript 7.1 or later, a build without native plugins, a custom compiler or a response file compiles it in memory instead.",
|
|
303
311
|
].join("\n"),
|
|
304
312
|
);
|
|
305
313
|
}
|