@soundscript/soundscript 0.1.12 → 0.1.15
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/package.json +15 -6
- package/project-transform/index.js +2 -0
- package/project-transform/index.ts +8 -0
- package/project-transform/src/annotation_syntax.js +948 -0
- package/project-transform/src/annotation_syntax.ts +1217 -0
- package/project-transform/src/build_package.js +475 -0
- package/project-transform/src/build_package.ts +683 -0
- package/project-transform/src/bundled/portable-web-globals.d.ts +153 -0
- package/project-transform/src/bundled/runtime_externs.js +220 -0
- package/project-transform/src/bundled/runtime_externs.ts +237 -0
- package/project-transform/src/bundled/sound-libs/lib.decorators.d.ts +385 -0
- package/project-transform/src/bundled/sound-libs/lib.decorators.legacy.d.ts +22 -0
- package/project-transform/src/bundled/sound-libs/lib.dom.asynciterable.d.ts +42 -0
- package/project-transform/src/bundled/sound-libs/lib.dom.d.ts +39440 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.collection.d.ts +149 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.core.d.ts +657 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.d.ts +28 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.generator.d.ts +77 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.iterable.d.ts +616 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.promise.d.ts +80 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.proxy.d.ts +128 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.reflect.d.ts +144 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.symbol.d.ts +46 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.symbol.wellknown.d.ts +170 -0
- package/project-transform/src/bundled/sound-libs/lib.es2016.array.include.d.ts +116 -0
- package/project-transform/src/bundled/sound-libs/lib.es2016.d.ts +21 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.arraybuffer.d.ts +21 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.d.ts +26 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.date.d.ts +31 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.object.d.ts +49 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.string.d.ts +45 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.typedarrays.d.ts +53 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.asyncgenerator.d.ts +77 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.asynciterable.d.ts +57 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.d.ts +24 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.promise.d.ts +30 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.regexp.d.ts +37 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.array.d.ts +79 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.d.ts +24 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.object.d.ts +47 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.string.d.ts +37 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.symbol.d.ts +24 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.bigint.d.ts +765 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.d.ts +27 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.date.d.ts +42 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.number.d.ts +28 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.promise.d.ts +49 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.string.d.ts +44 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/project-transform/src/bundled/sound-libs/lib.es2021.d.ts +23 -0
- package/project-transform/src/bundled/sound-libs/lib.es2021.promise.d.ts +48 -0
- package/project-transform/src/bundled/sound-libs/lib.es2021.string.d.ts +33 -0
- package/project-transform/src/bundled/sound-libs/lib.es2021.weakref.d.ts +78 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.array.d.ts +121 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.d.ts +25 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.error.d.ts +75 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.object.d.ts +26 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.regexp.d.ts +39 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.string.d.ts +25 -0
- package/project-transform/src/bundled/sound-libs/lib.es2023.array.d.ts +924 -0
- package/project-transform/src/bundled/sound-libs/lib.es2023.collection.d.ts +21 -0
- package/project-transform/src/bundled/sound-libs/lib.es2023.d.ts +22 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.arraybuffer.d.ts +65 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.collection.d.ts +29 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.d.ts +26 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.object.d.ts +33 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.promise.d.ts +35 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.regexp.d.ts +25 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.string.d.ts +29 -0
- package/project-transform/src/bundled/sound-libs/lib.es5.d.ts +4924 -0
- package/project-transform/src/bundled/sound_stdlib.js +142 -0
- package/project-transform/src/bundled/sound_stdlib.ts +180 -0
- package/project-transform/src/checker/analyze_project.js +1361 -0
- package/project-transform/src/checker/analyze_project.ts +2246 -0
- package/project-transform/src/checker/diagnostics.js +112 -0
- package/project-transform/src/checker/diagnostics.ts +222 -0
- package/project-transform/src/checker/engine/context.js +235 -0
- package/project-transform/src/checker/engine/context.ts +340 -0
- package/project-transform/src/checker/engine/diagnostic_codes.js +72 -0
- package/project-transform/src/checker/engine/diagnostic_codes.ts +95 -0
- package/project-transform/src/checker/engine/facts.js +35 -0
- package/project-transform/src/checker/engine/facts.ts +48 -0
- package/project-transform/src/checker/engine/types.js +1 -0
- package/project-transform/src/checker/engine/types.ts +485 -0
- package/project-transform/src/checker/proof_escape_hatch_diagnostics.js +104 -0
- package/project-transform/src/checker/proof_escape_hatch_diagnostics.ts +173 -0
- package/project-transform/src/checker/rules/async_surface.js +231 -0
- package/project-transform/src/checker/rules/async_surface.ts +335 -0
- package/project-transform/src/checker/rules/class_lifecycle.js +798 -0
- package/project-transform/src/checker/rules/class_lifecycle.ts +1276 -0
- package/project-transform/src/checker/rules/directive_validation.js +571 -0
- package/project-transform/src/checker/rules/directive_validation.ts +938 -0
- package/project-transform/src/checker/rules/directives.js +23 -0
- package/project-transform/src/checker/rules/directives.ts +25 -0
- package/project-transform/src/checker/rules/flow.js +202 -0
- package/project-transform/src/checker/rules/flow.ts +333 -0
- package/project-transform/src/checker/rules/flow_facts.js +601 -0
- package/project-transform/src/checker/rules/flow_facts.ts +978 -0
- package/project-transform/src/checker/rules/flow_invalidation.js +1119 -0
- package/project-transform/src/checker/rules/flow_invalidation.ts +2150 -0
- package/project-transform/src/checker/rules/flow_shared.js +2822 -0
- package/project-transform/src/checker/rules/flow_shared.ts +4383 -0
- package/project-transform/src/checker/rules/foreign_boundary.js +120 -0
- package/project-transform/src/checker/rules/foreign_boundary.ts +196 -0
- package/project-transform/src/checker/rules/foreign_projection.js +279 -0
- package/project-transform/src/checker/rules/foreign_projection.ts +425 -0
- package/project-transform/src/checker/rules/generated_helpers.js +13 -0
- package/project-transform/src/checker/rules/generated_helpers.ts +18 -0
- package/project-transform/src/checker/rules/index.js +35 -0
- package/project-transform/src/checker/rules/index.ts +49 -0
- package/project-transform/src/checker/rules/namespace_object.js +845 -0
- package/project-transform/src/checker/rules/namespace_object.ts +1224 -0
- package/project-transform/src/checker/rules/non_ordinary_recovery.js +1328 -0
- package/project-transform/src/checker/rules/non_ordinary_recovery.ts +2391 -0
- package/project-transform/src/checker/rules/null_prototype.js +3 -0
- package/project-transform/src/checker/rules/null_prototype.ts +6 -0
- package/project-transform/src/checker/rules/overloads.js +181 -0
- package/project-transform/src/checker/rules/overloads.ts +317 -0
- package/project-transform/src/checker/rules/predicate_verification.js +691 -0
- package/project-transform/src/checker/rules/predicate_verification.ts +1088 -0
- package/project-transform/src/checker/rules/prototype_hardening.js +237 -0
- package/project-transform/src/checker/rules/prototype_hardening.ts +343 -0
- package/project-transform/src/checker/rules/receiver_discipline.js +263 -0
- package/project-transform/src/checker/rules/receiver_discipline.ts +356 -0
- package/project-transform/src/checker/rules/relations.js +6861 -0
- package/project-transform/src/checker/rules/relations.ts +12158 -0
- package/project-transform/src/checker/rules/resolved_builtins.js +274 -0
- package/project-transform/src/checker/rules/resolved_builtins.ts +438 -0
- package/project-transform/src/checker/rules/trust.js +217 -0
- package/project-transform/src/checker/rules/trust.ts +301 -0
- package/project-transform/src/checker/rules/type_guards.js +173 -0
- package/project-transform/src/checker/rules/type_guards.ts +257 -0
- package/project-transform/src/checker/rules/universal.js +17 -0
- package/project-transform/src/checker/rules/universal.ts +22 -0
- package/project-transform/src/checker/rules/unsafe_value_origin.js +80 -0
- package/project-transform/src/checker/rules/unsafe_value_origin.ts +125 -0
- package/project-transform/src/checker/rules/unsound_imports.js +218 -0
- package/project-transform/src/checker/rules/unsound_imports.ts +301 -0
- package/project-transform/src/checker/rules/unsound_syntax.js +1695 -0
- package/project-transform/src/checker/rules/unsound_syntax.ts +2540 -0
- package/project-transform/src/checker/rules/value_types.js +206 -0
- package/project-transform/src/checker/rules/value_types.ts +407 -0
- package/project-transform/src/checker/timing.js +43 -0
- package/project-transform/src/checker/timing.ts +78 -0
- package/project-transform/src/checker/unsupported_feature_messages.js +337 -0
- package/project-transform/src/checker/unsupported_feature_messages.ts +531 -0
- package/project-transform/src/cli.js +892 -0
- package/project-transform/src/cli.ts +1476 -0
- package/project-transform/src/compiler/compile_project.js +319 -0
- package/project-transform/src/compiler/compile_project.ts +508 -0
- package/project-transform/src/compiler/errors.js +10 -0
- package/project-transform/src/compiler/errors.ts +29 -0
- package/project-transform/src/compiler/ir.js +1 -0
- package/project-transform/src/compiler/ir.ts +1526 -0
- package/project-transform/src/compiler/lower.js +30550 -0
- package/project-transform/src/compiler/lower.ts +43645 -0
- package/project-transform/src/compiler/lower_arrays.js +140 -0
- package/project-transform/src/compiler/lower_arrays.ts +190 -0
- package/project-transform/src/compiler/lower_strings.js +121 -0
- package/project-transform/src/compiler/lower_strings.ts +198 -0
- package/project-transform/src/compiler/lower_tagged.js +329 -0
- package/project-transform/src/compiler/lower_tagged.ts +427 -0
- package/project-transform/src/compiler/lower_views.js +171 -0
- package/project-transform/src/compiler/lower_views.ts +251 -0
- package/project-transform/src/compiler/object_keys.js +25 -0
- package/project-transform/src/compiler/object_keys.ts +35 -0
- package/project-transform/src/compiler/runtime_ir.js +30 -0
- package/project-transform/src/compiler/runtime_ir.ts +727 -0
- package/project-transform/src/compiler/tagged_boundary.js +18 -0
- package/project-transform/src/compiler/tagged_boundary.ts +37 -0
- package/project-transform/src/compiler/toolchain.js +170 -0
- package/project-transform/src/compiler/toolchain.ts +229 -0
- package/project-transform/src/compiler/unicode_case_data.js +2102 -0
- package/project-transform/src/compiler/unicode_case_data.ts +2112 -0
- package/project-transform/src/compiler/wasm_js_host_runtime.js +656 -0
- package/project-transform/src/compiler/wasm_js_host_runtime.ts +762 -0
- package/project-transform/src/compiler/wat_arrays.js +3132 -0
- package/project-transform/src/compiler/wat_arrays.ts +3768 -0
- package/project-transform/src/compiler/wat_emitter.js +17952 -0
- package/project-transform/src/compiler/wat_emitter.ts +22812 -0
- package/project-transform/src/compiler/wat_strings.js +129 -0
- package/project-transform/src/compiler/wat_strings.ts +187 -0
- package/project-transform/src/compiler/wat_tagged.js +548 -0
- package/project-transform/src/compiler/wat_tagged.ts +674 -0
- package/project-transform/src/compiler_generator_runner.js +153 -0
- package/project-transform/src/compiler_generator_runner.ts +171 -0
- package/project-transform/src/compiler_object_test_helpers.js +69 -0
- package/project-transform/src/compiler_object_test_helpers.ts +96 -0
- package/project-transform/src/compiler_promise_runner.js +2116 -0
- package/project-transform/src/compiler_promise_runner.ts +2184 -0
- package/project-transform/src/compiler_test_helpers.js +854 -0
- package/project-transform/src/compiler_test_helpers.ts +1087 -0
- package/project-transform/src/config.js +568 -0
- package/project-transform/src/config.ts +892 -0
- package/project-transform/src/diagnostic_metadata.js +67 -0
- package/project-transform/src/diagnostic_metadata.ts +99 -0
- package/project-transform/src/diagnostic_reference.js +1368 -0
- package/project-transform/src/diagnostic_reference.ts +1523 -0
- package/project-transform/src/editor_diagnostics_worker.js +176 -0
- package/project-transform/src/editor_diagnostics_worker.ts +250 -0
- package/project-transform/src/editor_projection.js +224 -0
- package/project-transform/src/editor_projection.ts +421 -0
- package/project-transform/src/frontend/builtin_expanded_program_test_cleanup.js +47 -0
- package/project-transform/src/frontend/builtin_expanded_program_test_cleanup.ts +72 -0
- package/project-transform/src/frontend/builtin_macro_support.js +842 -0
- package/project-transform/src/frontend/builtin_macro_support.ts +1386 -0
- package/project-transform/src/frontend/builtin_macros.js +409 -0
- package/project-transform/src/frontend/builtin_macros.ts +542 -0
- package/project-transform/src/frontend/component_poc_runtime.js +279 -0
- package/project-transform/src/frontend/component_poc_runtime.ts +372 -0
- package/project-transform/src/frontend/css_macro.js +148 -0
- package/project-transform/src/frontend/css_macro.ts +222 -0
- package/project-transform/src/frontend/derive_macros.js +2072 -0
- package/project-transform/src/frontend/derive_macros.ts +3188 -0
- package/project-transform/src/frontend/embedded_fragment_support.js +106 -0
- package/project-transform/src/frontend/embedded_fragment_support.ts +172 -0
- package/project-transform/src/frontend/error_normalization.js +403 -0
- package/project-transform/src/frontend/error_normalization.ts +832 -0
- package/project-transform/src/frontend/error_stdlib_support.js +1 -0
- package/project-transform/src/frontend/error_stdlib_support.ts +6 -0
- package/project-transform/src/frontend/expand_project.js +169 -0
- package/project-transform/src/frontend/expand_project.ts +248 -0
- package/project-transform/src/frontend/format_soundscript.js +297 -0
- package/project-transform/src/frontend/format_soundscript.ts +582 -0
- package/project-transform/src/frontend/graphql_macro.js +174 -0
- package/project-transform/src/frontend/graphql_macro.ts +253 -0
- package/project-transform/src/frontend/hash_context.js +83 -0
- package/project-transform/src/frontend/hash_context.ts +113 -0
- package/project-transform/src/frontend/hkt_macro.js +448 -0
- package/project-transform/src/frontend/hkt_macro.ts +897 -0
- package/project-transform/src/frontend/import_binding_usage.js +190 -0
- package/project-transform/src/frontend/import_binding_usage.ts +277 -0
- package/project-transform/src/frontend/macro_advanced_backend_adapter.js +58 -0
- package/project-transform/src/frontend/macro_advanced_backend_adapter.ts +123 -0
- package/project-transform/src/frontend/macro_advanced_context.js +826 -0
- package/project-transform/src/frontend/macro_advanced_context.ts +1102 -0
- package/project-transform/src/frontend/macro_advanced_output.js +21 -0
- package/project-transform/src/frontend/macro_advanced_output.ts +41 -0
- package/project-transform/src/frontend/macro_api.js +353 -0
- package/project-transform/src/frontend/macro_api.ts +1722 -0
- package/project-transform/src/frontend/macro_api_internal.js +35 -0
- package/project-transform/src/frontend/macro_api_internal.ts +80 -0
- package/project-transform/src/frontend/macro_api_module_support.js +39 -0
- package/project-transform/src/frontend/macro_api_module_support.ts +65 -0
- package/project-transform/src/frontend/macro_backend_adapter.js +272 -0
- package/project-transform/src/frontend/macro_backend_adapter.ts +420 -0
- package/project-transform/src/frontend/macro_context.js +816 -0
- package/project-transform/src/frontend/macro_context.ts +1105 -0
- package/project-transform/src/frontend/macro_debug.js +99 -0
- package/project-transform/src/frontend/macro_debug.ts +157 -0
- package/project-transform/src/frontend/macro_definition_support.js +28 -0
- package/project-transform/src/frontend/macro_definition_support.ts +73 -0
- package/project-transform/src/frontend/macro_errors.js +40 -0
- package/project-transform/src/frontend/macro_errors.ts +70 -0
- package/project-transform/src/frontend/macro_expander.js +919 -0
- package/project-transform/src/frontend/macro_expander.ts +1611 -0
- package/project-transform/src/frontend/macro_factory_support.js +176 -0
- package/project-transform/src/frontend/macro_factory_support.ts +263 -0
- package/project-transform/src/frontend/macro_host_ast_internal.js +64 -0
- package/project-transform/src/frontend/macro_host_ast_internal.ts +109 -0
- package/project-transform/src/frontend/macro_index.js +27 -0
- package/project-transform/src/frontend/macro_index.ts +50 -0
- package/project-transform/src/frontend/macro_loader.js +281 -0
- package/project-transform/src/frontend/macro_loader.ts +506 -0
- package/project-transform/src/frontend/macro_operand_semantics.js +838 -0
- package/project-transform/src/frontend/macro_operand_semantics.ts +1489 -0
- package/project-transform/src/frontend/macro_output.js +54 -0
- package/project-transform/src/frontend/macro_output.ts +123 -0
- package/project-transform/src/frontend/macro_parser.js +611 -0
- package/project-transform/src/frontend/macro_parser.ts +832 -0
- package/project-transform/src/frontend/macro_resolver.js +69 -0
- package/project-transform/src/frontend/macro_resolver.ts +125 -0
- package/project-transform/src/frontend/macro_rewrite.js +285 -0
- package/project-transform/src/frontend/macro_rewrite.ts +442 -0
- package/project-transform/src/frontend/macro_runtime_support.js +232 -0
- package/project-transform/src/frontend/macro_runtime_support.ts +324 -0
- package/project-transform/src/frontend/macro_scanner.js +393 -0
- package/project-transform/src/frontend/macro_scanner.ts +455 -0
- package/project-transform/src/frontend/macro_semantic_backend_adapter.js +87 -0
- package/project-transform/src/frontend/macro_semantic_backend_adapter.ts +166 -0
- package/project-transform/src/frontend/macro_semantic_context.js +5 -0
- package/project-transform/src/frontend/macro_semantic_context.ts +12 -0
- package/project-transform/src/frontend/macro_semantic_output.js +24 -0
- package/project-transform/src/frontend/macro_semantic_output.ts +47 -0
- package/project-transform/src/frontend/macro_semantic_types.js +1 -0
- package/project-transform/src/frontend/macro_semantic_types.ts +98 -0
- package/project-transform/src/frontend/macro_semantics.js +1172 -0
- package/project-transform/src/frontend/macro_semantics.ts +1502 -0
- package/project-transform/src/frontend/macro_site_kind_support.js +164 -0
- package/project-transform/src/frontend/macro_site_kind_support.ts +255 -0
- package/project-transform/src/frontend/macro_syntax_internal.js +1950 -0
- package/project-transform/src/frontend/macro_syntax_internal.ts +3338 -0
- package/project-transform/src/frontend/macro_templates.js +57 -0
- package/project-transform/src/frontend/macro_templates.ts +143 -0
- package/project-transform/src/frontend/macro_test_helpers.js +82 -0
- package/project-transform/src/frontend/macro_test_helpers.ts +136 -0
- package/project-transform/src/frontend/macro_types.js +1 -0
- package/project-transform/src/frontend/macro_types.ts +103 -0
- package/project-transform/src/frontend/macro_vm.js +39 -0
- package/project-transform/src/frontend/macro_vm.ts +113 -0
- package/project-transform/src/frontend/match_macro.js +885 -0
- package/project-transform/src/frontend/match_macro.ts +1220 -0
- package/project-transform/src/frontend/numeric_normalization.js +824 -0
- package/project-transform/src/frontend/numeric_normalization.ts +1380 -0
- package/project-transform/src/frontend/numeric_prelude.js +278 -0
- package/project-transform/src/frontend/numeric_prelude.ts +370 -0
- package/project-transform/src/frontend/project_frontend.js +2396 -0
- package/project-transform/src/frontend/project_frontend.ts +3776 -0
- package/project-transform/src/frontend/project_macro_support.js +1401 -0
- package/project-transform/src/frontend/project_macro_support.ts +2137 -0
- package/project-transform/src/frontend/sql_macro.js +175 -0
- package/project-transform/src/frontend/sql_macro.ts +254 -0
- package/project-transform/src/frontend/sql_stdlib_support.js +1 -0
- package/project-transform/src/frontend/sql_stdlib_support.ts +6 -0
- package/project-transform/src/frontend/std_package_support.js +228 -0
- package/project-transform/src/frontend/std_package_support.ts +400 -0
- package/project-transform/src/frontend/value_normalization.js +306 -0
- package/project-transform/src/frontend/value_normalization.ts +599 -0
- package/project-transform/src/lsp/project_service.js +4771 -0
- package/project-transform/src/lsp/project_service.ts +7580 -0
- package/project-transform/src/lsp/protocol.js +9 -0
- package/project-transform/src/lsp/protocol.ts +38 -0
- package/project-transform/src/lsp/server.js +355 -0
- package/project-transform/src/lsp/server.ts +671 -0
- package/project-transform/src/lsp/session.js +49 -0
- package/project-transform/src/lsp/session.ts +48 -0
- package/project-transform/src/lsp/timing.js +43 -0
- package/project-transform/src/lsp/timing.ts +76 -0
- package/project-transform/src/lsp/transport.js +205 -0
- package/project-transform/src/lsp/transport.ts +253 -0
- package/project-transform/src/lsp_main.js +5 -0
- package/project-transform/src/lsp_main.ts +7 -0
- package/project-transform/src/macros.d.ts +1 -0
- package/project-transform/src/macros.js +1 -0
- package/project-transform/src/macros.ts +1 -0
- package/project-transform/src/main.js +24 -0
- package/project-transform/src/main.ts +28 -0
- package/project-transform/src/platform/host.js +264 -0
- package/project-transform/src/platform/host.ts +343 -0
- package/project-transform/src/platform/path.js +8 -0
- package/project-transform/src/platform/path.ts +20 -0
- package/project-transform/src/public_macro_api/macro_api.d.ts +1054 -0
- package/project-transform/src/public_macro_api/macro_semantic_types.d.ts +66 -0
- package/project-transform/src/public_macro_api/macro_types.d.ts +70 -0
- package/project-transform/src/run_program.js +14 -0
- package/project-transform/src/run_program.ts +33 -0
- package/project-transform/src/runtime/materialize.js +371 -0
- package/project-transform/src/runtime/materialize.ts +502 -0
- package/project-transform/src/runtime/on_demand.js +203 -0
- package/project-transform/src/runtime/on_demand.ts +305 -0
- package/project-transform/src/runtime/source_maps.js +205 -0
- package/project-transform/src/runtime/source_maps.ts +297 -0
- package/project-transform/src/runtime/transform.js +148 -0
- package/project-transform/src/runtime/transform.ts +295 -0
- package/project-transform/src/service/types.js +1 -0
- package/project-transform/src/service/types.ts +22 -0
- package/project-transform/src/soundscript_packages.js +477 -0
- package/project-transform/src/soundscript_packages.ts +754 -0
- package/project-transform/src/soundscript_runtime_specifiers.js +88 -0
- package/project-transform/src/soundscript_runtime_specifiers.ts +96 -0
- package/project-transform/src/stdlib/async.d.ts +81 -0
- package/project-transform/src/stdlib/async.js +213 -0
- package/project-transform/src/stdlib/async.ts +315 -0
- package/project-transform/src/stdlib/codec.d.ts +32 -0
- package/project-transform/src/stdlib/codec.js +30 -0
- package/project-transform/src/stdlib/codec.ts +76 -0
- package/project-transform/src/stdlib/compare.d.ts +28 -0
- package/project-transform/src/stdlib/compare.js +115 -0
- package/project-transform/src/stdlib/compare.ts +151 -0
- package/project-transform/src/stdlib/css.d.ts +16 -0
- package/project-transform/src/stdlib/css.js +9 -0
- package/project-transform/src/stdlib/css.ts +28 -0
- package/project-transform/src/stdlib/debug.d.ts +2 -0
- package/project-transform/src/stdlib/debug.js +9 -0
- package/project-transform/src/stdlib/debug.ts +10 -0
- package/project-transform/src/stdlib/decode.d.ts +86 -0
- package/project-transform/src/stdlib/decode.js +254 -0
- package/project-transform/src/stdlib/decode.ts +390 -0
- package/project-transform/src/stdlib/derive.d.ts +6 -0
- package/project-transform/src/stdlib/derive.js +7 -0
- package/project-transform/src/stdlib/derive.ts +7 -0
- package/project-transform/src/stdlib/encode.d.ts +100 -0
- package/project-transform/src/stdlib/encode.js +130 -0
- package/project-transform/src/stdlib/encode.ts +259 -0
- package/project-transform/src/stdlib/failures.d.ts +23 -0
- package/project-transform/src/stdlib/failures.js +41 -0
- package/project-transform/src/stdlib/failures.ts +64 -0
- package/project-transform/src/stdlib/fetch.d.ts +67 -0
- package/project-transform/src/stdlib/fetch.js +5 -0
- package/project-transform/src/stdlib/fetch.ts +11 -0
- package/project-transform/src/stdlib/graphql.d.ts +16 -0
- package/project-transform/src/stdlib/graphql.js +9 -0
- package/project-transform/src/stdlib/graphql.ts +28 -0
- package/project-transform/src/stdlib/hash.d.ts +34 -0
- package/project-transform/src/stdlib/hash.js +110 -0
- package/project-transform/src/stdlib/hash.ts +188 -0
- package/project-transform/src/stdlib/hkt.d.ts +40 -0
- package/project-transform/src/stdlib/hkt.js +3 -0
- package/project-transform/src/stdlib/hkt.ts +41 -0
- package/project-transform/src/stdlib/index.d.ts +9 -0
- package/project-transform/src/stdlib/index.js +15 -0
- package/project-transform/src/stdlib/index.ts +23 -0
- package/project-transform/src/stdlib/json.d.ts +125 -0
- package/project-transform/src/stdlib/json.js +764 -0
- package/project-transform/src/stdlib/json.ts +1034 -0
- package/project-transform/src/stdlib/match.d.ts +11 -0
- package/project-transform/src/stdlib/match.js +13 -0
- package/project-transform/src/stdlib/match.ts +26 -0
- package/project-transform/src/stdlib/numerics.d.ts +523 -0
- package/project-transform/src/stdlib/numerics.js +1356 -0
- package/project-transform/src/stdlib/numerics.ts +1937 -0
- package/project-transform/src/stdlib/random.d.ts +19 -0
- package/project-transform/src/stdlib/random.js +3 -0
- package/project-transform/src/stdlib/random.ts +5 -0
- package/project-transform/src/stdlib/result.d.ts +68 -0
- package/project-transform/src/stdlib/result.js +139 -0
- package/project-transform/src/stdlib/result.ts +248 -0
- package/project-transform/src/stdlib/sql.d.ts +22 -0
- package/project-transform/src/stdlib/sql.js +23 -0
- package/project-transform/src/stdlib/sql.ts +53 -0
- package/project-transform/src/stdlib/text.d.ts +24 -0
- package/project-transform/src/stdlib/text.js +3 -0
- package/project-transform/src/stdlib/text.ts +4 -0
- package/project-transform/src/stdlib/thunk.d.ts +2 -0
- package/project-transform/src/stdlib/thunk.js +9 -0
- package/project-transform/src/stdlib/thunk.ts +15 -0
- package/project-transform/src/stdlib/typeclasses.d.ts +57 -0
- package/project-transform/src/stdlib/typeclasses.js +78 -0
- package/project-transform/src/stdlib/typeclasses.ts +173 -0
- package/project-transform/src/stdlib/url.d.ts +37 -0
- package/project-transform/src/stdlib/url.js +3 -0
- package/project-transform/src/stdlib/url.ts +4 -0
- package/project-transform/src/stdlib/value.d.ts +9 -0
- package/project-transform/src/stdlib/value.js +104 -0
- package/project-transform/src/stdlib/value.ts +133 -0
- package/project-transform/src/test_installed_stdlib.js +147 -0
- package/project-transform/src/test_installed_stdlib.ts +245 -0
- package/project-transform/src/test_macro_package_fixture.js +50 -0
- package/project-transform/src/test_macro_package_fixture.ts +68 -0
- package/project-transform/src/value_deep_safe.js +191 -0
- package/project-transform/src/value_deep_safe.ts +273 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const CHECKER_TIMING_ENV_VAR = 'SOUNDSCRIPT_CHECKER_TIMING';
|
|
2
|
+
const DEFAULT_CHECKER_TIMING_THRESHOLD_MS = 25;
|
|
3
|
+
|
|
4
|
+
export interface CheckerTimingMetadata {
|
|
5
|
+
[key: string]: boolean | number | string | undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface CheckerTimingOptions {
|
|
9
|
+
always?: boolean;
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
thresholdMs?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function getTimingEnvValue(): string | undefined {
|
|
15
|
+
if (typeof process !== 'undefined' && typeof process.env === 'object') {
|
|
16
|
+
const processValue = process.env[CHECKER_TIMING_ENV_VAR];
|
|
17
|
+
if (typeof processValue === 'string') {
|
|
18
|
+
return processValue;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const maybeDeno = globalThis as {
|
|
23
|
+
Deno?: {
|
|
24
|
+
env?: {
|
|
25
|
+
get(name: string): string | undefined;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
return maybeDeno.Deno?.env?.get(CHECKER_TIMING_ENV_VAR);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isCheckerTimingEnabled(
|
|
33
|
+
rawValue = getTimingEnvValue(),
|
|
34
|
+
): boolean {
|
|
35
|
+
return rawValue === '1' || rawValue === 'true';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function formatMetadata(metadata: CheckerTimingMetadata): string {
|
|
39
|
+
return Object.entries(metadata)
|
|
40
|
+
.filter(([, value]) => value !== undefined)
|
|
41
|
+
.map(([key, value]) => `${key}=${String(value)}`)
|
|
42
|
+
.join(' ');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function logCheckerTiming(
|
|
46
|
+
operation: string,
|
|
47
|
+
durationMs: number,
|
|
48
|
+
metadata: CheckerTimingMetadata = {},
|
|
49
|
+
options: CheckerTimingOptions = {},
|
|
50
|
+
): void {
|
|
51
|
+
const enabled = options.enabled ?? isCheckerTimingEnabled();
|
|
52
|
+
if (!enabled) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const thresholdMs = options.thresholdMs ?? DEFAULT_CHECKER_TIMING_THRESHOLD_MS;
|
|
57
|
+
if (!options.always && durationMs < thresholdMs) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const metadataText = formatMetadata(metadata);
|
|
62
|
+
const prefix = `[soundscript:checker] ${operation} ${durationMs.toFixed(1)}ms`;
|
|
63
|
+
console.error(metadataText.length > 0 ? `${prefix} ${metadataText}` : prefix);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function measureCheckerTiming<T>(
|
|
67
|
+
operation: string,
|
|
68
|
+
metadata: CheckerTimingMetadata,
|
|
69
|
+
fn: () => T,
|
|
70
|
+
options: CheckerTimingOptions = {},
|
|
71
|
+
): T {
|
|
72
|
+
const start = performance.now();
|
|
73
|
+
try {
|
|
74
|
+
return fn();
|
|
75
|
+
} finally {
|
|
76
|
+
logCheckerTiming(operation, performance.now() - start, metadata, options);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
function createUnsupportedFeature(kind, message, options = {}) {
|
|
2
|
+
return {
|
|
3
|
+
message,
|
|
4
|
+
hint: options.hint,
|
|
5
|
+
example: options.example,
|
|
6
|
+
metadata: {
|
|
7
|
+
rule: 'unsupported_feature',
|
|
8
|
+
featureId: `unsupported.${kind}`,
|
|
9
|
+
invariant: options.invariant ??
|
|
10
|
+
'This construct depends on JavaScript or TypeScript behavior that soundscript does not model directly.',
|
|
11
|
+
replacementFamily: options.replacementFamily ?? 'modeled_subset_rewrite',
|
|
12
|
+
fixability: options.fixability ?? 'local_rewrite',
|
|
13
|
+
counterexample: options.counterexample,
|
|
14
|
+
example: options.example,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function describeUnsupportedFeature(kind, options = {}) {
|
|
19
|
+
switch (kind) {
|
|
20
|
+
case 'accessors':
|
|
21
|
+
return createUnsupportedFeature(kind, 'Getters and setters are not supported in soundscript.', {
|
|
22
|
+
hint: 'Use ordinary fields or explicit methods like `getX()` and `setX(...)`.',
|
|
23
|
+
example: 'Replace `get value()` with a plain field or a method such as `value(): T { return this._value; }`.',
|
|
24
|
+
invariant: 'Accessor-backed state hides mutation and computation behind property reads and writes.',
|
|
25
|
+
replacementFamily: 'explicit_methods_or_fields',
|
|
26
|
+
});
|
|
27
|
+
case 'ambientAugmentation':
|
|
28
|
+
return createUnsupportedFeature(kind, 'Ambient `declare global` and `declare module` augmentations are not supported in soundscript.', {
|
|
29
|
+
hint: 'Move the augmentation to a `.d.ts` file or replace it with explicit runtime code.',
|
|
30
|
+
invariant: 'Global and module augmentation mutate foreign declaration surfaces outside checked local code.',
|
|
31
|
+
replacementFamily: 'ambient_declaration_boundary',
|
|
32
|
+
fixability: 'api_redesign',
|
|
33
|
+
});
|
|
34
|
+
case 'ambientEnum':
|
|
35
|
+
return createUnsupportedFeature(kind, 'Ambient `declare enum` declarations are not supported in soundscript.', {
|
|
36
|
+
hint: 'Use a `.d.ts` declaration or a string-union/tagged representation with real runtime code.',
|
|
37
|
+
invariant: 'Ambient enums describe runtime values without proving an honest local representation.',
|
|
38
|
+
replacementFamily: 'explicit_tagged_representation',
|
|
39
|
+
fixability: 'api_redesign',
|
|
40
|
+
});
|
|
41
|
+
case 'argumentsCallee':
|
|
42
|
+
return createUnsupportedFeature(kind, '`arguments.callee` is not supported in soundscript.', {
|
|
43
|
+
hint: 'Give the function a name and reference it directly.',
|
|
44
|
+
example: 'Write `function visit() { return visit(); }` instead of reading `arguments.callee`.',
|
|
45
|
+
invariant: 'Recursive references must stay explicit instead of depending on reflective call-frame state.',
|
|
46
|
+
replacementFamily: 'named_function_reference',
|
|
47
|
+
});
|
|
48
|
+
case 'argumentsObject':
|
|
49
|
+
return createUnsupportedFeature(kind, 'The `arguments` object is not supported in soundscript.', {
|
|
50
|
+
hint: 'Use rest parameters such as `(...args)` instead.',
|
|
51
|
+
example: 'Write `function sum(...values: number[]) {}` instead of indexing `arguments`.',
|
|
52
|
+
invariant: 'Function inputs must be explicit in the signature instead of reflected through an array-like object.',
|
|
53
|
+
replacementFamily: 'rest_parameters',
|
|
54
|
+
});
|
|
55
|
+
case 'arrayLengthConstructor':
|
|
56
|
+
return createUnsupportedFeature(kind, 'Length-only `Array(...)` construction is not supported in soundscript.', {
|
|
57
|
+
hint: 'Use an explicit array literal, or fill a new array through a loop or helper.',
|
|
58
|
+
invariant: 'Arrays must be constructed with an explicit element story rather than implicit holes.',
|
|
59
|
+
replacementFamily: 'dense_array_construction',
|
|
60
|
+
});
|
|
61
|
+
case 'bannedConstructor': {
|
|
62
|
+
const constructorName = options.name ?? 'This constructor';
|
|
63
|
+
return createUnsupportedFeature(kind, `Constructing \`${constructorName}\` is not supported in soundscript.`, {
|
|
64
|
+
hint: 'Use a supported primitive, container, or explicit helper instead of reflective or boxed construction.',
|
|
65
|
+
invariant: 'Only explicitly modeled runtime constructors are available inside soundscript.',
|
|
66
|
+
replacementFamily: 'modeled_runtime_constructor',
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
case 'bannedDeclarationFileTypeReference': {
|
|
70
|
+
const typeName = options.name ?? 'This type';
|
|
71
|
+
return createUnsupportedFeature(kind, `Type reference \`${typeName}\` is not supported in soundscript.`, {
|
|
72
|
+
hint: 'Use a supported primitive, `Promise<T>`, or another explicitly modeled surface instead.',
|
|
73
|
+
invariant: 'Declaration-only library types are only allowed when soundscript has an honest local model for them.',
|
|
74
|
+
replacementFamily: 'modeled_type_surface',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
case 'broadObjectEnumeration':
|
|
78
|
+
return createUnsupportedFeature(kind, '`Object.entries(...)` and `Object.values(...)` require a precisely typed object in soundscript.', {
|
|
79
|
+
hint: 'Project the value to known keys first, or enumerate a precise record/object type instead of a broad `object`.',
|
|
80
|
+
example: 'Prefer `const keys = ["id", "name"] as const; for (const key of keys) { ... }` over enumerating a broad `object`.',
|
|
81
|
+
invariant: 'Enumeration helpers need a known key set instead of a broad object surface.',
|
|
82
|
+
replacementFamily: 'precise_key_enumeration',
|
|
83
|
+
});
|
|
84
|
+
case 'classInterfaceMerge':
|
|
85
|
+
return createUnsupportedFeature(kind, 'Class/interface merging is not supported in soundscript.', {
|
|
86
|
+
hint: 'Rename one declaration or replace the merge with explicit composition.',
|
|
87
|
+
invariant: 'A declaration surface must come from one honest runtime shape instead of merged declarations.',
|
|
88
|
+
replacementFamily: 'explicit_composition',
|
|
89
|
+
fixability: 'api_redesign',
|
|
90
|
+
});
|
|
91
|
+
case 'commaOperator':
|
|
92
|
+
return createUnsupportedFeature(kind, 'The comma operator is not supported in soundscript.', {
|
|
93
|
+
hint: 'Split the expressions into separate statements.',
|
|
94
|
+
replacementFamily: 'statement_sequence',
|
|
95
|
+
});
|
|
96
|
+
case 'debuggerStatement':
|
|
97
|
+
return createUnsupportedFeature(kind, '`debugger` statements are not supported in soundscript.', {
|
|
98
|
+
hint: 'Remove the statement or replace it with explicit logging or tests.',
|
|
99
|
+
replacementFamily: 'explicit_debug_instrumentation',
|
|
100
|
+
});
|
|
101
|
+
case 'decorators':
|
|
102
|
+
return createUnsupportedFeature(kind, 'Decorators are not supported in soundscript.', {
|
|
103
|
+
hint: 'Use explicit wrapper calls or helper functions instead of decorator syntax.',
|
|
104
|
+
replacementFamily: 'explicit_wrapper_calls',
|
|
105
|
+
fixability: 'api_redesign',
|
|
106
|
+
});
|
|
107
|
+
case 'deleteExpression':
|
|
108
|
+
return createUnsupportedFeature(kind, '`delete` is not supported in soundscript.', {
|
|
109
|
+
hint: 'Create a new object without that property, or model absence explicitly with `undefined` or a union type.',
|
|
110
|
+
example: 'Write `const { removed, ...next } = obj;` or `next.value = undefined` instead of `delete obj.value`.',
|
|
111
|
+
invariant: 'Object shape changes must stay explicit instead of mutating property existence at runtime.',
|
|
112
|
+
replacementFamily: 'explicit_absence_modeling',
|
|
113
|
+
});
|
|
114
|
+
case 'disallowedThis':
|
|
115
|
+
return createUnsupportedFeature(kind, '`this` is not supported here in soundscript.', {
|
|
116
|
+
hint: 'Pass the value explicitly, or move the logic into an instance method or constructor.',
|
|
117
|
+
replacementFamily: 'explicit_receiver_parameter',
|
|
118
|
+
});
|
|
119
|
+
case 'eval':
|
|
120
|
+
return createUnsupportedFeature(kind, '`eval` is not supported in soundscript.', {
|
|
121
|
+
hint: 'Use explicit function calls, parsers, or interpreters instead of dynamic code execution.',
|
|
122
|
+
invariant: 'Runtime code execution bypasses the checked source surface.',
|
|
123
|
+
replacementFamily: 'parser_or_interpreter',
|
|
124
|
+
fixability: 'api_redesign',
|
|
125
|
+
});
|
|
126
|
+
case 'forIn':
|
|
127
|
+
return createUnsupportedFeature(kind, '`for...in` is not supported in soundscript.', {
|
|
128
|
+
hint: 'Iterate `Object.keys(obj)` on a precisely typed object instead.',
|
|
129
|
+
example: 'Write `for (const key of Object.keys(record) as Array<keyof typeof record>) { ... }` on a precise record.',
|
|
130
|
+
invariant: 'Property iteration must start from a precise, own-key view instead of prototype-sensitive enumeration.',
|
|
131
|
+
replacementFamily: 'precise_key_iteration',
|
|
132
|
+
});
|
|
133
|
+
case 'functionConstructor':
|
|
134
|
+
return createUnsupportedFeature(kind, 'The `Function` constructor is not supported in soundscript.', {
|
|
135
|
+
hint: 'Write a real function or parser instead of compiling code from strings at runtime.',
|
|
136
|
+
invariant: 'Runtime function compilation bypasses checked source.',
|
|
137
|
+
replacementFamily: 'ordinary_function_definition',
|
|
138
|
+
fixability: 'api_redesign',
|
|
139
|
+
});
|
|
140
|
+
case 'functionObjectMutation':
|
|
141
|
+
return createUnsupportedFeature(kind, 'Functions cannot be mutated like ordinary objects in soundscript.', {
|
|
142
|
+
hint: 'Keep mutable state in a separate object instead of attaching properties to the function.',
|
|
143
|
+
invariant: 'Callable behavior and mutable object state must stay on separate surfaces.',
|
|
144
|
+
replacementFamily: 'separate_callable_and_state',
|
|
145
|
+
});
|
|
146
|
+
case 'incompatibleStrictEquality':
|
|
147
|
+
return createUnsupportedFeature(kind, 'Strict equality in soundscript only compares values from the same primitive family (aside from nullish checks).', {
|
|
148
|
+
hint: 'Convert one side explicitly before comparing, or compare against `null`/`undefined` directly.',
|
|
149
|
+
invariant: 'Equality comparisons must stay inside one primitive family unless they are nullish checks.',
|
|
150
|
+
replacementFamily: 'explicit_primitive_conversion',
|
|
151
|
+
});
|
|
152
|
+
case 'labeledStatement':
|
|
153
|
+
return createUnsupportedFeature(kind, 'Labeled statements are not supported in soundscript.', {
|
|
154
|
+
hint: 'Refactor the control flow into helper functions or structured loops.',
|
|
155
|
+
replacementFamily: 'structured_control_flow',
|
|
156
|
+
});
|
|
157
|
+
case 'legacyAccessorApi':
|
|
158
|
+
return createUnsupportedFeature(kind, 'Legacy accessor APIs like `__defineGetter__` are not supported in soundscript.', {
|
|
159
|
+
hint: 'Use explicit methods or fields instead of runtime accessor patching.',
|
|
160
|
+
invariant: 'Accessor behavior must be visible in the declared surface instead of patched at runtime.',
|
|
161
|
+
replacementFamily: 'explicit_methods_or_fields',
|
|
162
|
+
});
|
|
163
|
+
case 'legacyFunctionMetadata':
|
|
164
|
+
return createUnsupportedFeature(kind, 'Legacy function metadata such as `caller` and `arguments` is not supported in soundscript.', {
|
|
165
|
+
hint: 'Pass the needed data explicitly instead of inspecting the function object.',
|
|
166
|
+
replacementFamily: 'explicit_data_flow',
|
|
167
|
+
});
|
|
168
|
+
case 'legacyOctalLiteral':
|
|
169
|
+
return createUnsupportedFeature(kind, 'Legacy octal literals and octal escape sequences are not supported in soundscript.', {
|
|
170
|
+
hint: 'Use modern `0o...` numeric literals and standard string escapes instead.',
|
|
171
|
+
replacementFamily: 'modern_literal_syntax',
|
|
172
|
+
});
|
|
173
|
+
case 'looseEquality':
|
|
174
|
+
return createUnsupportedFeature(kind, 'Loose equality (`==` / `!=`) is not supported in soundscript.', {
|
|
175
|
+
hint: 'Convert values explicitly, then use `===` or `!==`.',
|
|
176
|
+
example: 'Write `value === null` or `Number(text) === count` instead of relying on `==` coercion.',
|
|
177
|
+
invariant: 'Equality must not depend on JavaScript coercion rules.',
|
|
178
|
+
replacementFamily: 'strict_equality',
|
|
179
|
+
counterexample: 'Two values can compare equal through coercion even when their actual runtime families differ.',
|
|
180
|
+
});
|
|
181
|
+
case 'nonBooleanCondition':
|
|
182
|
+
return createUnsupportedFeature(kind, 'Conditions in soundscript must be boolean expressions.', {
|
|
183
|
+
hint: 'Write an explicit comparison or nullish check instead of relying on truthiness.',
|
|
184
|
+
example: 'Write `if (items.length > 0)` or `if (value !== null)` instead of `if (items)`.',
|
|
185
|
+
invariant: 'Control-flow conditions must be explicit booleans.',
|
|
186
|
+
replacementFamily: 'explicit_boolean_condition',
|
|
187
|
+
counterexample: 'Truthiness merges unrelated states such as `0`, `""`, `null`, and `undefined` into one branch decision.',
|
|
188
|
+
});
|
|
189
|
+
case 'nonBooleanLogicalNot':
|
|
190
|
+
return createUnsupportedFeature(kind, 'Logical `!` in soundscript requires a boolean operand.', {
|
|
191
|
+
hint: 'Write an explicit comparison or nullish check before negating.',
|
|
192
|
+
example: 'Write `count === 0` or `value === null` instead of `!count` or `!value`.',
|
|
193
|
+
invariant: 'Logical negation must invert an explicit boolean condition, not JavaScript truthiness.',
|
|
194
|
+
replacementFamily: 'explicit_boolean_negation',
|
|
195
|
+
counterexample: 'Truthiness-based negation collapses unrelated states such as `0`, `""`, `null`, and `undefined` into one boolean result.',
|
|
196
|
+
});
|
|
197
|
+
case 'nonBooleanLogicalOperator':
|
|
198
|
+
return createUnsupportedFeature(kind, 'Logical `&&` and `||` in soundscript require boolean operands.', {
|
|
199
|
+
hint: 'Write explicit comparisons before combining conditions.',
|
|
200
|
+
example: 'Write `isReady && count > 0` instead of `value && count` when every operand should be boolean.',
|
|
201
|
+
invariant: 'Logical operators must compose boolean conditions rather than value-carrying truthiness.',
|
|
202
|
+
replacementFamily: 'boolean_condition_composition',
|
|
203
|
+
});
|
|
204
|
+
case 'objectCreateNonNull':
|
|
205
|
+
return createUnsupportedFeature(kind, '`Object.create(...)` in soundscript only supports `Object.create(null)`.', {
|
|
206
|
+
hint: 'Use an object literal, class, or factory function for ordinary objects.',
|
|
207
|
+
example: 'Use `{}` or `class Example {}` for ordinary objects, and reserve `Object.create(null)` for deliberate null-prototype records.',
|
|
208
|
+
invariant: 'Ordinary objects and null-prototype objects are separate modeled families.',
|
|
209
|
+
replacementFamily: 'ordinary_object_or_null_record_factory',
|
|
210
|
+
});
|
|
211
|
+
case 'objectPrimitiveBoxing':
|
|
212
|
+
return createUnsupportedFeature(kind, '`Object(...)` cannot be used to box primitives in soundscript.', {
|
|
213
|
+
hint: 'Use the primitive value directly instead of creating a wrapper object.',
|
|
214
|
+
invariant: 'Primitive values stay as primitives rather than boxed wrapper objects.',
|
|
215
|
+
replacementFamily: 'primitive_value_direct_use',
|
|
216
|
+
});
|
|
217
|
+
case 'plusOperator':
|
|
218
|
+
return createUnsupportedFeature(kind, 'The `+` operator in soundscript only supports `string + string`, `number + number`, or `bigint + bigint`.', {
|
|
219
|
+
hint: 'Convert both operands to the same type before using `+`.',
|
|
220
|
+
invariant: 'The `+` operator must stay inside one primitive family.',
|
|
221
|
+
replacementFamily: 'explicit_operand_conversion',
|
|
222
|
+
});
|
|
223
|
+
case 'primitiveConversionHookCall':
|
|
224
|
+
return createUnsupportedFeature(kind, 'Calling `.toString()` or `.valueOf()` on arbitrary values is not supported in soundscript.', {
|
|
225
|
+
hint: 'Narrow the value first and use an explicit conversion helper instead of implicit primitive hooks.',
|
|
226
|
+
invariant: 'Primitive conversion must be explicit and type-directed instead of hook-driven.',
|
|
227
|
+
replacementFamily: 'explicit_conversion_helper',
|
|
228
|
+
});
|
|
229
|
+
case 'privateOrProtectedMember':
|
|
230
|
+
return createUnsupportedFeature(kind, 'TypeScript `private` and `protected` members are not supported in soundscript.', {
|
|
231
|
+
hint: 'Use module scoping, explicit APIs, or naming conventions instead.',
|
|
232
|
+
replacementFamily: 'module_scope_or_explicit_api',
|
|
233
|
+
});
|
|
234
|
+
case 'protoProperty':
|
|
235
|
+
return createUnsupportedFeature(kind, '`__proto__` is not supported in soundscript.', {
|
|
236
|
+
hint: 'Use ordinary objects, `BareObject`, or factory functions instead of mutating prototypes.',
|
|
237
|
+
example: 'Use `Object.create(null)` only for deliberate null-prototype records, otherwise prefer object literals or classes.',
|
|
238
|
+
invariant: 'Prototype identity must stay stable after construction.',
|
|
239
|
+
replacementFamily: 'stable_object_construction',
|
|
240
|
+
});
|
|
241
|
+
case 'prototypeMutation':
|
|
242
|
+
return createUnsupportedFeature(kind, "Changing an object's prototype is not supported in soundscript.", {
|
|
243
|
+
hint: 'Use ordinary objects, `BareObject`, or explicit factory functions instead of mutating prototypes.',
|
|
244
|
+
example: 'Construct the right object shape up front instead of calling `Object.setPrototypeOf(...)` later.',
|
|
245
|
+
invariant: 'Prototype identity must stay stable after construction.',
|
|
246
|
+
replacementFamily: 'stable_object_construction',
|
|
247
|
+
counterexample: 'Code that mutates an object prototype can silently change which properties and methods appear to exist.',
|
|
248
|
+
});
|
|
249
|
+
case 'proxyRevocable':
|
|
250
|
+
return createUnsupportedFeature(kind, '`Proxy.revocable(...)` is not supported in soundscript.', {
|
|
251
|
+
hint: 'Model the behavior with explicit wrapper objects instead of runtime proxies.',
|
|
252
|
+
replacementFamily: 'explicit_wrapper_objects',
|
|
253
|
+
fixability: 'api_redesign',
|
|
254
|
+
});
|
|
255
|
+
case 'reflectApplyPrimitiveHook':
|
|
256
|
+
return createUnsupportedFeature(kind, '`Reflect.apply(...)` cannot be used to invoke primitive-conversion hooks in soundscript.', {
|
|
257
|
+
hint: 'Use an explicit helper on a narrowed value instead of reflective primitive conversion.',
|
|
258
|
+
invariant: 'Primitive conversion must stay explicit rather than reflective.',
|
|
259
|
+
replacementFamily: 'explicit_conversion_helper',
|
|
260
|
+
});
|
|
261
|
+
case 'reflectConstructBannedConstructor':
|
|
262
|
+
return createUnsupportedFeature(kind, 'Reflective construction of unsupported constructors is not supported in soundscript.', {
|
|
263
|
+
hint: 'Call a supported constructor directly, or use a different modeled data structure.',
|
|
264
|
+
replacementFamily: 'modeled_runtime_constructor',
|
|
265
|
+
});
|
|
266
|
+
case 'reflectiveMetaObjectOperation':
|
|
267
|
+
return createUnsupportedFeature(kind, 'Reflective property-definition and own-keys APIs are not supported in soundscript.', {
|
|
268
|
+
hint: 'Use object literals and direct property access instead of runtime shape mutation or reflection.',
|
|
269
|
+
invariant: 'Object shape must come from explicit declarations rather than runtime meta-object surgery.',
|
|
270
|
+
replacementFamily: 'explicit_object_shape',
|
|
271
|
+
});
|
|
272
|
+
case 'reflectivePropertyMutation':
|
|
273
|
+
return createUnsupportedFeature(kind, 'Reflective mutation of function values is not supported in soundscript.', {
|
|
274
|
+
hint: 'Keep state separate from the callable instead of mutating the function object.',
|
|
275
|
+
invariant: 'Callable behavior and mutable object state must stay on separate surfaces.',
|
|
276
|
+
replacementFamily: 'separate_callable_and_state',
|
|
277
|
+
});
|
|
278
|
+
case 'relationalComparison':
|
|
279
|
+
return createUnsupportedFeature(kind, 'Relational comparisons in soundscript only support string-to-string, number-to-number, or bigint-to-bigint comparisons.', {
|
|
280
|
+
hint: 'Convert both sides to the same primitive family before comparing.',
|
|
281
|
+
invariant: 'Ordering comparisons must stay inside one primitive family.',
|
|
282
|
+
replacementFamily: 'explicit_primitive_conversion',
|
|
283
|
+
});
|
|
284
|
+
case 'scriptScopeInterfaceMerge':
|
|
285
|
+
return createUnsupportedFeature(kind, 'Script-scope interface merging is not supported in soundscript.', {
|
|
286
|
+
hint: 'Consolidate the interface into one declaration, or move the declarations into a module boundary.',
|
|
287
|
+
invariant: 'A declaration surface must come from one honest runtime shape instead of merged script-scope declarations.',
|
|
288
|
+
replacementFamily: 'single_declaration_surface',
|
|
289
|
+
fixability: 'api_redesign',
|
|
290
|
+
});
|
|
291
|
+
case 'sparseArrayLiteral':
|
|
292
|
+
return createUnsupportedFeature(kind, 'Sparse array literals are not supported in soundscript.', {
|
|
293
|
+
hint: 'Use explicit `undefined` entries or build the array programmatically.',
|
|
294
|
+
example: 'Write `[first, undefined, third]` instead of `[first, , third]`.',
|
|
295
|
+
invariant: 'Arrays must represent every element position explicitly.',
|
|
296
|
+
replacementFamily: 'dense_array_literal',
|
|
297
|
+
});
|
|
298
|
+
case 'symbolApi':
|
|
299
|
+
return createUnsupportedFeature(kind, '`Symbol` and `Symbol.for(...)` are not supported in soundscript.', {
|
|
300
|
+
hint: 'Use string literal tags or another explicit tagged-data representation instead.',
|
|
301
|
+
replacementFamily: 'string_literal_tags',
|
|
302
|
+
fixability: 'api_redesign',
|
|
303
|
+
});
|
|
304
|
+
case 'symbolHook':
|
|
305
|
+
return createUnsupportedFeature(kind, 'Custom `Symbol.*` protocol hooks are not supported in soundscript.', {
|
|
306
|
+
hint: 'Expose explicit methods instead of runtime meta-protocol hooks.',
|
|
307
|
+
replacementFamily: 'explicit_protocol_methods',
|
|
308
|
+
fixability: 'api_redesign',
|
|
309
|
+
});
|
|
310
|
+
case 'templateInterpolation':
|
|
311
|
+
return createUnsupportedFeature(kind, 'Template literal interpolations in soundscript must already be `string`.', {
|
|
312
|
+
hint: 'Convert the value to `string` before interpolating it.',
|
|
313
|
+
example: 'Write `` `${String(id)}` `` or an explicit formatter before interpolation.',
|
|
314
|
+
invariant: 'Template interpolation must not trigger implicit string coercion.',
|
|
315
|
+
replacementFamily: 'explicit_string_conversion',
|
|
316
|
+
});
|
|
317
|
+
case 'varDeclaration':
|
|
318
|
+
return createUnsupportedFeature(kind, '`var` declarations are not supported in soundscript.', {
|
|
319
|
+
hint: 'Use `const` for immutable bindings or `let` when reassignment is intentional.',
|
|
320
|
+
example: 'Write `const total = 0` or `let total = 0` instead of `var total = 0`.',
|
|
321
|
+
invariant: 'Binding kind must distinguish immutable and mutable locals explicitly.',
|
|
322
|
+
replacementFamily: 'explicit_binding_kind',
|
|
323
|
+
});
|
|
324
|
+
case 'voidZero':
|
|
325
|
+
return createUnsupportedFeature(kind, '`void 0` is not supported in soundscript.', {
|
|
326
|
+
hint: 'Use `undefined` directly.',
|
|
327
|
+
replacementFamily: 'direct_undefined_literal',
|
|
328
|
+
});
|
|
329
|
+
case 'withStatement':
|
|
330
|
+
return createUnsupportedFeature(kind, '`with` statements are not supported in soundscript.', {
|
|
331
|
+
hint: 'Read the properties you need into locals explicitly instead of changing name lookup rules.',
|
|
332
|
+
invariant: 'Name resolution must stay lexical and explicit.',
|
|
333
|
+
replacementFamily: 'explicit_local_bindings',
|
|
334
|
+
fixability: 'api_redesign',
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|