@angular/compiler-cli 13.0.0-next.9 → 13.0.0-rc.3
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/bundles/index.js +20413 -0
- package/bundles/index.js.map +6 -0
- package/bundles/linker/babel/index.js +2384 -0
- package/bundles/linker/babel/index.js.map +6 -0
- package/bundles/linker/index.js +1849 -0
- package/bundles/linker/index.js.map +6 -0
- package/bundles/ngcc/index.js +16038 -0
- package/bundles/ngcc/index.js.map +6 -0
- package/bundles/ngcc/main-ngcc.js +16126 -0
- package/bundles/ngcc/main-ngcc.js.map +6 -0
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +13850 -0
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +6 -0
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +334 -0
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +6 -0
- package/bundles/private/bazel.js +97 -0
- package/bundles/private/bazel.js.map +6 -0
- package/bundles/private/localize.js +911 -0
- package/bundles/private/localize.js.map +6 -0
- package/bundles/private/migrations.js +2183 -0
- package/bundles/private/migrations.js.map +6 -0
- package/bundles/private/tooling.js +942 -0
- package/bundles/private/tooling.js.map +6 -0
- package/bundles/src/bin/ng_xi18n.js +20463 -0
- package/bundles/src/bin/ng_xi18n.js.map +6 -0
- package/bundles/src/bin/ngc.js +20465 -0
- package/bundles/src/bin/ngc.js.map +6 -0
- package/bundles_metadata.json +1 -0
- package/import_meta_url.d.ts +14 -0
- package/index.d.ts +4 -1
- package/linker/babel/src/ast/babel_ast_factory.d.ts +1 -8
- package/linker/babel/src/ast/babel_ast_host.d.ts +1 -1
- package/linker/babel/src/babel_core.d.ts +36 -0
- package/linker/babel/src/babel_declaration_scope.d.ts +1 -1
- package/linker/babel/src/babel_plugin.d.ts +1 -8
- package/linker/babel/src/es2015_linker_plugin.d.ts +2 -2
- package/linker/src/ast/typescript/typescript_ast_host.d.ts +1 -1
- package/linker/src/file_linker/emit_scopes/emit_scope.d.ts +1 -2
- package/linker/src/file_linker/emit_scopes/iife_emit_scope.d.ts +1 -1
- package/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/partial_component_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/partial_factory_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/partial_injector_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/partial_linker.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/partial_linker_selector.d.ts +2 -2
- package/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -2
- package/ngcc/index.d.ts +15 -0
- package/ngcc/src/analysis/decoration_analyzer.d.ts +1 -1
- package/ngcc/src/analysis/module_with_providers_analyzer.d.ts +1 -1
- package/ngcc/src/analysis/ngcc_references_registry.d.ts +1 -1
- package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +1 -1
- package/ngcc/src/analysis/private_declarations_analyzer.d.ts +1 -1
- package/ngcc/src/analysis/switch_marker_analyzer.d.ts +1 -1
- package/ngcc/src/analysis/types.d.ts +1 -1
- package/ngcc/src/dependencies/esm_dependency_host.d.ts +1 -1
- package/ngcc/src/execution/cluster/api.d.ts +5 -1
- package/ngcc/src/execution/cluster/master.d.ts +5 -3
- package/{src/ngtsc/logging/testing/index.d.ts → ngcc/src/execution/cluster/ngcc_cluster_worker.d.ts} +2 -2
- package/ngcc/src/host/commonjs_host.d.ts +1 -1
- package/ngcc/src/host/commonjs_umd_utils.d.ts +1 -1
- package/ngcc/src/host/delegating_host.d.ts +1 -1
- package/ngcc/src/host/esm2015_host.d.ts +1 -1
- package/ngcc/src/host/esm5_host.d.ts +1 -1
- package/ngcc/src/host/ngcc_host.d.ts +1 -1
- package/ngcc/src/host/umd_host.d.ts +1 -1
- package/ngcc/src/host/utils.d.ts +1 -1
- package/ngcc/src/locking/lock_file.d.ts +1 -1
- package/ngcc/src/locking/lock_file_with_child_process/index.d.ts +2 -0
- package/ngcc/src/locking/lock_file_with_child_process/{unlocker.d.ts → ngcc_lock_unlocker.d.ts} +1 -1
- package/ngcc/src/migrations/migration.d.ts +1 -1
- package/ngcc/src/migrations/missing_injectable_migration.d.ts +1 -1
- package/ngcc/src/migrations/undecorated_child_migration.d.ts +1 -1
- package/ngcc/src/migrations/undecorated_parent_migration.d.ts +1 -1
- package/ngcc/src/migrations/utils.d.ts +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/ngcc/src/packages/bundle_program.d.ts +1 -1
- package/ngcc/src/packages/entry_point_bundle.d.ts +1 -1
- package/ngcc/src/packages/ngcc_compiler_host.d.ts +1 -1
- package/ngcc/src/packages/source_file_cache.d.ts +1 -1
- package/ngcc/src/packages/transformer.d.ts +1 -1
- package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +1 -1
- package/ngcc/src/rendering/dts_renderer.d.ts +1 -1
- package/ngcc/src/rendering/esm5_rendering_formatter.d.ts +1 -1
- package/ngcc/src/rendering/esm_rendering_formatter.d.ts +1 -1
- package/ngcc/src/rendering/renderer.d.ts +1 -1
- package/ngcc/src/rendering/rendering_formatter.d.ts +1 -1
- package/ngcc/src/rendering/source_maps.d.ts +3 -3
- package/ngcc/src/rendering/umd_rendering_formatter.d.ts +1 -1
- package/ngcc/src/rendering/utils.d.ts +1 -1
- package/ngcc/src/utils.d.ts +1 -1
- package/package.json +52 -13
- package/private/bazel.d.ts +13 -0
- package/private/localize.d.ts +15 -0
- package/private/migrations.d.ts +16 -0
- package/{src → private}/tooling.d.ts +2 -2
- package/src/bin/ng_xi18n.d.ts +10 -0
- package/{ngcc/main-ivy-ngcc.d.ts → src/bin/ngc.d.ts} +2 -1
- package/src/diagnostics/translate_diagnostics.d.ts +1 -1
- package/src/extract_i18n.d.ts +0 -5
- package/src/main.d.ts +9 -6
- package/src/metadata/bundle_index_host.d.ts +1 -1
- package/src/metadata/bundler.d.ts +1 -1
- package/src/metadata/collector.d.ts +1 -1
- package/src/metadata/evaluator.d.ts +1 -1
- package/src/metadata/symbols.d.ts +1 -1
- package/src/ngtsc/annotations/src/component.d.ts +1 -1
- package/src/ngtsc/annotations/src/diagnostics.d.ts +1 -1
- package/src/ngtsc/annotations/src/directive.d.ts +1 -1
- package/src/ngtsc/annotations/src/ng_module.d.ts +2 -3
- package/src/ngtsc/annotations/src/pipe.d.ts +1 -1
- package/src/ngtsc/annotations/src/util.d.ts +2 -4
- package/src/ngtsc/core/api/src/adapter.d.ts +1 -1
- package/src/ngtsc/core/api/src/interfaces.d.ts +1 -1
- package/src/ngtsc/core/api/src/options.d.ts +1 -1
- package/src/ngtsc/core/api/src/public_options.d.ts +5 -1
- package/src/ngtsc/core/src/compiler.d.ts +1 -1
- package/src/ngtsc/core/src/host.d.ts +1 -1
- package/src/ngtsc/cycles/src/analyzer.d.ts +1 -1
- package/src/ngtsc/cycles/src/imports.d.ts +1 -1
- package/src/ngtsc/diagnostics/index.d.ts +4 -2
- package/src/ngtsc/diagnostics/src/docs.d.ts +14 -0
- package/src/ngtsc/diagnostics/src/error.d.ts +1 -1
- package/src/ngtsc/diagnostics/src/error_details_base_url.d.ts +16 -0
- package/src/ngtsc/diagnostics/src/util.d.ts +2 -0
- package/src/ngtsc/entry_point/src/generator.d.ts +1 -1
- package/src/ngtsc/entry_point/src/private_export_checker.d.ts +1 -1
- package/src/ngtsc/file_system/src/compiler_host.d.ts +1 -1
- package/src/ngtsc/file_system/src/logical.d.ts +1 -1
- package/src/ngtsc/file_system/src/util.d.ts +1 -1
- package/src/ngtsc/imports/src/alias.d.ts +1 -1
- package/src/ngtsc/imports/src/default.d.ts +1 -1
- package/src/ngtsc/imports/src/emitter.d.ts +1 -1
- package/src/ngtsc/imports/src/find_export.d.ts +1 -1
- package/src/ngtsc/imports/src/references.d.ts +1 -1
- package/src/ngtsc/imports/src/resolver.d.ts +1 -1
- package/src/ngtsc/incremental/api.d.ts +1 -1
- package/src/ngtsc/incremental/src/dependency_tracking.d.ts +1 -1
- package/src/ngtsc/incremental/src/incremental.d.ts +1 -1
- package/src/ngtsc/incremental/src/state.d.ts +1 -1
- package/src/ngtsc/incremental/src/strategy.d.ts +1 -1
- package/src/ngtsc/metadata/src/api.d.ts +1 -1
- package/src/ngtsc/metadata/src/dts.d.ts +1 -1
- package/src/ngtsc/metadata/src/resource_registry.d.ts +1 -1
- package/src/ngtsc/metadata/src/util.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/index.d.ts +1 -0
- package/src/ngtsc/partial_evaluator/src/builtin.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/src/diagnostics.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/src/dynamic.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/src/interface.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/src/interpreter.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/src/result.d.ts +1 -1
- package/src/ngtsc/partial_evaluator/src/ts_helpers.d.ts +1 -1
- package/src/ngtsc/program.d.ts +1 -1
- package/src/ngtsc/program_driver/src/api.d.ts +1 -1
- package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +1 -1
- package/src/ngtsc/reflection/src/host.d.ts +1 -1
- package/src/ngtsc/reflection/src/type_to_value.d.ts +1 -1
- package/src/ngtsc/reflection/src/typescript.d.ts +1 -1
- package/src/ngtsc/reflection/src/util.d.ts +1 -1
- package/src/ngtsc/resource/src/loader.d.ts +1 -1
- package/src/ngtsc/scope/src/local.d.ts +1 -1
- package/src/ngtsc/scope/src/typecheck.d.ts +1 -1
- package/src/ngtsc/shims/api.d.ts +1 -1
- package/src/ngtsc/shims/src/adapter.d.ts +1 -1
- package/src/ngtsc/shims/src/expando.d.ts +1 -1
- package/src/ngtsc/shims/src/factory_generator.d.ts +1 -1
- package/src/ngtsc/shims/src/reference_tagger.d.ts +1 -1
- package/src/ngtsc/shims/src/summary_generator.d.ts +1 -1
- package/src/ngtsc/switch/src/switch.d.ts +1 -1
- package/src/ngtsc/transform/src/alias.d.ts +1 -1
- package/src/ngtsc/transform/src/api.d.ts +1 -1
- package/src/ngtsc/transform/src/compilation.d.ts +1 -1
- package/src/ngtsc/transform/src/declaration.d.ts +1 -1
- package/src/ngtsc/transform/src/trait.d.ts +1 -1
- package/src/ngtsc/transform/src/transform.d.ts +1 -1
- package/src/ngtsc/transform/src/utils.d.ts +1 -1
- package/src/ngtsc/translator/src/import_manager.d.ts +1 -1
- package/src/ngtsc/translator/src/type_translator.d.ts +1 -1
- package/src/ngtsc/translator/src/typescript_ast_factory.d.ts +1 -1
- package/src/ngtsc/translator/src/typescript_translator.d.ts +1 -1
- package/src/ngtsc/tsc_plugin.d.ts +1 -1
- package/src/ngtsc/typecheck/api/api.d.ts +1 -1
- package/src/ngtsc/typecheck/api/checker.d.ts +3 -4
- package/src/ngtsc/typecheck/api/context.d.ts +1 -1
- package/src/ngtsc/typecheck/api/scope.d.ts +1 -1
- package/src/ngtsc/typecheck/api/symbols.d.ts +1 -1
- package/src/ngtsc/typecheck/diagnostics/src/diagnostic.d.ts +1 -1
- package/src/ngtsc/typecheck/extended/api/api.d.ts +1 -1
- package/src/ngtsc/typecheck/extended/api/extended_template_checker.d.ts +1 -1
- package/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.d.ts +1 -1
- package/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.d.ts +1 -1
- package/src/ngtsc/typecheck/extended/src/extended_template_checker.d.ts +1 -1
- package/src/ngtsc/typecheck/src/checker.d.ts +3 -4
- package/src/ngtsc/typecheck/src/comments.d.ts +1 -1
- package/src/ngtsc/typecheck/src/completion.d.ts +3 -5
- package/src/ngtsc/typecheck/src/context.d.ts +1 -1
- package/src/ngtsc/typecheck/src/diagnostics.d.ts +1 -1
- package/src/ngtsc/typecheck/src/environment.d.ts +1 -1
- package/src/ngtsc/typecheck/src/expression.d.ts +1 -1
- package/src/ngtsc/typecheck/src/oob.d.ts +3 -4
- package/src/ngtsc/typecheck/src/shim.d.ts +1 -1
- package/src/ngtsc/typecheck/src/source.d.ts +1 -1
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +1 -1
- package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +1 -1
- package/src/ngtsc/typecheck/src/ts_util.d.ts +1 -1
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +1 -1
- package/src/ngtsc/typecheck/src/type_check_file.d.ts +1 -1
- package/src/ngtsc/typecheck/src/type_constructor.d.ts +1 -1
- package/src/ngtsc/typecheck/src/type_emitter.d.ts +1 -1
- package/src/ngtsc/typecheck/src/type_parameter_emitter.d.ts +1 -1
- package/src/ngtsc/util/src/typescript.d.ts +1 -1
- package/src/ngtsc/util/src/visitor.d.ts +1 -1
- package/src/perform_compile.d.ts +1 -2
- package/src/perform_watch.d.ts +1 -1
- package/src/transformers/api.d.ts +1 -1
- package/src/transformers/compiler_host.d.ts +1 -1
- package/src/transformers/{downlevel_decorators_transform.d.ts → downlevel_decorators_transform/downlevel_decorators_transform.d.ts} +3 -3
- package/src/transformers/downlevel_decorators_transform/index.d.ts +9 -0
- package/src/transformers/{patch_alias_reference_resolution.d.ts → downlevel_decorators_transform/patch_alias_reference_resolution.d.ts} +2 -2
- package/src/transformers/i18n.d.ts +1 -1
- package/src/transformers/inline_resources.d.ts +1 -1
- package/src/transformers/lower_expressions.d.ts +1 -1
- package/src/transformers/metadata_cache.d.ts +1 -1
- package/src/transformers/node_emitter.d.ts +1 -1
- package/src/transformers/node_emitter_transform.d.ts +1 -1
- package/src/transformers/program.d.ts +1 -1
- package/src/transformers/r3_metadata_transform.d.ts +1 -1
- package/src/transformers/r3_transform.d.ts +1 -1
- package/src/transformers/util.d.ts +1 -1
- package/index.js +0 -40
- package/linker/babel/index.js +0 -25
- package/linker/babel/src/ast/babel_ast_factory.js +0 -153
- package/linker/babel/src/ast/babel_ast_host.js +0 -181
- package/linker/babel/src/babel_declaration_scope.js +0 -67
- package/linker/babel/src/babel_plugin.js +0 -38
- package/linker/babel/src/es2015_linker_plugin.js +0 -183
- package/linker/babel/src/linker_plugin_options.js +0 -13
- package/linker/index.js +0 -27
- package/linker/src/ast/ast_host.js +0 -20
- package/linker/src/ast/ast_value.js +0 -299
- package/linker/src/ast/typescript/typescript_ast_host.js +0 -183
- package/linker/src/ast/utils.js +0 -31
- package/linker/src/fatal_linker_error.js +0 -49
- package/linker/src/file_linker/declaration_scope.js +0 -20
- package/linker/src/file_linker/emit_scopes/emit_scope.js +0 -57
- package/linker/src/file_linker/emit_scopes/iife_emit_scope.js +0 -51
- package/linker/src/file_linker/file_linker.js +0 -97
- package/linker/src/file_linker/get_source_file.js +0 -42
- package/linker/src/file_linker/linker_environment.js +0 -38
- package/linker/src/file_linker/linker_options.js +0 -29
- package/linker/src/file_linker/needs_linking.js +0 -41
- package/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.js +0 -47
- package/linker/src/file_linker/partial_linkers/partial_component_linker_1.js +0 -210
- package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.js +0 -154
- package/linker/src/file_linker/partial_linkers/partial_factory_linker_1.js +0 -70
- package/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.js +0 -74
- package/linker/src/file_linker/partial_linkers/partial_injector_linker_1.js +0 -56
- package/linker/src/file_linker/partial_linkers/partial_linker.js +0 -13
- package/linker/src/file_linker/partial_linkers/partial_linker_selector.js +0 -194
- package/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.js +0 -126
- package/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.js +0 -59
- package/linker/src/file_linker/partial_linkers/util.js +0 -95
- package/linker/src/file_linker/translator.js +0 -40
- package/linker/src/linker_import_generator.js +0 -43
- package/ngcc/index.js +0 -33
- package/ngcc/main-ivy-ngcc.js +0 -12
- package/ngcc/main-ngcc.js +0 -54
- package/ngcc/src/analysis/decoration_analyzer.js +0 -268
- package/ngcc/src/analysis/migration_host.js +0 -108
- package/ngcc/src/analysis/module_with_providers_analyzer.js +0 -197
- package/ngcc/src/analysis/ngcc_references_registry.js +0 -65
- package/ngcc/src/analysis/ngcc_trait_compiler.js +0 -117
- package/ngcc/src/analysis/private_declarations_analyzer.js +0 -63
- package/ngcc/src/analysis/switch_marker_analyzer.js +0 -50
- package/ngcc/src/analysis/types.js +0 -15
- package/ngcc/src/analysis/util.js +0 -36
- package/ngcc/src/command_line_options.js +0 -156
- package/ngcc/src/constants.js +0 -23
- package/ngcc/src/dependencies/commonjs_dependency_host.js +0 -129
- package/ngcc/src/dependencies/dependency_host.js +0 -143
- package/ngcc/src/dependencies/dependency_resolver.js +0 -180
- package/ngcc/src/dependencies/dts_dependency_host.js +0 -35
- package/ngcc/src/dependencies/esm_dependency_host.js +0 -307
- package/ngcc/src/dependencies/module_resolver.js +0 -269
- package/ngcc/src/dependencies/umd_dependency_host.js +0 -53
- package/ngcc/src/entry_point_finder/directory_walker_entry_point_finder.js +0 -70
- package/ngcc/src/entry_point_finder/entry_point_collector.js +0 -157
- package/ngcc/src/entry_point_finder/interface.js +0 -13
- package/ngcc/src/entry_point_finder/program_based_entry_point_finder.js +0 -132
- package/ngcc/src/entry_point_finder/targeted_entry_point_finder.js +0 -268
- package/ngcc/src/entry_point_finder/tracing_entry_point_finder.js +0 -78
- package/ngcc/src/entry_point_finder/utils.js +0 -234
- package/ngcc/src/execution/analyze_entry_points.js +0 -197
- package/ngcc/src/execution/api.js +0 -13
- package/ngcc/src/execution/cluster/api.js +0 -20
- package/ngcc/src/execution/cluster/executor.js +0 -52
- package/ngcc/src/execution/cluster/master.js +0 -311
- package/ngcc/src/execution/cluster/package_json_updater.js +0 -79
- package/ngcc/src/execution/cluster/utils.js +0 -77
- package/ngcc/src/execution/cluster/worker.js +0 -123
- package/ngcc/src/execution/create_compile_function.js +0 -76
- package/ngcc/src/execution/single_process_executor.js +0 -91
- package/ngcc/src/execution/tasks/api.js +0 -35
- package/ngcc/src/execution/tasks/completion.js +0 -79
- package/ngcc/src/execution/tasks/queues/base_task_queue.js +0 -120
- package/ngcc/src/execution/tasks/queues/parallel_task_queue.js +0 -87
- package/ngcc/src/execution/tasks/queues/serial_task_queue.js +0 -49
- package/ngcc/src/execution/tasks/utils.js +0 -167
- package/ngcc/src/host/commonjs_host.js +0 -261
- package/ngcc/src/host/commonjs_umd_utils.js +0 -210
- package/ngcc/src/host/delegating_host.js +0 -156
- package/ngcc/src/host/esm2015_host.js +0 -2441
- package/ngcc/src/host/esm5_host.js +0 -745
- package/ngcc/src/host/ngcc_host.js +0 -29
- package/ngcc/src/host/umd_host.js +0 -539
- package/ngcc/src/host/utils.js +0 -26
- package/ngcc/src/locking/async_locker.js +0 -121
- package/ngcc/src/locking/lock_file.js +0 -18
- package/ngcc/src/locking/lock_file_with_child_process/index.js +0 -93
- package/ngcc/src/locking/lock_file_with_child_process/unlocker.js +0 -46
- package/ngcc/src/locking/lock_file_with_child_process/util.js +0 -43
- package/ngcc/src/locking/sync_locker.js +0 -67
- package/ngcc/src/main.js +0 -163
- package/ngcc/src/migrations/migration.js +0 -13
- package/ngcc/src/migrations/missing_injectable_migration.js +0 -227
- package/ngcc/src/migrations/undecorated_child_migration.js +0 -90
- package/ngcc/src/migrations/undecorated_parent_migration.js +0 -103
- package/ngcc/src/migrations/utils.js +0 -137
- package/ngcc/src/ngcc_options.js +0 -135
- package/ngcc/src/packages/build_marker.js +0 -124
- package/ngcc/src/packages/bundle_program.js +0 -80
- package/ngcc/src/packages/configuration.js +0 -334
- package/ngcc/src/packages/entry_point.js +0 -267
- package/ngcc/src/packages/entry_point_bundle.js +0 -96
- package/ngcc/src/packages/entry_point_manifest.js +0 -207
- package/ngcc/src/packages/ngcc_compiler_host.js +0 -101
- package/ngcc/src/packages/patch_ts_expando_initializer.js +0 -174
- package/ngcc/src/packages/source_file_cache.js +0 -207
- package/ngcc/src/packages/transformer.js +0 -157
- package/ngcc/src/path_mappings.js +0 -27
- package/ngcc/src/rendering/commonjs_rendering_formatter.js +0 -106
- package/ngcc/src/rendering/dts_renderer.js +0 -170
- package/ngcc/src/rendering/esm5_rendering_formatter.js +0 -70
- package/ngcc/src/rendering/esm_rendering_formatter.js +0 -291
- package/ngcc/src/rendering/ngcc_import_rewriter.js +0 -49
- package/ngcc/src/rendering/renderer.js +0 -204
- package/ngcc/src/rendering/rendering_formatter.js +0 -15
- package/ngcc/src/rendering/source_maps.js +0 -68
- package/ngcc/src/rendering/umd_rendering_formatter.js +0 -326
- package/ngcc/src/rendering/utils.js +0 -35
- package/ngcc/src/utils.js +0 -182
- package/ngcc/src/writing/cleaning/cleaning_strategies.js +0 -80
- package/ngcc/src/writing/cleaning/package_cleaner.js +0 -126
- package/ngcc/src/writing/cleaning/utils.js +0 -30
- package/ngcc/src/writing/file_writer.js +0 -13
- package/ngcc/src/writing/in_place_file_writer.js +0 -90
- package/ngcc/src/writing/new_entry_point_file_writer.js +0 -214
- package/ngcc/src/writing/package_json_updater.js +0 -182
- package/src/diagnostics/translate_diagnostics.js +0 -61
- package/src/diagnostics/typescript_version.js +0 -96
- package/src/extract_i18n.js +0 -62
- package/src/language_services.js +0 -34
- package/src/main.js +0 -210
- package/src/metadata/bundle_index_host.js +0 -133
- package/src/metadata/bundler.js +0 -624
- package/src/metadata/collector.js +0 -799
- package/src/metadata/evaluator.js +0 -677
- package/src/metadata/index.js +0 -24
- package/src/metadata/index_writer.js +0 -80
- package/src/metadata/schema.js +0 -136
- package/src/metadata/symbols.js +0 -149
- package/src/ngtsc/annotations/index.js +0 -35
- package/src/ngtsc/annotations/src/api.js +0 -20
- package/src/ngtsc/annotations/src/component.js +0 -1338
- package/src/ngtsc/annotations/src/diagnostics.js +0 -174
- package/src/ngtsc/annotations/src/directive.js +0 -724
- package/src/ngtsc/annotations/src/factory.js +0 -32
- package/src/ngtsc/annotations/src/injectable.js +0 -284
- package/src/ngtsc/annotations/src/metadata.js +0 -160
- package/src/ngtsc/annotations/src/ng_module.js +0 -671
- package/src/ngtsc/annotations/src/pipe.js +0 -171
- package/src/ngtsc/annotations/src/references_registry.js +0 -38
- package/src/ngtsc/annotations/src/util.js +0 -566
- package/src/ngtsc/core/api/index.js +0 -25
- package/src/ngtsc/core/api/src/adapter.js +0 -20
- package/src/ngtsc/core/api/src/interfaces.js +0 -20
- package/src/ngtsc/core/api/src/options.js +0 -20
- package/src/ngtsc/core/api/src/public_options.js +0 -20
- package/src/ngtsc/core/index.js +0 -25
- package/src/ngtsc/core/src/compiler.js +0 -1105
- package/src/ngtsc/core/src/host.js +0 -273
- package/src/ngtsc/cycles/index.js +0 -26
- package/src/ngtsc/cycles/src/analyzer.js +0 -163
- package/src/ngtsc/cycles/src/imports.js +0 -175
- package/src/ngtsc/diagnostics/index.js +0 -33
- package/src/ngtsc/diagnostics/src/error.js +0 -69
- package/src/ngtsc/diagnostics/src/error_code.js +0 -235
- package/src/ngtsc/diagnostics/src/util.js +0 -35
- package/src/ngtsc/entry_point/index.js +0 -29
- package/src/ngtsc/entry_point/src/generator.js +0 -45
- package/src/ngtsc/entry_point/src/logic.js +0 -61
- package/src/ngtsc/entry_point/src/private_export_checker.js +0 -137
- package/src/ngtsc/entry_point/src/reference_graph.js +0 -91
- package/src/ngtsc/file_system/index.js +0 -45
- package/src/ngtsc/file_system/src/compiler_host.js +0 -80
- package/src/ngtsc/file_system/src/helpers.js +0 -135
- package/src/ngtsc/file_system/src/invalid_file_system.js +0 -120
- package/src/ngtsc/file_system/src/logical.js +0 -100
- package/src/ngtsc/file_system/src/node_js_file_system.js +0 -179
- package/src/ngtsc/file_system/src/types.js +0 -20
- package/src/ngtsc/file_system/src/util.js +0 -38
- package/src/ngtsc/file_system/testing/index.d.ts +0 -13
- package/src/ngtsc/file_system/testing/index.js +0 -32
- package/src/ngtsc/file_system/testing/src/mock_file_system.d.ts +0 -72
- package/src/ngtsc/file_system/testing/src/mock_file_system.js +0 -333
- package/src/ngtsc/file_system/testing/src/mock_file_system_native.d.ts +0 -16
- package/src/ngtsc/file_system/testing/src/mock_file_system_native.js +0 -85
- package/src/ngtsc/file_system/testing/src/mock_file_system_posix.d.ts +0 -13
- package/src/ngtsc/file_system/testing/src/mock_file_system_posix.js +0 -68
- package/src/ngtsc/file_system/testing/src/mock_file_system_windows.d.ts +0 -13
- package/src/ngtsc/file_system/testing/src/mock_file_system_windows.js +0 -68
- package/src/ngtsc/file_system/testing/src/test_helper.d.ts +0 -17
- package/src/ngtsc/file_system/testing/src/test_helper.js +0 -143
- package/src/ngtsc/imports/index.js +0 -43
- package/src/ngtsc/imports/src/alias.js +0 -158
- package/src/ngtsc/imports/src/core.js +0 -98
- package/src/ngtsc/imports/src/default.js +0 -153
- package/src/ngtsc/imports/src/emitter.js +0 -317
- package/src/ngtsc/imports/src/find_export.js +0 -82
- package/src/ngtsc/imports/src/reexport.js +0 -20
- package/src/ngtsc/imports/src/references.js +0 -171
- package/src/ngtsc/imports/src/resolver.js +0 -39
- package/src/ngtsc/incremental/api.js +0 -20
- package/src/ngtsc/incremental/index.js +0 -29
- package/src/ngtsc/incremental/semantic_graph/index.js +0 -34
- package/src/ngtsc/incremental/semantic_graph/src/api.js +0 -51
- package/src/ngtsc/incremental/semantic_graph/src/graph.js +0 -302
- package/src/ngtsc/incremental/semantic_graph/src/type_parameters.js +0 -55
- package/src/ngtsc/incremental/semantic_graph/src/util.js +0 -111
- package/src/ngtsc/incremental/src/dependency_tracking.js +0 -165
- package/src/ngtsc/incremental/src/incremental.js +0 -393
- package/src/ngtsc/incremental/src/noop.js +0 -26
- package/src/ngtsc/incremental/src/state.js +0 -30
- package/src/ngtsc/incremental/src/strategy.js +0 -99
- package/src/ngtsc/indexer/index.js +0 -27
- package/src/ngtsc/indexer/src/api.js +0 -45
- package/src/ngtsc/indexer/src/context.js +0 -40
- package/src/ngtsc/indexer/src/template.js +0 -324
- package/src/ngtsc/indexer/src/transform.js +0 -66
- package/src/ngtsc/logging/index.js +0 -25
- package/src/ngtsc/logging/src/console_logger.js +0 -75
- package/src/ngtsc/logging/src/logger.js +0 -28
- package/src/ngtsc/logging/testing/index.js +0 -23
- package/src/ngtsc/logging/testing/src/mock_logger.d.ts +0 -20
- package/src/ngtsc/logging/testing/src/mock_logger.js +0 -64
- package/src/ngtsc/metadata/index.js +0 -39
- package/src/ngtsc/metadata/src/api.js +0 -26
- package/src/ngtsc/metadata/src/dts.js +0 -168
- package/src/ngtsc/metadata/src/inheritance.js +0 -122
- package/src/ngtsc/metadata/src/property_mapping.js +0 -244
- package/src/ngtsc/metadata/src/registry.js +0 -133
- package/src/ngtsc/metadata/src/resource_registry.js +0 -109
- package/src/ngtsc/metadata/src/util.js +0 -275
- package/src/ngtsc/partial_evaluator/index.js +0 -31
- package/src/ngtsc/partial_evaluator/src/builtin.js +0 -125
- package/src/ngtsc/partial_evaluator/src/diagnostics.js +0 -193
- package/src/ngtsc/partial_evaluator/src/dynamic.js +0 -109
- package/src/ngtsc/partial_evaluator/src/interface.js +0 -42
- package/src/ngtsc/partial_evaluator/src/interpreter.js +0 -780
- package/src/ngtsc/partial_evaluator/src/known_declaration.js +0 -57
- package/src/ngtsc/partial_evaluator/src/result.js +0 -72
- package/src/ngtsc/partial_evaluator/src/ts_helpers.js +0 -121
- package/src/ngtsc/perf/index.js +0 -28
- package/src/ngtsc/perf/src/api.js +0 -291
- package/src/ngtsc/perf/src/clock.js +0 -31
- package/src/ngtsc/perf/src/noop.js +0 -37
- package/src/ngtsc/perf/src/recorder.js +0 -143
- package/src/ngtsc/program.js +0 -360
- package/src/ngtsc/program_driver/index.js +0 -25
- package/src/ngtsc/program_driver/src/api.js +0 -36
- package/src/ngtsc/program_driver/src/ts_create_program_driver.js +0 -200
- package/src/ngtsc/reflection/index.js +0 -36
- package/src/ngtsc/reflection/src/host.js +0 -88
- package/src/ngtsc/reflection/src/type_to_value.js +0 -259
- package/src/ngtsc/reflection/src/typescript.js +0 -640
- package/src/ngtsc/reflection/src/util.js +0 -37
- package/src/ngtsc/resource/index.js +0 -23
- package/src/ngtsc/resource/src/loader.js +0 -285
- package/src/ngtsc/scope/index.js +0 -29
- package/src/ngtsc/scope/src/api.js +0 -20
- package/src/ngtsc/scope/src/component_scope.js +0 -69
- package/src/ngtsc/scope/src/dependency.js +0 -201
- package/src/ngtsc/scope/src/local.js +0 -665
- package/src/ngtsc/scope/src/typecheck.js +0 -120
- package/src/ngtsc/shims/api.js +0 -13
- package/src/ngtsc/shims/index.js +0 -39
- package/src/ngtsc/shims/src/adapter.js +0 -266
- package/src/ngtsc/shims/src/expando.js +0 -147
- package/src/ngtsc/shims/src/factory_generator.js +0 -292
- package/src/ngtsc/shims/src/reference_tagger.js +0 -94
- package/src/ngtsc/shims/src/summary_generator.js +0 -101
- package/src/ngtsc/shims/src/util.js +0 -41
- package/src/ngtsc/sourcemaps/index.js +0 -27
- package/src/ngtsc/sourcemaps/src/content_origin.js +0 -48
- package/src/ngtsc/sourcemaps/src/raw_source_map.js +0 -13
- package/src/ngtsc/sourcemaps/src/segment_marker.js +0 -55
- package/src/ngtsc/sourcemaps/src/source_file.js +0 -519
- package/src/ngtsc/sourcemaps/src/source_file_loader.js +0 -234
- package/src/ngtsc/switch/index.js +0 -23
- package/src/ngtsc/switch/src/switch.js +0 -141
- package/src/ngtsc/transform/index.js +0 -36
- package/src/ngtsc/transform/src/alias.js +0 -46
- package/src/ngtsc/transform/src/api.js +0 -76
- package/src/ngtsc/transform/src/compilation.js +0 -862
- package/src/ngtsc/transform/src/declaration.js +0 -234
- package/src/ngtsc/transform/src/trait.js +0 -111
- package/src/ngtsc/transform/src/transform.js +0 -333
- package/src/ngtsc/transform/src/utils.js +0 -73
- package/src/ngtsc/translator/index.js +0 -37
- package/src/ngtsc/translator/src/api/ast_factory.js +0 -20
- package/src/ngtsc/translator/src/api/import_generator.js +0 -20
- package/src/ngtsc/translator/src/context.js +0 -47
- package/src/ngtsc/translator/src/import_manager.js +0 -77
- package/src/ngtsc/translator/src/translator.js +0 -347
- package/src/ngtsc/translator/src/type_translator.js +0 -220
- package/src/ngtsc/translator/src/typescript_ast_factory.js +0 -251
- package/src/ngtsc/translator/src/typescript_translator.js +0 -34
- package/src/ngtsc/tsc_plugin.js +0 -129
- package/src/ngtsc/typecheck/api/api.js +0 -20
- package/src/ngtsc/typecheck/api/checker.js +0 -44
- package/src/ngtsc/typecheck/api/completion.js +0 -29
- package/src/ngtsc/typecheck/api/context.js +0 -20
- package/src/ngtsc/typecheck/api/index.js +0 -27
- package/src/ngtsc/typecheck/api/scope.js +0 -20
- package/src/ngtsc/typecheck/api/symbols.js +0 -35
- package/src/ngtsc/typecheck/diagnostics/index.js +0 -23
- package/src/ngtsc/typecheck/diagnostics/src/diagnostic.js +0 -141
- package/src/ngtsc/typecheck/diagnostics/src/id.js +0 -37
- package/src/ngtsc/typecheck/extended/api/api.js +0 -124
- package/src/ngtsc/typecheck/extended/api/extended_template_checker.js +0 -20
- package/src/ngtsc/typecheck/extended/api/index.js +0 -23
- package/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.js +0 -52
- package/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.js +0 -64
- package/src/ngtsc/typecheck/extended/index.js +0 -23
- package/src/ngtsc/typecheck/extended/src/extended_template_checker.js +0 -55
- package/src/ngtsc/typecheck/index.js +0 -29
- package/src/ngtsc/typecheck/src/checker.js +0 -767
- package/src/ngtsc/typecheck/src/comments.js +0 -181
- package/src/ngtsc/typecheck/src/completion.js +0 -230
- package/src/ngtsc/typecheck/src/context.js +0 -424
- package/src/ngtsc/typecheck/src/diagnostics.js +0 -114
- package/src/ngtsc/typecheck/src/dom.js +0 -87
- package/src/ngtsc/typecheck/src/environment.js +0 -160
- package/src/ngtsc/typecheck/src/expression.js +0 -417
- package/src/ngtsc/typecheck/src/line_mappings.js +0 -77
- package/src/ngtsc/typecheck/src/oob.js +0 -181
- package/src/ngtsc/typecheck/src/shim.js +0 -52
- package/src/ngtsc/typecheck/src/source.js +0 -91
- package/src/ngtsc/typecheck/src/tcb_util.js +0 -165
- package/src/ngtsc/typecheck/src/template_semantics.js +0 -52
- package/src/ngtsc/typecheck/src/template_symbol_builder.js +0 -551
- package/src/ngtsc/typecheck/src/ts_util.js +0 -202
- package/src/ngtsc/typecheck/src/type_check_block.js +0 -2212
- package/src/ngtsc/typecheck/src/type_check_file.js +0 -115
- package/src/ngtsc/typecheck/src/type_constructor.js +0 -255
- package/src/ngtsc/typecheck/src/type_emitter.js +0 -164
- package/src/ngtsc/typecheck/src/type_parameter_emitter.js +0 -115
- package/src/ngtsc/util/src/path.js +0 -33
- package/src/ngtsc/util/src/typescript.js +0 -176
- package/src/ngtsc/util/src/visitor.js +0 -119
- package/src/ngtsc/xi18n/index.js +0 -22
- package/src/ngtsc/xi18n/src/context.js +0 -20
- package/src/perform_compile.js +0 -322
- package/src/perform_watch.js +0 -263
- package/src/tooling.js +0 -47
- package/src/transformers/api.js +0 -42
- package/src/transformers/compiler_host.js +0 -623
- package/src/transformers/downlevel_decorators_transform.js +0 -611
- package/src/transformers/entry_points.js +0 -25
- package/src/transformers/i18n.js +0 -76
- package/src/transformers/inline_resources.js +0 -287
- package/src/transformers/lower_expressions.js +0 -365
- package/src/transformers/metadata_cache.js +0 -96
- package/src/transformers/metadata_reader.js +0 -120
- package/src/transformers/node_emitter.js +0 -637
- package/src/transformers/node_emitter_transform.js +0 -88
- package/src/transformers/patch_alias_reference_resolution.js +0 -129
- package/src/transformers/program.js +0 -998
- package/src/transformers/r3_metadata_transform.js +0 -73
- package/src/transformers/r3_transform.js +0 -44
- package/src/transformers/util.js +0 -122
- package/src/typescript_support.js +0 -74
- package/src/version.js +0 -28
|
@@ -0,0 +1,942 @@
|
|
|
1
|
+
|
|
2
|
+
import {createRequire as __cjsCompatRequire} from 'module';
|
|
3
|
+
const require = __cjsCompatRequire(import.meta.url);
|
|
4
|
+
const __ESM_IMPORT_META_URL__ = import.meta.url;
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defProps = Object.defineProperties;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
|
|
26
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/host.mjs
|
|
27
|
+
import ts from "typescript";
|
|
28
|
+
function isDecoratorIdentifier(exp) {
|
|
29
|
+
return ts.isIdentifier(exp) || ts.isPropertyAccessExpression(exp) && ts.isIdentifier(exp.expression) && ts.isIdentifier(exp.name);
|
|
30
|
+
}
|
|
31
|
+
var ClassMemberKind;
|
|
32
|
+
(function(ClassMemberKind2) {
|
|
33
|
+
ClassMemberKind2[ClassMemberKind2["Constructor"] = 0] = "Constructor";
|
|
34
|
+
ClassMemberKind2[ClassMemberKind2["Getter"] = 1] = "Getter";
|
|
35
|
+
ClassMemberKind2[ClassMemberKind2["Setter"] = 2] = "Setter";
|
|
36
|
+
ClassMemberKind2[ClassMemberKind2["Property"] = 3] = "Property";
|
|
37
|
+
ClassMemberKind2[ClassMemberKind2["Method"] = 4] = "Method";
|
|
38
|
+
})(ClassMemberKind || (ClassMemberKind = {}));
|
|
39
|
+
var KnownDeclaration;
|
|
40
|
+
(function(KnownDeclaration2) {
|
|
41
|
+
KnownDeclaration2[KnownDeclaration2["JsGlobalObject"] = 0] = "JsGlobalObject";
|
|
42
|
+
KnownDeclaration2[KnownDeclaration2["TsHelperAssign"] = 1] = "TsHelperAssign";
|
|
43
|
+
KnownDeclaration2[KnownDeclaration2["TsHelperSpread"] = 2] = "TsHelperSpread";
|
|
44
|
+
KnownDeclaration2[KnownDeclaration2["TsHelperSpreadArrays"] = 3] = "TsHelperSpreadArrays";
|
|
45
|
+
KnownDeclaration2[KnownDeclaration2["TsHelperSpreadArray"] = 4] = "TsHelperSpreadArray";
|
|
46
|
+
KnownDeclaration2[KnownDeclaration2["TsHelperRead"] = 5] = "TsHelperRead";
|
|
47
|
+
})(KnownDeclaration || (KnownDeclaration = {}));
|
|
48
|
+
|
|
49
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.mjs
|
|
50
|
+
import ts2 from "typescript";
|
|
51
|
+
function typeToValue(typeNode, checker) {
|
|
52
|
+
if (typeNode === null) {
|
|
53
|
+
return missingType();
|
|
54
|
+
}
|
|
55
|
+
if (!ts2.isTypeReferenceNode(typeNode)) {
|
|
56
|
+
return unsupportedType(typeNode);
|
|
57
|
+
}
|
|
58
|
+
const symbols = resolveTypeSymbols(typeNode, checker);
|
|
59
|
+
if (symbols === null) {
|
|
60
|
+
return unknownReference(typeNode);
|
|
61
|
+
}
|
|
62
|
+
const { local, decl } = symbols;
|
|
63
|
+
if (decl.valueDeclaration === void 0 || decl.flags & ts2.SymbolFlags.ConstEnum) {
|
|
64
|
+
let typeOnlyDecl = null;
|
|
65
|
+
if (decl.declarations !== void 0 && decl.declarations.length > 0) {
|
|
66
|
+
typeOnlyDecl = decl.declarations[0];
|
|
67
|
+
}
|
|
68
|
+
return noValueDeclaration(typeNode, typeOnlyDecl);
|
|
69
|
+
}
|
|
70
|
+
const firstDecl = local.declarations && local.declarations[0];
|
|
71
|
+
if (firstDecl !== void 0) {
|
|
72
|
+
if (ts2.isImportClause(firstDecl) && firstDecl.name !== void 0) {
|
|
73
|
+
if (firstDecl.isTypeOnly) {
|
|
74
|
+
return typeOnlyImport(typeNode, firstDecl);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
kind: 0,
|
|
78
|
+
expression: firstDecl.name,
|
|
79
|
+
defaultImportStatement: firstDecl.parent
|
|
80
|
+
};
|
|
81
|
+
} else if (ts2.isImportSpecifier(firstDecl)) {
|
|
82
|
+
if (firstDecl.parent.parent.isTypeOnly) {
|
|
83
|
+
return typeOnlyImport(typeNode, firstDecl.parent.parent);
|
|
84
|
+
}
|
|
85
|
+
const importedName = (firstDecl.propertyName || firstDecl.name).text;
|
|
86
|
+
const [_localName, ...nestedPath] = symbols.symbolNames;
|
|
87
|
+
const moduleName = extractModuleName(firstDecl.parent.parent.parent);
|
|
88
|
+
return {
|
|
89
|
+
kind: 1,
|
|
90
|
+
valueDeclaration: decl.valueDeclaration,
|
|
91
|
+
moduleName,
|
|
92
|
+
importedName,
|
|
93
|
+
nestedPath
|
|
94
|
+
};
|
|
95
|
+
} else if (ts2.isNamespaceImport(firstDecl)) {
|
|
96
|
+
if (firstDecl.parent.isTypeOnly) {
|
|
97
|
+
return typeOnlyImport(typeNode, firstDecl.parent);
|
|
98
|
+
}
|
|
99
|
+
if (symbols.symbolNames.length === 1) {
|
|
100
|
+
return namespaceImport(typeNode, firstDecl.parent);
|
|
101
|
+
}
|
|
102
|
+
const [_ns, importedName, ...nestedPath] = symbols.symbolNames;
|
|
103
|
+
const moduleName = extractModuleName(firstDecl.parent.parent);
|
|
104
|
+
return {
|
|
105
|
+
kind: 1,
|
|
106
|
+
valueDeclaration: decl.valueDeclaration,
|
|
107
|
+
moduleName,
|
|
108
|
+
importedName,
|
|
109
|
+
nestedPath
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const expression = typeNodeToValueExpr(typeNode);
|
|
114
|
+
if (expression !== null) {
|
|
115
|
+
return {
|
|
116
|
+
kind: 0,
|
|
117
|
+
expression,
|
|
118
|
+
defaultImportStatement: null
|
|
119
|
+
};
|
|
120
|
+
} else {
|
|
121
|
+
return unsupportedType(typeNode);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function unsupportedType(typeNode) {
|
|
125
|
+
return {
|
|
126
|
+
kind: 2,
|
|
127
|
+
reason: { kind: 5, typeNode }
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function noValueDeclaration(typeNode, decl) {
|
|
131
|
+
return {
|
|
132
|
+
kind: 2,
|
|
133
|
+
reason: { kind: 1, typeNode, decl }
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function typeOnlyImport(typeNode, importClause) {
|
|
137
|
+
return {
|
|
138
|
+
kind: 2,
|
|
139
|
+
reason: { kind: 2, typeNode, importClause }
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function unknownReference(typeNode) {
|
|
143
|
+
return {
|
|
144
|
+
kind: 2,
|
|
145
|
+
reason: { kind: 3, typeNode }
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function namespaceImport(typeNode, importClause) {
|
|
149
|
+
return {
|
|
150
|
+
kind: 2,
|
|
151
|
+
reason: { kind: 4, typeNode, importClause }
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function missingType() {
|
|
155
|
+
return {
|
|
156
|
+
kind: 2,
|
|
157
|
+
reason: { kind: 0 }
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function typeNodeToValueExpr(node) {
|
|
161
|
+
if (ts2.isTypeReferenceNode(node)) {
|
|
162
|
+
return entityNameToValue(node.typeName);
|
|
163
|
+
} else {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function resolveTypeSymbols(typeRef, checker) {
|
|
168
|
+
const typeName = typeRef.typeName;
|
|
169
|
+
const typeRefSymbol = checker.getSymbolAtLocation(typeName);
|
|
170
|
+
if (typeRefSymbol === void 0) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
let local = typeRefSymbol;
|
|
174
|
+
let leftMost = typeName;
|
|
175
|
+
const symbolNames = [];
|
|
176
|
+
while (ts2.isQualifiedName(leftMost)) {
|
|
177
|
+
symbolNames.unshift(leftMost.right.text);
|
|
178
|
+
leftMost = leftMost.left;
|
|
179
|
+
}
|
|
180
|
+
symbolNames.unshift(leftMost.text);
|
|
181
|
+
if (leftMost !== typeName) {
|
|
182
|
+
const localTmp = checker.getSymbolAtLocation(leftMost);
|
|
183
|
+
if (localTmp !== void 0) {
|
|
184
|
+
local = localTmp;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
let decl = typeRefSymbol;
|
|
188
|
+
if (typeRefSymbol.flags & ts2.SymbolFlags.Alias) {
|
|
189
|
+
decl = checker.getAliasedSymbol(typeRefSymbol);
|
|
190
|
+
}
|
|
191
|
+
return { local, decl, symbolNames };
|
|
192
|
+
}
|
|
193
|
+
function entityNameToValue(node) {
|
|
194
|
+
if (ts2.isQualifiedName(node)) {
|
|
195
|
+
const left = entityNameToValue(node.left);
|
|
196
|
+
return left !== null ? ts2.createPropertyAccess(left, node.right) : null;
|
|
197
|
+
} else if (ts2.isIdentifier(node)) {
|
|
198
|
+
return ts2.getMutableClone(node);
|
|
199
|
+
} else {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function extractModuleName(node) {
|
|
204
|
+
if (!ts2.isStringLiteral(node.moduleSpecifier)) {
|
|
205
|
+
throw new Error("not a module specifier");
|
|
206
|
+
}
|
|
207
|
+
return node.moduleSpecifier.text;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
|
|
211
|
+
import ts4 from "typescript";
|
|
212
|
+
|
|
213
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/util.mjs
|
|
214
|
+
import ts3 from "typescript";
|
|
215
|
+
function isNamedClassDeclaration(node) {
|
|
216
|
+
return ts3.isClassDeclaration(node) && isIdentifier(node.name);
|
|
217
|
+
}
|
|
218
|
+
function isIdentifier(node) {
|
|
219
|
+
return node !== void 0 && ts3.isIdentifier(node);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
|
|
223
|
+
var TypeScriptReflectionHost = class {
|
|
224
|
+
constructor(checker) {
|
|
225
|
+
this.checker = checker;
|
|
226
|
+
}
|
|
227
|
+
getDecoratorsOfDeclaration(declaration) {
|
|
228
|
+
if (declaration.decorators === void 0 || declaration.decorators.length === 0) {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
return declaration.decorators.map((decorator) => this._reflectDecorator(decorator)).filter((dec) => dec !== null);
|
|
232
|
+
}
|
|
233
|
+
getMembersOfClass(clazz) {
|
|
234
|
+
const tsClazz = castDeclarationToClassOrDie(clazz);
|
|
235
|
+
return tsClazz.members.map((member) => this._reflectMember(member)).filter((member) => member !== null);
|
|
236
|
+
}
|
|
237
|
+
getConstructorParameters(clazz) {
|
|
238
|
+
const tsClazz = castDeclarationToClassOrDie(clazz);
|
|
239
|
+
const isDeclaration = tsClazz.getSourceFile().isDeclarationFile;
|
|
240
|
+
const ctor = tsClazz.members.find((member) => ts4.isConstructorDeclaration(member) && (isDeclaration || member.body !== void 0));
|
|
241
|
+
if (ctor === void 0) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
return ctor.parameters.map((node) => {
|
|
245
|
+
const name = parameterName(node.name);
|
|
246
|
+
const decorators = this.getDecoratorsOfDeclaration(node);
|
|
247
|
+
let originalTypeNode = node.type || null;
|
|
248
|
+
let typeNode = originalTypeNode;
|
|
249
|
+
if (typeNode && ts4.isUnionTypeNode(typeNode)) {
|
|
250
|
+
let childTypeNodes = typeNode.types.filter((childTypeNode) => !(ts4.isLiteralTypeNode(childTypeNode) && childTypeNode.literal.kind === ts4.SyntaxKind.NullKeyword));
|
|
251
|
+
if (childTypeNodes.length === 1) {
|
|
252
|
+
typeNode = childTypeNodes[0];
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
const typeValueReference = typeToValue(typeNode, this.checker);
|
|
256
|
+
return {
|
|
257
|
+
name,
|
|
258
|
+
nameNode: node.name,
|
|
259
|
+
typeValueReference,
|
|
260
|
+
typeNode: originalTypeNode,
|
|
261
|
+
decorators
|
|
262
|
+
};
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
getImportOfIdentifier(id) {
|
|
266
|
+
const directImport = this.getDirectImportOfIdentifier(id);
|
|
267
|
+
if (directImport !== null) {
|
|
268
|
+
return directImport;
|
|
269
|
+
} else if (ts4.isQualifiedName(id.parent) && id.parent.right === id) {
|
|
270
|
+
return this.getImportOfNamespacedIdentifier(id, getQualifiedNameRoot(id.parent));
|
|
271
|
+
} else if (ts4.isPropertyAccessExpression(id.parent) && id.parent.name === id) {
|
|
272
|
+
return this.getImportOfNamespacedIdentifier(id, getFarLeftIdentifier(id.parent));
|
|
273
|
+
} else {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
getExportsOfModule(node) {
|
|
278
|
+
if (!ts4.isSourceFile(node)) {
|
|
279
|
+
throw new Error(`getExportsOfModule() called on non-SourceFile in TS code`);
|
|
280
|
+
}
|
|
281
|
+
const symbol = this.checker.getSymbolAtLocation(node);
|
|
282
|
+
if (symbol === void 0) {
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
const map = new Map();
|
|
286
|
+
this.checker.getExportsOfModule(symbol).forEach((exportSymbol) => {
|
|
287
|
+
const decl = this.getDeclarationOfSymbol(exportSymbol, null);
|
|
288
|
+
if (decl !== null) {
|
|
289
|
+
map.set(exportSymbol.name, decl);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
return map;
|
|
293
|
+
}
|
|
294
|
+
isClass(node) {
|
|
295
|
+
return isNamedClassDeclaration(node);
|
|
296
|
+
}
|
|
297
|
+
hasBaseClass(clazz) {
|
|
298
|
+
return this.getBaseClassExpression(clazz) !== null;
|
|
299
|
+
}
|
|
300
|
+
getBaseClassExpression(clazz) {
|
|
301
|
+
if (!(ts4.isClassDeclaration(clazz) || ts4.isClassExpression(clazz)) || clazz.heritageClauses === void 0) {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
const extendsClause = clazz.heritageClauses.find((clause) => clause.token === ts4.SyntaxKind.ExtendsKeyword);
|
|
305
|
+
if (extendsClause === void 0) {
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
const extendsType = extendsClause.types[0];
|
|
309
|
+
if (extendsType === void 0) {
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
return extendsType.expression;
|
|
313
|
+
}
|
|
314
|
+
getDeclarationOfIdentifier(id) {
|
|
315
|
+
let symbol = this.checker.getSymbolAtLocation(id);
|
|
316
|
+
if (symbol === void 0) {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
return this.getDeclarationOfSymbol(symbol, id);
|
|
320
|
+
}
|
|
321
|
+
getDefinitionOfFunction(node) {
|
|
322
|
+
if (!ts4.isFunctionDeclaration(node) && !ts4.isMethodDeclaration(node) && !ts4.isFunctionExpression(node)) {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
node,
|
|
327
|
+
body: node.body !== void 0 ? Array.from(node.body.statements) : null,
|
|
328
|
+
parameters: node.parameters.map((param) => {
|
|
329
|
+
const name = parameterName(param.name);
|
|
330
|
+
const initializer = param.initializer || null;
|
|
331
|
+
return { name, node: param, initializer };
|
|
332
|
+
})
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
getGenericArityOfClass(clazz) {
|
|
336
|
+
if (!ts4.isClassDeclaration(clazz)) {
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
return clazz.typeParameters !== void 0 ? clazz.typeParameters.length : 0;
|
|
340
|
+
}
|
|
341
|
+
getVariableValue(declaration) {
|
|
342
|
+
return declaration.initializer || null;
|
|
343
|
+
}
|
|
344
|
+
getDtsDeclaration(_) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
getInternalNameOfClass(clazz) {
|
|
348
|
+
return clazz.name;
|
|
349
|
+
}
|
|
350
|
+
getAdjacentNameOfClass(clazz) {
|
|
351
|
+
return clazz.name;
|
|
352
|
+
}
|
|
353
|
+
isStaticallyExported(decl) {
|
|
354
|
+
let topLevel = decl;
|
|
355
|
+
if (ts4.isVariableDeclaration(decl) && ts4.isVariableDeclarationList(decl.parent)) {
|
|
356
|
+
topLevel = decl.parent.parent;
|
|
357
|
+
}
|
|
358
|
+
if (topLevel.modifiers !== void 0 && topLevel.modifiers.some((modifier) => modifier.kind === ts4.SyntaxKind.ExportKeyword)) {
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
if (topLevel.parent === void 0 || !ts4.isSourceFile(topLevel.parent)) {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
const localExports = this.getLocalExportedDeclarationsOfSourceFile(decl.getSourceFile());
|
|
365
|
+
return localExports.has(decl);
|
|
366
|
+
}
|
|
367
|
+
getDirectImportOfIdentifier(id) {
|
|
368
|
+
const symbol = this.checker.getSymbolAtLocation(id);
|
|
369
|
+
if (symbol === void 0 || symbol.declarations === void 0 || symbol.declarations.length !== 1) {
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
const decl = symbol.declarations[0];
|
|
373
|
+
const importDecl = getContainingImportDeclaration(decl);
|
|
374
|
+
if (importDecl === null) {
|
|
375
|
+
return null;
|
|
376
|
+
}
|
|
377
|
+
if (!ts4.isStringLiteral(importDecl.moduleSpecifier)) {
|
|
378
|
+
return null;
|
|
379
|
+
}
|
|
380
|
+
return { from: importDecl.moduleSpecifier.text, name: getExportedName(decl, id) };
|
|
381
|
+
}
|
|
382
|
+
getImportOfNamespacedIdentifier(id, namespaceIdentifier) {
|
|
383
|
+
if (namespaceIdentifier === null) {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
const namespaceSymbol = this.checker.getSymbolAtLocation(namespaceIdentifier);
|
|
387
|
+
if (!namespaceSymbol || namespaceSymbol.declarations === void 0) {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
const declaration = namespaceSymbol.declarations.length === 1 ? namespaceSymbol.declarations[0] : null;
|
|
391
|
+
if (!declaration) {
|
|
392
|
+
return null;
|
|
393
|
+
}
|
|
394
|
+
const namespaceDeclaration = ts4.isNamespaceImport(declaration) ? declaration : null;
|
|
395
|
+
if (!namespaceDeclaration) {
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
const importDeclaration = namespaceDeclaration.parent.parent;
|
|
399
|
+
if (!ts4.isStringLiteral(importDeclaration.moduleSpecifier)) {
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
from: importDeclaration.moduleSpecifier.text,
|
|
404
|
+
name: id.text
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
getDeclarationOfSymbol(symbol, originalId) {
|
|
408
|
+
let valueDeclaration = void 0;
|
|
409
|
+
if (symbol.valueDeclaration !== void 0) {
|
|
410
|
+
valueDeclaration = symbol.valueDeclaration;
|
|
411
|
+
} else if (symbol.declarations !== void 0 && symbol.declarations.length > 0) {
|
|
412
|
+
valueDeclaration = symbol.declarations[0];
|
|
413
|
+
}
|
|
414
|
+
if (valueDeclaration !== void 0 && ts4.isShorthandPropertyAssignment(valueDeclaration)) {
|
|
415
|
+
const shorthandSymbol = this.checker.getShorthandAssignmentValueSymbol(valueDeclaration);
|
|
416
|
+
if (shorthandSymbol === void 0) {
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
return this.getDeclarationOfSymbol(shorthandSymbol, originalId);
|
|
420
|
+
} else if (valueDeclaration !== void 0 && ts4.isExportSpecifier(valueDeclaration)) {
|
|
421
|
+
const targetSymbol = this.checker.getExportSpecifierLocalTargetSymbol(valueDeclaration);
|
|
422
|
+
if (targetSymbol === void 0) {
|
|
423
|
+
return null;
|
|
424
|
+
}
|
|
425
|
+
return this.getDeclarationOfSymbol(targetSymbol, originalId);
|
|
426
|
+
}
|
|
427
|
+
const importInfo = originalId && this.getImportOfIdentifier(originalId);
|
|
428
|
+
const viaModule = importInfo !== null && importInfo.from !== null && !importInfo.from.startsWith(".") ? importInfo.from : null;
|
|
429
|
+
while (symbol.flags & ts4.SymbolFlags.Alias) {
|
|
430
|
+
symbol = this.checker.getAliasedSymbol(symbol);
|
|
431
|
+
}
|
|
432
|
+
if (symbol.valueDeclaration !== void 0) {
|
|
433
|
+
return {
|
|
434
|
+
node: symbol.valueDeclaration,
|
|
435
|
+
known: null,
|
|
436
|
+
viaModule,
|
|
437
|
+
identity: null,
|
|
438
|
+
kind: 0
|
|
439
|
+
};
|
|
440
|
+
} else if (symbol.declarations !== void 0 && symbol.declarations.length > 0) {
|
|
441
|
+
return {
|
|
442
|
+
node: symbol.declarations[0],
|
|
443
|
+
known: null,
|
|
444
|
+
viaModule,
|
|
445
|
+
identity: null,
|
|
446
|
+
kind: 0
|
|
447
|
+
};
|
|
448
|
+
} else {
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
_reflectDecorator(node) {
|
|
453
|
+
let decoratorExpr = node.expression;
|
|
454
|
+
let args = null;
|
|
455
|
+
if (ts4.isCallExpression(decoratorExpr)) {
|
|
456
|
+
args = Array.from(decoratorExpr.arguments);
|
|
457
|
+
decoratorExpr = decoratorExpr.expression;
|
|
458
|
+
}
|
|
459
|
+
if (!isDecoratorIdentifier(decoratorExpr)) {
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
const decoratorIdentifier = ts4.isIdentifier(decoratorExpr) ? decoratorExpr : decoratorExpr.name;
|
|
463
|
+
const importDecl = this.getImportOfIdentifier(decoratorIdentifier);
|
|
464
|
+
return {
|
|
465
|
+
name: decoratorIdentifier.text,
|
|
466
|
+
identifier: decoratorExpr,
|
|
467
|
+
import: importDecl,
|
|
468
|
+
node,
|
|
469
|
+
args
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
_reflectMember(node) {
|
|
473
|
+
let kind = null;
|
|
474
|
+
let value = null;
|
|
475
|
+
let name = null;
|
|
476
|
+
let nameNode = null;
|
|
477
|
+
if (ts4.isPropertyDeclaration(node)) {
|
|
478
|
+
kind = ClassMemberKind.Property;
|
|
479
|
+
value = node.initializer || null;
|
|
480
|
+
} else if (ts4.isGetAccessorDeclaration(node)) {
|
|
481
|
+
kind = ClassMemberKind.Getter;
|
|
482
|
+
} else if (ts4.isSetAccessorDeclaration(node)) {
|
|
483
|
+
kind = ClassMemberKind.Setter;
|
|
484
|
+
} else if (ts4.isMethodDeclaration(node)) {
|
|
485
|
+
kind = ClassMemberKind.Method;
|
|
486
|
+
} else if (ts4.isConstructorDeclaration(node)) {
|
|
487
|
+
kind = ClassMemberKind.Constructor;
|
|
488
|
+
} else {
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
if (ts4.isConstructorDeclaration(node)) {
|
|
492
|
+
name = "constructor";
|
|
493
|
+
} else if (ts4.isIdentifier(node.name)) {
|
|
494
|
+
name = node.name.text;
|
|
495
|
+
nameNode = node.name;
|
|
496
|
+
} else if (ts4.isStringLiteral(node.name)) {
|
|
497
|
+
name = node.name.text;
|
|
498
|
+
nameNode = node.name;
|
|
499
|
+
} else {
|
|
500
|
+
return null;
|
|
501
|
+
}
|
|
502
|
+
const decorators = this.getDecoratorsOfDeclaration(node);
|
|
503
|
+
const isStatic = node.modifiers !== void 0 && node.modifiers.some((mod) => mod.kind === ts4.SyntaxKind.StaticKeyword);
|
|
504
|
+
return {
|
|
505
|
+
node,
|
|
506
|
+
implementation: node,
|
|
507
|
+
kind,
|
|
508
|
+
type: node.type || null,
|
|
509
|
+
name,
|
|
510
|
+
nameNode,
|
|
511
|
+
decorators,
|
|
512
|
+
value,
|
|
513
|
+
isStatic
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
getLocalExportedDeclarationsOfSourceFile(file) {
|
|
517
|
+
const cacheSf = file;
|
|
518
|
+
if (cacheSf[LocalExportedDeclarations] !== void 0) {
|
|
519
|
+
return cacheSf[LocalExportedDeclarations];
|
|
520
|
+
}
|
|
521
|
+
const exportSet = new Set();
|
|
522
|
+
cacheSf[LocalExportedDeclarations] = exportSet;
|
|
523
|
+
const sfSymbol = this.checker.getSymbolAtLocation(cacheSf);
|
|
524
|
+
if (sfSymbol === void 0 || sfSymbol.exports === void 0) {
|
|
525
|
+
return exportSet;
|
|
526
|
+
}
|
|
527
|
+
const iter = sfSymbol.exports.values();
|
|
528
|
+
let item = iter.next();
|
|
529
|
+
while (item.done !== true) {
|
|
530
|
+
let exportedSymbol = item.value;
|
|
531
|
+
if (exportedSymbol.flags & ts4.SymbolFlags.Alias) {
|
|
532
|
+
exportedSymbol = this.checker.getAliasedSymbol(exportedSymbol);
|
|
533
|
+
}
|
|
534
|
+
if (exportedSymbol.valueDeclaration !== void 0 && exportedSymbol.valueDeclaration.getSourceFile() === file) {
|
|
535
|
+
exportSet.add(exportedSymbol.valueDeclaration);
|
|
536
|
+
}
|
|
537
|
+
item = iter.next();
|
|
538
|
+
}
|
|
539
|
+
return exportSet;
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
function castDeclarationToClassOrDie(declaration) {
|
|
543
|
+
if (!ts4.isClassDeclaration(declaration)) {
|
|
544
|
+
throw new Error(`Reflecting on a ${ts4.SyntaxKind[declaration.kind]} instead of a ClassDeclaration.`);
|
|
545
|
+
}
|
|
546
|
+
return declaration;
|
|
547
|
+
}
|
|
548
|
+
function parameterName(name) {
|
|
549
|
+
if (ts4.isIdentifier(name)) {
|
|
550
|
+
return name.text;
|
|
551
|
+
} else {
|
|
552
|
+
return null;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
function getQualifiedNameRoot(qualifiedName) {
|
|
556
|
+
while (ts4.isQualifiedName(qualifiedName.left)) {
|
|
557
|
+
qualifiedName = qualifiedName.left;
|
|
558
|
+
}
|
|
559
|
+
return ts4.isIdentifier(qualifiedName.left) ? qualifiedName.left : null;
|
|
560
|
+
}
|
|
561
|
+
function getFarLeftIdentifier(propertyAccess) {
|
|
562
|
+
while (ts4.isPropertyAccessExpression(propertyAccess.expression)) {
|
|
563
|
+
propertyAccess = propertyAccess.expression;
|
|
564
|
+
}
|
|
565
|
+
return ts4.isIdentifier(propertyAccess.expression) ? propertyAccess.expression : null;
|
|
566
|
+
}
|
|
567
|
+
function getContainingImportDeclaration(node) {
|
|
568
|
+
return ts4.isImportSpecifier(node) ? node.parent.parent.parent : ts4.isNamespaceImport(node) ? node.parent.parent : null;
|
|
569
|
+
}
|
|
570
|
+
function getExportedName(decl, originalId) {
|
|
571
|
+
return ts4.isImportSpecifier(decl) ? (decl.propertyName !== void 0 ? decl.propertyName : decl.name).text : originalId.text;
|
|
572
|
+
}
|
|
573
|
+
var LocalExportedDeclarations = Symbol("LocalExportedDeclarations");
|
|
574
|
+
|
|
575
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.mjs
|
|
576
|
+
import ts6 from "typescript";
|
|
577
|
+
|
|
578
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/patch_alias_reference_resolution.mjs
|
|
579
|
+
import ts5 from "typescript";
|
|
580
|
+
var patchedReferencedAliasesSymbol = Symbol("patchedReferencedAliases");
|
|
581
|
+
function loadIsReferencedAliasDeclarationPatch(context) {
|
|
582
|
+
if (!isTransformationContextWithEmitResolver(context)) {
|
|
583
|
+
throwIncompatibleTransformationContextError();
|
|
584
|
+
}
|
|
585
|
+
const emitResolver = context.getEmitResolver();
|
|
586
|
+
const existingReferencedAliases = emitResolver[patchedReferencedAliasesSymbol];
|
|
587
|
+
if (existingReferencedAliases !== void 0) {
|
|
588
|
+
return existingReferencedAliases;
|
|
589
|
+
}
|
|
590
|
+
const originalIsReferencedAliasDeclaration = emitResolver.isReferencedAliasDeclaration;
|
|
591
|
+
if (originalIsReferencedAliasDeclaration === void 0) {
|
|
592
|
+
throwIncompatibleTransformationContextError();
|
|
593
|
+
}
|
|
594
|
+
const referencedAliases = new Set();
|
|
595
|
+
emitResolver.isReferencedAliasDeclaration = function(node, ...args) {
|
|
596
|
+
if (isAliasImportDeclaration(node) && referencedAliases.has(node)) {
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
599
|
+
return originalIsReferencedAliasDeclaration.call(emitResolver, node, ...args);
|
|
600
|
+
};
|
|
601
|
+
return emitResolver[patchedReferencedAliasesSymbol] = referencedAliases;
|
|
602
|
+
}
|
|
603
|
+
function isAliasImportDeclaration(node) {
|
|
604
|
+
return ts5.isImportSpecifier(node) || ts5.isNamespaceImport(node) || ts5.isImportClause(node);
|
|
605
|
+
}
|
|
606
|
+
function isTransformationContextWithEmitResolver(context) {
|
|
607
|
+
return context.getEmitResolver !== void 0;
|
|
608
|
+
}
|
|
609
|
+
function throwIncompatibleTransformationContextError() {
|
|
610
|
+
throw Error("Unable to downlevel Angular decorators due to an incompatible TypeScript version.\nIf you recently updated TypeScript and this issue surfaces now, consider downgrading.\n\nPlease report an issue on the Angular repositories when this issue surfaces and you are using a supposedly compatible TypeScript version.");
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.mjs
|
|
614
|
+
function isAngularDecorator(decorator, isCore) {
|
|
615
|
+
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
616
|
+
}
|
|
617
|
+
var DECORATOR_INVOCATION_JSDOC_TYPE = "!Array<{type: !Function, args: (undefined|!Array<?>)}>";
|
|
618
|
+
function extractMetadataFromSingleDecorator(decorator, diagnostics) {
|
|
619
|
+
const metadataProperties = [];
|
|
620
|
+
const expr = decorator.expression;
|
|
621
|
+
switch (expr.kind) {
|
|
622
|
+
case ts6.SyntaxKind.Identifier:
|
|
623
|
+
metadataProperties.push(ts6.createPropertyAssignment("type", expr));
|
|
624
|
+
break;
|
|
625
|
+
case ts6.SyntaxKind.CallExpression:
|
|
626
|
+
const call = expr;
|
|
627
|
+
metadataProperties.push(ts6.createPropertyAssignment("type", call.expression));
|
|
628
|
+
if (call.arguments.length) {
|
|
629
|
+
const args = [];
|
|
630
|
+
for (const arg of call.arguments) {
|
|
631
|
+
args.push(arg);
|
|
632
|
+
}
|
|
633
|
+
const argsArrayLiteral = ts6.createArrayLiteral(ts6.createNodeArray(args, true));
|
|
634
|
+
metadataProperties.push(ts6.createPropertyAssignment("args", argsArrayLiteral));
|
|
635
|
+
}
|
|
636
|
+
break;
|
|
637
|
+
default:
|
|
638
|
+
diagnostics.push({
|
|
639
|
+
file: decorator.getSourceFile(),
|
|
640
|
+
start: decorator.getStart(),
|
|
641
|
+
length: decorator.getEnd() - decorator.getStart(),
|
|
642
|
+
messageText: `${ts6.SyntaxKind[decorator.kind]} not implemented in gathering decorator metadata.`,
|
|
643
|
+
category: ts6.DiagnosticCategory.Error,
|
|
644
|
+
code: 0
|
|
645
|
+
});
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
return ts6.createObjectLiteral(metadataProperties);
|
|
649
|
+
}
|
|
650
|
+
function createCtorParametersClassProperty(diagnostics, entityNameToExpression, ctorParameters, isClosureCompilerEnabled) {
|
|
651
|
+
const params = [];
|
|
652
|
+
for (const ctorParam of ctorParameters) {
|
|
653
|
+
if (!ctorParam.type && ctorParam.decorators.length === 0) {
|
|
654
|
+
params.push(ts6.createNull());
|
|
655
|
+
continue;
|
|
656
|
+
}
|
|
657
|
+
const paramType = ctorParam.type ? typeReferenceToExpression(entityNameToExpression, ctorParam.type) : void 0;
|
|
658
|
+
const members = [ts6.createPropertyAssignment("type", paramType || ts6.createIdentifier("undefined"))];
|
|
659
|
+
const decorators = [];
|
|
660
|
+
for (const deco of ctorParam.decorators) {
|
|
661
|
+
decorators.push(extractMetadataFromSingleDecorator(deco, diagnostics));
|
|
662
|
+
}
|
|
663
|
+
if (decorators.length) {
|
|
664
|
+
members.push(ts6.createPropertyAssignment("decorators", ts6.createArrayLiteral(decorators)));
|
|
665
|
+
}
|
|
666
|
+
params.push(ts6.createObjectLiteral(members));
|
|
667
|
+
}
|
|
668
|
+
const initializer = ts6.createArrowFunction(void 0, void 0, [], void 0, ts6.createToken(ts6.SyntaxKind.EqualsGreaterThanToken), ts6.createArrayLiteral(params, true));
|
|
669
|
+
const ctorProp = ts6.createProperty(void 0, [ts6.createToken(ts6.SyntaxKind.StaticKeyword)], "ctorParameters", void 0, void 0, initializer);
|
|
670
|
+
if (isClosureCompilerEnabled) {
|
|
671
|
+
ts6.setSyntheticLeadingComments(ctorProp, [
|
|
672
|
+
{
|
|
673
|
+
kind: ts6.SyntaxKind.MultiLineCommentTrivia,
|
|
674
|
+
text: [
|
|
675
|
+
`*`,
|
|
676
|
+
` * @type {function(): !Array<(null|{`,
|
|
677
|
+
` * type: ?,`,
|
|
678
|
+
` * decorators: (undefined|${DECORATOR_INVOCATION_JSDOC_TYPE}),`,
|
|
679
|
+
` * })>}`,
|
|
680
|
+
` * @nocollapse`,
|
|
681
|
+
` `
|
|
682
|
+
].join("\n"),
|
|
683
|
+
pos: -1,
|
|
684
|
+
end: -1,
|
|
685
|
+
hasTrailingNewLine: true
|
|
686
|
+
}
|
|
687
|
+
]);
|
|
688
|
+
}
|
|
689
|
+
return ctorProp;
|
|
690
|
+
}
|
|
691
|
+
function typeReferenceToExpression(entityNameToExpression, node) {
|
|
692
|
+
let kind = node.kind;
|
|
693
|
+
if (ts6.isLiteralTypeNode(node)) {
|
|
694
|
+
kind = node.literal.kind;
|
|
695
|
+
}
|
|
696
|
+
switch (kind) {
|
|
697
|
+
case ts6.SyntaxKind.FunctionType:
|
|
698
|
+
case ts6.SyntaxKind.ConstructorType:
|
|
699
|
+
return ts6.createIdentifier("Function");
|
|
700
|
+
case ts6.SyntaxKind.ArrayType:
|
|
701
|
+
case ts6.SyntaxKind.TupleType:
|
|
702
|
+
return ts6.createIdentifier("Array");
|
|
703
|
+
case ts6.SyntaxKind.TypePredicate:
|
|
704
|
+
case ts6.SyntaxKind.TrueKeyword:
|
|
705
|
+
case ts6.SyntaxKind.FalseKeyword:
|
|
706
|
+
case ts6.SyntaxKind.BooleanKeyword:
|
|
707
|
+
return ts6.createIdentifier("Boolean");
|
|
708
|
+
case ts6.SyntaxKind.StringLiteral:
|
|
709
|
+
case ts6.SyntaxKind.StringKeyword:
|
|
710
|
+
return ts6.createIdentifier("String");
|
|
711
|
+
case ts6.SyntaxKind.ObjectKeyword:
|
|
712
|
+
return ts6.createIdentifier("Object");
|
|
713
|
+
case ts6.SyntaxKind.NumberKeyword:
|
|
714
|
+
case ts6.SyntaxKind.NumericLiteral:
|
|
715
|
+
return ts6.createIdentifier("Number");
|
|
716
|
+
case ts6.SyntaxKind.TypeReference:
|
|
717
|
+
const typeRef = node;
|
|
718
|
+
return entityNameToExpression(typeRef.typeName);
|
|
719
|
+
case ts6.SyntaxKind.UnionType:
|
|
720
|
+
const childTypeNodes = node.types.filter((t) => !(ts6.isLiteralTypeNode(t) && t.literal.kind === ts6.SyntaxKind.NullKeyword));
|
|
721
|
+
return childTypeNodes.length === 1 ? typeReferenceToExpression(entityNameToExpression, childTypeNodes[0]) : void 0;
|
|
722
|
+
default:
|
|
723
|
+
return void 0;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
function symbolIsRuntimeValue(typeChecker, symbol) {
|
|
727
|
+
if (symbol.flags & ts6.SymbolFlags.Alias) {
|
|
728
|
+
symbol = typeChecker.getAliasedSymbol(symbol);
|
|
729
|
+
}
|
|
730
|
+
return (symbol.flags & ts6.SymbolFlags.Value & ts6.SymbolFlags.ConstEnumExcludes) !== 0;
|
|
731
|
+
}
|
|
732
|
+
function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore, isClosureCompilerEnabled, skipClassDecorators) {
|
|
733
|
+
function addJSDocTypeAnnotation(node, jsdocType) {
|
|
734
|
+
if (!isClosureCompilerEnabled) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
ts6.setSyntheticLeadingComments(node, [
|
|
738
|
+
{
|
|
739
|
+
kind: ts6.SyntaxKind.MultiLineCommentTrivia,
|
|
740
|
+
text: `* @type {${jsdocType}} `,
|
|
741
|
+
pos: -1,
|
|
742
|
+
end: -1,
|
|
743
|
+
hasTrailingNewLine: true
|
|
744
|
+
}
|
|
745
|
+
]);
|
|
746
|
+
}
|
|
747
|
+
function createDecoratorClassProperty(decoratorList) {
|
|
748
|
+
const modifier = ts6.createToken(ts6.SyntaxKind.StaticKeyword);
|
|
749
|
+
const initializer = ts6.createArrayLiteral(decoratorList, true);
|
|
750
|
+
const prop = ts6.createProperty(void 0, [modifier], "decorators", void 0, void 0, initializer);
|
|
751
|
+
addJSDocTypeAnnotation(prop, DECORATOR_INVOCATION_JSDOC_TYPE);
|
|
752
|
+
return prop;
|
|
753
|
+
}
|
|
754
|
+
function createPropDecoratorsClassProperty(diagnostics2, properties) {
|
|
755
|
+
const entries = [];
|
|
756
|
+
for (const [name, decorators] of properties.entries()) {
|
|
757
|
+
entries.push(ts6.createPropertyAssignment(name, ts6.createArrayLiteral(decorators.map((deco) => extractMetadataFromSingleDecorator(deco, diagnostics2)))));
|
|
758
|
+
}
|
|
759
|
+
const initializer = ts6.createObjectLiteral(entries, true);
|
|
760
|
+
const prop = ts6.createProperty(void 0, [ts6.createToken(ts6.SyntaxKind.StaticKeyword)], "propDecorators", void 0, void 0, initializer);
|
|
761
|
+
addJSDocTypeAnnotation(prop, `!Object<string, ${DECORATOR_INVOCATION_JSDOC_TYPE}>`);
|
|
762
|
+
return prop;
|
|
763
|
+
}
|
|
764
|
+
return (context) => {
|
|
765
|
+
const referencedParameterTypes = loadIsReferencedAliasDeclarationPatch(context);
|
|
766
|
+
function entityNameToExpression(name) {
|
|
767
|
+
const symbol = typeChecker.getSymbolAtLocation(name);
|
|
768
|
+
if (!symbol || !symbolIsRuntimeValue(typeChecker, symbol) || !symbol.declarations || symbol.declarations.length === 0) {
|
|
769
|
+
return void 0;
|
|
770
|
+
}
|
|
771
|
+
if (ts6.isQualifiedName(name)) {
|
|
772
|
+
const containerExpr = entityNameToExpression(name.left);
|
|
773
|
+
if (containerExpr === void 0) {
|
|
774
|
+
return void 0;
|
|
775
|
+
}
|
|
776
|
+
return ts6.createPropertyAccess(containerExpr, name.right);
|
|
777
|
+
}
|
|
778
|
+
const decl = symbol.declarations[0];
|
|
779
|
+
if (isAliasImportDeclaration(decl)) {
|
|
780
|
+
referencedParameterTypes.add(decl);
|
|
781
|
+
if (decl.name !== void 0) {
|
|
782
|
+
return ts6.getMutableClone(decl.name);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
return ts6.getMutableClone(name);
|
|
786
|
+
}
|
|
787
|
+
function transformClassElement(element) {
|
|
788
|
+
element = ts6.visitEachChild(element, decoratorDownlevelVisitor, context);
|
|
789
|
+
const decoratorsToKeep = [];
|
|
790
|
+
const toLower = [];
|
|
791
|
+
const decorators = host.getDecoratorsOfDeclaration(element) || [];
|
|
792
|
+
for (const decorator of decorators) {
|
|
793
|
+
const decoratorNode = decorator.node;
|
|
794
|
+
if (!isAngularDecorator(decorator, isCore)) {
|
|
795
|
+
decoratorsToKeep.push(decoratorNode);
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
798
|
+
toLower.push(decoratorNode);
|
|
799
|
+
}
|
|
800
|
+
if (!toLower.length)
|
|
801
|
+
return [void 0, element, []];
|
|
802
|
+
if (!element.name || !ts6.isIdentifier(element.name)) {
|
|
803
|
+
diagnostics.push({
|
|
804
|
+
file: element.getSourceFile(),
|
|
805
|
+
start: element.getStart(),
|
|
806
|
+
length: element.getEnd() - element.getStart(),
|
|
807
|
+
messageText: `Cannot process decorators for class element with non-analyzable name.`,
|
|
808
|
+
category: ts6.DiagnosticCategory.Error,
|
|
809
|
+
code: 0
|
|
810
|
+
});
|
|
811
|
+
return [void 0, element, []];
|
|
812
|
+
}
|
|
813
|
+
const name = element.name.text;
|
|
814
|
+
const mutable = ts6.getMutableClone(element);
|
|
815
|
+
mutable.decorators = decoratorsToKeep.length ? ts6.setTextRange(ts6.createNodeArray(decoratorsToKeep), mutable.decorators) : void 0;
|
|
816
|
+
return [name, mutable, toLower];
|
|
817
|
+
}
|
|
818
|
+
function transformConstructor(ctor) {
|
|
819
|
+
ctor = ts6.visitEachChild(ctor, decoratorDownlevelVisitor, context);
|
|
820
|
+
const newParameters = [];
|
|
821
|
+
const oldParameters = ts6.visitParameterList(ctor.parameters, decoratorDownlevelVisitor, context);
|
|
822
|
+
const parametersInfo = [];
|
|
823
|
+
for (const param of oldParameters) {
|
|
824
|
+
const decoratorsToKeep = [];
|
|
825
|
+
const paramInfo = { decorators: [], type: null };
|
|
826
|
+
const decorators = host.getDecoratorsOfDeclaration(param) || [];
|
|
827
|
+
for (const decorator of decorators) {
|
|
828
|
+
const decoratorNode = decorator.node;
|
|
829
|
+
if (!isAngularDecorator(decorator, isCore)) {
|
|
830
|
+
decoratorsToKeep.push(decoratorNode);
|
|
831
|
+
continue;
|
|
832
|
+
}
|
|
833
|
+
paramInfo.decorators.push(decoratorNode);
|
|
834
|
+
}
|
|
835
|
+
if (param.type) {
|
|
836
|
+
paramInfo.type = param.type;
|
|
837
|
+
}
|
|
838
|
+
parametersInfo.push(paramInfo);
|
|
839
|
+
const newParam = ts6.updateParameter(param, decoratorsToKeep.length ? decoratorsToKeep : void 0, param.modifiers, param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer);
|
|
840
|
+
newParameters.push(newParam);
|
|
841
|
+
}
|
|
842
|
+
const updated = ts6.updateConstructor(ctor, ctor.decorators, ctor.modifiers, newParameters, ts6.visitFunctionBody(ctor.body, decoratorDownlevelVisitor, context));
|
|
843
|
+
return [updated, parametersInfo];
|
|
844
|
+
}
|
|
845
|
+
function transformClassDeclaration(classDecl) {
|
|
846
|
+
classDecl = ts6.getMutableClone(classDecl);
|
|
847
|
+
const newMembers = [];
|
|
848
|
+
const decoratedProperties = new Map();
|
|
849
|
+
let classParameters = null;
|
|
850
|
+
for (const member of classDecl.members) {
|
|
851
|
+
switch (member.kind) {
|
|
852
|
+
case ts6.SyntaxKind.PropertyDeclaration:
|
|
853
|
+
case ts6.SyntaxKind.GetAccessor:
|
|
854
|
+
case ts6.SyntaxKind.SetAccessor:
|
|
855
|
+
case ts6.SyntaxKind.MethodDeclaration: {
|
|
856
|
+
const [name, newMember, decorators] = transformClassElement(member);
|
|
857
|
+
newMembers.push(newMember);
|
|
858
|
+
if (name)
|
|
859
|
+
decoratedProperties.set(name, decorators);
|
|
860
|
+
continue;
|
|
861
|
+
}
|
|
862
|
+
case ts6.SyntaxKind.Constructor: {
|
|
863
|
+
const ctor = member;
|
|
864
|
+
if (!ctor.body)
|
|
865
|
+
break;
|
|
866
|
+
const [newMember, parametersInfo] = transformConstructor(member);
|
|
867
|
+
classParameters = parametersInfo;
|
|
868
|
+
newMembers.push(newMember);
|
|
869
|
+
continue;
|
|
870
|
+
}
|
|
871
|
+
default:
|
|
872
|
+
break;
|
|
873
|
+
}
|
|
874
|
+
newMembers.push(ts6.visitEachChild(member, decoratorDownlevelVisitor, context));
|
|
875
|
+
}
|
|
876
|
+
const decoratorsToKeep = new Set(classDecl.decorators);
|
|
877
|
+
const possibleAngularDecorators = host.getDecoratorsOfDeclaration(classDecl) || [];
|
|
878
|
+
let hasAngularDecorator = false;
|
|
879
|
+
const decoratorsToLower = [];
|
|
880
|
+
for (const decorator of possibleAngularDecorators) {
|
|
881
|
+
const decoratorNode = decorator.node;
|
|
882
|
+
const isNgDecorator = isAngularDecorator(decorator, isCore);
|
|
883
|
+
if (isNgDecorator) {
|
|
884
|
+
hasAngularDecorator = true;
|
|
885
|
+
}
|
|
886
|
+
if (isNgDecorator && !skipClassDecorators) {
|
|
887
|
+
decoratorsToLower.push(extractMetadataFromSingleDecorator(decoratorNode, diagnostics));
|
|
888
|
+
decoratorsToKeep.delete(decoratorNode);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
if (decoratorsToLower.length) {
|
|
892
|
+
newMembers.push(createDecoratorClassProperty(decoratorsToLower));
|
|
893
|
+
}
|
|
894
|
+
if (classParameters) {
|
|
895
|
+
if (hasAngularDecorator || classParameters.some((p) => !!p.decorators.length)) {
|
|
896
|
+
newMembers.push(createCtorParametersClassProperty(diagnostics, entityNameToExpression, classParameters, isClosureCompilerEnabled));
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
if (decoratedProperties.size) {
|
|
900
|
+
newMembers.push(createPropDecoratorsClassProperty(diagnostics, decoratedProperties));
|
|
901
|
+
}
|
|
902
|
+
const members = ts6.setTextRange(ts6.createNodeArray(newMembers, classDecl.members.hasTrailingComma), classDecl.members);
|
|
903
|
+
return ts6.updateClassDeclaration(classDecl, decoratorsToKeep.size ? Array.from(decoratorsToKeep) : void 0, classDecl.modifiers, classDecl.name, classDecl.typeParameters, classDecl.heritageClauses, members);
|
|
904
|
+
}
|
|
905
|
+
function decoratorDownlevelVisitor(node) {
|
|
906
|
+
if (ts6.isClassDeclaration(node)) {
|
|
907
|
+
return transformClassDeclaration(node);
|
|
908
|
+
}
|
|
909
|
+
return ts6.visitEachChild(node, decoratorDownlevelVisitor, context);
|
|
910
|
+
}
|
|
911
|
+
return (sf) => {
|
|
912
|
+
return ts6.visitEachChild(sf, decoratorDownlevelVisitor, context);
|
|
913
|
+
};
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/private/tooling.mjs
|
|
918
|
+
var GLOBAL_DEFS_FOR_TERSER = {
|
|
919
|
+
ngDevMode: false,
|
|
920
|
+
ngI18nClosureMode: false
|
|
921
|
+
};
|
|
922
|
+
var GLOBAL_DEFS_FOR_TERSER_WITH_AOT = __spreadProps(__spreadValues({}, GLOBAL_DEFS_FOR_TERSER), {
|
|
923
|
+
ngJitMode: false
|
|
924
|
+
});
|
|
925
|
+
function constructorParametersDownlevelTransform(program) {
|
|
926
|
+
const typeChecker = program.getTypeChecker();
|
|
927
|
+
const reflectionHost = new TypeScriptReflectionHost(typeChecker);
|
|
928
|
+
return getDownlevelDecoratorsTransform(typeChecker, reflectionHost, [], false, false, true);
|
|
929
|
+
}
|
|
930
|
+
export {
|
|
931
|
+
GLOBAL_DEFS_FOR_TERSER,
|
|
932
|
+
GLOBAL_DEFS_FOR_TERSER_WITH_AOT,
|
|
933
|
+
constructorParametersDownlevelTransform
|
|
934
|
+
};
|
|
935
|
+
/**
|
|
936
|
+
* @license
|
|
937
|
+
* Copyright Google LLC All Rights Reserved.
|
|
938
|
+
*
|
|
939
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
940
|
+
* found in the LICENSE file at https://angular.io/license
|
|
941
|
+
*/
|
|
942
|
+
//# sourceMappingURL=tooling.js.map
|