@soundscript/soundscript 0.1.13 → 0.1.16
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/decode.d.ts +2 -2
- package/decode.js.map +1 -1
- 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 +1116 -0
- package/project-transform/src/checker/rules/flow_invalidation.ts +2155 -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 +7015 -0
- package/project-transform/src/checker/rules/relations.ts +12364 -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
- package/soundscript/decode.sts +2 -2
package/decode.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ export class DecodeFailure extends Failure {
|
|
|
8
8
|
readonly path: DecodePath;
|
|
9
9
|
constructor(
|
|
10
10
|
message?: string,
|
|
11
|
-
options?: {
|
|
11
|
+
options?: Readonly<{
|
|
12
12
|
cause?: unknown;
|
|
13
13
|
path?: DecodePath;
|
|
14
14
|
trace?: readonly ErrorFrame[];
|
|
15
|
-
}
|
|
15
|
+
}>,
|
|
16
16
|
);
|
|
17
17
|
at(segment: DecodePathSegment): this;
|
|
18
18
|
}
|
package/decode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decode.js","sourceRoot":"","sources":["./soundscript/decode.sts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAA4B,MAAM,iCAAiC,CAAC;AAKvG,MAAM,OAAO,aAAc,SAAQ,OAAO;IAGxC,YACE,OAAO,GAAG,yBAAyB,EACnC,UAII,EAAE;QAEN,KAAK,CAAC,OAAO,EAAE;YACb,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;YAChE,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;SACjE,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,EAAE,CAAC,OAA0B;QAC3B,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,IAAc,CAAC,CAAC;QACxD,MAAM,KAAK,GAAG,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAS,CAAC;QAC5F,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,MAA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,MAAM,CACpB,OAAsB,EACtB,SAAmC,EACnC,OAAe;IAEf,OAAO;QACL,MAAM,CAAC,KAAK;YACV,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnB,OAAO,OAAO,CAAC;YACjB,CAAC;YAED,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC7B,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;gBACnB,CAAC,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAI,KAAQ,EAAE,OAA0B;IACpE,OAAO,KAAK,YAAY,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACpE,CAAC;AAED,SAAS,iBAAiB,CACxB,KAAgC;IAEhC,OAAO,uBAAuB,IAAI,KAAK;QACrC,KAAK,CAAC,qBAAqB,KAAK,IAAI,CAAC;AACzC,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,OAAO,CAAI,OAA8B;IAChD,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,CAAC","sourcesContent":["import { type ErrorFrame, Failure } from '@soundscript/soundscript/failures';\nimport { err, isErr, none, ok, some, type Option, type Result } from '@soundscript/soundscript/result';\n\nexport type DecodePathSegment = string | number;\nexport type DecodePath = readonly DecodePathSegment[];\n\nexport class DecodeFailure extends Failure {\n readonly path: DecodePath;\n\n constructor(\n message = 'Failed to decode value.',\n options: {\n cause?: unknown;\n path?: DecodePath;\n trace?: readonly ErrorFrame[];\n } = {},\n ) {\n super(message, {\n ...(options.cause === undefined ? {} : { cause: options.cause }),\n ...(options.trace === undefined ? {} : { trace: options.trace }),\n });\n this.path = options.path ?? [];\n }\n\n at(segment: DecodePathSegment): this {\n const prototype = Object.getPrototypeOf(this as object);\n const clone = (prototype === null ? Object.create(null) : Object.create(prototype)) as this;\n Object.defineProperties(clone, Object.getOwnPropertyDescriptors(this));\n Object.defineProperty(clone, 'path', {\n configurable: true,\n enumerable: true,\n writable: false,\n value: [segment, ...this.path],\n });\n return clone;\n }\n}\n\n// #[variance(T: out, E: out)]\nexport type Decoder<T, E = DecodeFailure> = {\n decode(value: unknown): Result<T, E>;\n};\n\n// #[variance(T: out, E: out)]\nexport type OptionalDecoder<T, E = DecodeFailure> = Decoder<T | undefined, E> & {\n readonly __soundscriptOptional: true;\n readonly inner: Decoder<T, E>;\n};\n\ntype DecoderValue<TDecoder> = TDecoder extends Decoder<infer TValue, unknown> ? TValue : never;\ntype DecoderError<TDecoder> = TDecoder extends Decoder<unknown, infer E> ? E : never;\n\ntype ObjectShape = Record<string, Decoder<unknown, unknown>>;\ntype TupleShape = readonly Decoder<unknown, unknown>[];\n\nexport const string: Decoder<string> = {\n decode(value): Result<string, DecodeFailure> {\n return typeof value === 'string'\n ? ok(value)\n : err(new DecodeFailure('Expected string.', { cause: value }));\n },\n};\n\nexport const number: Decoder<number> = {\n decode(value): Result<number, DecodeFailure> {\n return typeof value === 'number'\n ? ok(value)\n : err(new DecodeFailure('Expected number.', { cause: value }));\n },\n};\n\nexport const boolean: Decoder<boolean> = {\n decode(value): Result<boolean, DecodeFailure> {\n return typeof value === 'boolean'\n ? ok(value)\n : err(new DecodeFailure('Expected boolean.', { cause: value }));\n },\n};\n\nexport const bigint: Decoder<bigint> = {\n decode(value): Result<bigint, DecodeFailure> {\n if (typeof value === 'bigint') {\n return ok(value);\n }\n\n if (typeof value === 'number') {\n return Number.isInteger(value) && Number.isSafeInteger(value)\n ? ok(BigInt(value))\n : err(new DecodeFailure('Expected bigint.', { cause: value }));\n }\n\n if (typeof value === 'string') {\n try {\n return ok(BigInt(value));\n } catch {\n return err(new DecodeFailure('Expected bigint.', { cause: value }));\n }\n }\n\n return err(new DecodeFailure('Expected bigint.', { cause: value }));\n },\n};\n\nexport function lazy<T, E>(getDecoder: () => Decoder<T, E>): Decoder<T, E> {\n return {\n decode(value) {\n return getDecoder().decode(value);\n },\n };\n}\n\nexport function optional<T, E>(decoder: Decoder<T, E>): OptionalDecoder<T, E> {\n return {\n __soundscriptOptional: true,\n inner: decoder,\n decode(value) {\n return value === undefined ? ok(undefined) : decoder.decode(value);\n },\n };\n}\n\nexport function literal<const T extends string | number | boolean | null>(value: T): Decoder<T> {\n return {\n decode(input) {\n return Object.is(input, value)\n ? ok(value)\n : err(new DecodeFailure(`Expected literal ${JSON.stringify(value)}.`, { cause: input }));\n },\n };\n}\n\nexport function array<T, E>(item: Decoder<T, E>): Decoder<readonly T[], E | DecodeFailure> {\n return {\n decode(value) {\n if (!Array.isArray(value)) {\n return err(new DecodeFailure('Expected array.', { cause: value }));\n }\n\n const decodedValues: T[] = [];\n for (let index = 0; index < value.length; index += 1) {\n const decoded = item.decode(value[index]);\n if (isErr(decoded)) {\n return err(prependPathIfPossible(decoded.error, index));\n }\n decodedValues.push(decoded.value);\n }\n\n return ok(decodedValues);\n },\n };\n}\n\nexport function tuple<const TElements extends TupleShape>(\n ...elements: TElements\n): Decoder<\n { readonly [K in keyof TElements]: DecoderValue<TElements[K]> },\n DecoderError<TElements[number]> | DecodeFailure\n> {\n return {\n decode(value) {\n if (!Array.isArray(value)) {\n return err(new DecodeFailure('Expected tuple.', { cause: value }));\n }\n\n if (value.length !== elements.length) {\n return err(\n new DecodeFailure(`Expected tuple of length ${elements.length}.`, {\n cause: value,\n }),\n );\n }\n\n const decodedValues: unknown[] = [];\n for (let index = 0; index < elements.length; index += 1) {\n const elementDecoder = elements[index];\n if (!elementDecoder) {\n continue;\n }\n const decoded = elementDecoder.decode(value[index]);\n if (isErr(decoded)) {\n return err(\n prependPathIfPossible(decoded.error, index) as\n | DecoderError<TElements[number]>\n | DecodeFailure,\n );\n }\n decodedValues.push(decoded.value);\n }\n\n return ok(decodedValues as { readonly [K in keyof TElements]: DecoderValue<TElements[K]> });\n },\n };\n}\n\nexport function option<T, E>(item: Decoder<T, E>): Decoder<Option<T>, E | DecodeFailure> {\n return union(\n map(\n object({\n tag: literal('some'),\n value: item,\n }),\n (value) => some(value.value) as Option<T>,\n ),\n map(\n object({\n tag: literal('none'),\n }),\n () => none() as Option<T>,\n ),\n );\n}\n\nexport function result<T, EValue, EDecodeValue, EDecodeError>(\n okDecoder: Decoder<T, EDecodeValue>,\n errDecoder: Decoder<EValue, EDecodeError>,\n): Decoder<Result<T, EValue>, EDecodeValue | EDecodeError | DecodeFailure> {\n return union(\n map(\n object({\n tag: literal('ok'),\n value: okDecoder,\n }),\n (value) => ok(value.value) as Result<T, EValue>,\n ),\n map(\n object({\n tag: literal('err'),\n error: errDecoder,\n }),\n (value) => err(value.error) as Result<T, EValue>,\n ),\n );\n}\n\nexport function object<TShape extends ObjectShape>(\n shape: TShape,\n): Decoder<\n { readonly [K in keyof TShape]: DecoderValue<TShape[K]> },\n DecoderError<TShape[keyof TShape]> | DecodeFailure\n> {\n return {\n decode(value) {\n if (!isPlainObject(value)) {\n return err(new DecodeFailure('Expected object.', { cause: value }));\n }\n\n const record = value as Record<string, unknown>;\n const decodedObject: Record<string, unknown> = {};\n\n for (const key of Object.keys(shape)) {\n const decoder = shape[key];\n if (!decoder) {\n continue;\n }\n const hasKey = key in record;\n const rawValue = record[key];\n\n if (!hasKey || rawValue === undefined) {\n if (isOptionalDecoder(decoder)) {\n decodedObject[key] = undefined;\n continue;\n }\n\n return err(\n new DecodeFailure(`Missing field \"${key}\".`, {\n cause: value,\n path: [key],\n }),\n );\n }\n\n const decoded = decoder.decode(rawValue);\n if (isErr(decoded)) {\n return err(\n prependPathIfPossible(decoded.error, key) as\n | DecoderError<TShape[keyof TShape]>\n | DecodeFailure,\n );\n }\n\n decodedObject[key] = decoded.value;\n }\n\n return ok(decodedObject as { readonly [K in keyof TShape]: DecoderValue<TShape[K]> });\n },\n };\n}\n\nexport function field<K extends string, T, E>(\n key: K,\n decoder: Decoder<T, E>,\n): Decoder<T, E | DecodeFailure> {\n const shape = { [key]: decoder } as { readonly [P in K]: Decoder<T, E> };\n return map(object(shape), (value) => value[key]);\n}\n\nexport function optionalField<K extends string, T, E>(\n key: K,\n decoder: Decoder<T, E>,\n): Decoder<T | undefined, E | DecodeFailure> {\n const shape = { [key]: optional(decoder) } as {\n readonly [P in K]: OptionalDecoder<T, E>;\n };\n return map(object(shape), (value) => value[key]);\n}\n\nexport function union<A, B, ELeft, ERight>(\n left: Decoder<A, ELeft>,\n right: Decoder<B, ERight>,\n): Decoder<A | B, ELeft | ERight | DecodeFailure> {\n return {\n decode(value) {\n const leftDecoded = left.decode(value);\n if (isErr(leftDecoded)) {\n const rightDecoded = right.decode(value);\n if (isErr(rightDecoded)) {\n return err(\n new DecodeFailure('Expected one of the union members.', {\n cause: value,\n }),\n );\n }\n return rightDecoded;\n }\n return leftDecoded;\n },\n };\n}\n\nexport function map<A, B, E>(\n decoder: Decoder<A, E>,\n project: (value: A) => B,\n): Decoder<B, E> {\n return {\n decode(value) {\n const decoded = decoder.decode(value);\n return isErr(decoded) ? decoded : ok(project(decoded.value));\n },\n };\n}\n\nexport function andThen<A, B, E>(\n decoder: Decoder<A, E>,\n project: (value: A) => Decoder<B, E>,\n): Decoder<B, E> {\n return {\n decode(value) {\n const decoded = decoder.decode(value);\n return isErr(decoded) ? decoded : project(decoded.value).decode(valueOf(decoded));\n },\n };\n}\n\nexport function refine<A, B extends A, E>(\n decoder: Decoder<A, E>,\n predicate: (value: A) => value is B,\n message: string,\n): Decoder<B, E | DecodeFailure> {\n return {\n decode(value) {\n const decoded = decoder.decode(value);\n if (isErr(decoded)) {\n return decoded;\n }\n\n return predicate(decoded.value)\n ? ok(decoded.value)\n : err(new DecodeFailure(message, { cause: value }));\n },\n };\n}\n\nfunction prependPathIfPossible<E>(error: E, segment: DecodePathSegment): E | DecodeFailure {\n return error instanceof DecodeFailure ? error.at(segment) : error;\n}\n\nfunction isOptionalDecoder(\n value: Decoder<unknown, unknown>,\n): value is OptionalDecoder<unknown, unknown> {\n return '__soundscriptOptional' in value &&\n value.__soundscriptOptional === true;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction valueOf<T>(decoded: { readonly value: T }): T {\n return decoded.value;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"decode.js","sourceRoot":"","sources":["./soundscript/decode.sts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAA4B,MAAM,iCAAiC,CAAC;AAKvG,MAAM,OAAO,aAAc,SAAQ,OAAO;IAGxC,YACE,OAAO,GAAG,yBAAyB,EACnC,UAIK,EAAE;QAEP,KAAK,CAAC,OAAO,EAAE;YACb,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;YAChE,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;SACjE,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,EAAE,CAAC,OAA0B;QAC3B,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,IAAc,CAAC,CAAC;QACx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IAChD,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,CAAC","sourcesContent":["import { type ErrorFrame, Failure } from '@soundscript/soundscript/failures';\nimport { err, isErr, none, ok, some, type Option, type Result } from '@soundscript/soundscript/result';\n\nexport type DecodePathSegment = string | number;\nexport type DecodePath = readonly DecodePathSegment[];\n\nexport class DecodeFailure extends Failure {\n readonly path: DecodePath;\n\n constructor(\n message = 'Failed to decode value.',\n options: Readonly<{\n cause?: unknown;\n path?: DecodePath;\n trace?: readonly ErrorFrame[];\n }> = {},\n ) {\n super(message, {\n ...(options.cause === undefined ? {} : { cause: options.cause }),\n ...(options.trace === undefined ? {} : { trace: options.trace }),\n });\n this.path = options.path ?? [];\n }\n\n at(segment: DecodePathSegment): this {\n const prototype = Object.getPrototypeOf(this as object);\n const clone = (prototype === null ? Object.create(null) : Object.create(prototype)) as this;\n Object.defineProperties(clone, Object.getOwnPropertyDescriptors(this));\n Object.defineProperty(clone, 'path', {\n configurable: true,\n enumerable: true,\n writable: false,\n value: [segment, ...this.path],\n });\n return clone;\n }\n}\n\n// #[variance(T: out, E: out)]\nexport type Decoder<T, E = DecodeFailure> = {\n decode(value: unknown): Result<T, E>;\n};\n\n// #[variance(T: out, E: out)]\nexport type OptionalDecoder<T, E = DecodeFailure> = Decoder<T | undefined, E> & {\n readonly __soundscriptOptional: true;\n readonly inner: Decoder<T, E>;\n};\n\ntype DecoderValue<TDecoder> = TDecoder extends Decoder<infer TValue, unknown> ? TValue : never;\ntype DecoderError<TDecoder> = TDecoder extends Decoder<unknown, infer E> ? E : never;\n\ntype ObjectShape = Record<string, Decoder<unknown, unknown>>;\ntype TupleShape = readonly Decoder<unknown, unknown>[];\n\nexport const string: Decoder<string> = {\n decode(value): Result<string, DecodeFailure> {\n return typeof value === 'string'\n ? ok(value)\n : err(new DecodeFailure('Expected string.', { cause: value }));\n },\n};\n\nexport const number: Decoder<number> = {\n decode(value): Result<number, DecodeFailure> {\n return typeof value === 'number'\n ? ok(value)\n : err(new DecodeFailure('Expected number.', { cause: value }));\n },\n};\n\nexport const boolean: Decoder<boolean> = {\n decode(value): Result<boolean, DecodeFailure> {\n return typeof value === 'boolean'\n ? ok(value)\n : err(new DecodeFailure('Expected boolean.', { cause: value }));\n },\n};\n\nexport const bigint: Decoder<bigint> = {\n decode(value): Result<bigint, DecodeFailure> {\n if (typeof value === 'bigint') {\n return ok(value);\n }\n\n if (typeof value === 'number') {\n return Number.isInteger(value) && Number.isSafeInteger(value)\n ? ok(BigInt(value))\n : err(new DecodeFailure('Expected bigint.', { cause: value }));\n }\n\n if (typeof value === 'string') {\n try {\n return ok(BigInt(value));\n } catch {\n return err(new DecodeFailure('Expected bigint.', { cause: value }));\n }\n }\n\n return err(new DecodeFailure('Expected bigint.', { cause: value }));\n },\n};\n\nexport function lazy<T, E>(getDecoder: () => Decoder<T, E>): Decoder<T, E> {\n return {\n decode(value) {\n return getDecoder().decode(value);\n },\n };\n}\n\nexport function optional<T, E>(decoder: Decoder<T, E>): OptionalDecoder<T, E> {\n return {\n __soundscriptOptional: true,\n inner: decoder,\n decode(value) {\n return value === undefined ? ok(undefined) : decoder.decode(value);\n },\n };\n}\n\nexport function literal<const T extends string | number | boolean | null>(value: T): Decoder<T> {\n return {\n decode(input) {\n return Object.is(input, value)\n ? ok(value)\n : err(new DecodeFailure(`Expected literal ${JSON.stringify(value)}.`, { cause: input }));\n },\n };\n}\n\nexport function array<T, E>(item: Decoder<T, E>): Decoder<readonly T[], E | DecodeFailure> {\n return {\n decode(value) {\n if (!Array.isArray(value)) {\n return err(new DecodeFailure('Expected array.', { cause: value }));\n }\n\n const decodedValues: T[] = [];\n for (let index = 0; index < value.length; index += 1) {\n const decoded = item.decode(value[index]);\n if (isErr(decoded)) {\n return err(prependPathIfPossible(decoded.error, index));\n }\n decodedValues.push(decoded.value);\n }\n\n return ok(decodedValues);\n },\n };\n}\n\nexport function tuple<const TElements extends TupleShape>(\n ...elements: TElements\n): Decoder<\n { readonly [K in keyof TElements]: DecoderValue<TElements[K]> },\n DecoderError<TElements[number]> | DecodeFailure\n> {\n return {\n decode(value) {\n if (!Array.isArray(value)) {\n return err(new DecodeFailure('Expected tuple.', { cause: value }));\n }\n\n if (value.length !== elements.length) {\n return err(\n new DecodeFailure(`Expected tuple of length ${elements.length}.`, {\n cause: value,\n }),\n );\n }\n\n const decodedValues: unknown[] = [];\n for (let index = 0; index < elements.length; index += 1) {\n const elementDecoder = elements[index];\n if (!elementDecoder) {\n continue;\n }\n const decoded = elementDecoder.decode(value[index]);\n if (isErr(decoded)) {\n return err(\n prependPathIfPossible(decoded.error, index) as\n | DecoderError<TElements[number]>\n | DecodeFailure,\n );\n }\n decodedValues.push(decoded.value);\n }\n\n return ok(decodedValues as { readonly [K in keyof TElements]: DecoderValue<TElements[K]> });\n },\n };\n}\n\nexport function option<T, E>(item: Decoder<T, E>): Decoder<Option<T>, E | DecodeFailure> {\n return union(\n map(\n object({\n tag: literal('some'),\n value: item,\n }),\n (value) => some(value.value) as Option<T>,\n ),\n map(\n object({\n tag: literal('none'),\n }),\n () => none() as Option<T>,\n ),\n );\n}\n\nexport function result<T, EValue, EDecodeValue, EDecodeError>(\n okDecoder: Decoder<T, EDecodeValue>,\n errDecoder: Decoder<EValue, EDecodeError>,\n): Decoder<Result<T, EValue>, EDecodeValue | EDecodeError | DecodeFailure> {\n return union(\n map(\n object({\n tag: literal('ok'),\n value: okDecoder,\n }),\n (value) => ok(value.value) as Result<T, EValue>,\n ),\n map(\n object({\n tag: literal('err'),\n error: errDecoder,\n }),\n (value) => err(value.error) as Result<T, EValue>,\n ),\n );\n}\n\nexport function object<TShape extends ObjectShape>(\n shape: TShape,\n): Decoder<\n { readonly [K in keyof TShape]: DecoderValue<TShape[K]> },\n DecoderError<TShape[keyof TShape]> | DecodeFailure\n> {\n return {\n decode(value) {\n if (!isPlainObject(value)) {\n return err(new DecodeFailure('Expected object.', { cause: value }));\n }\n\n const record = value as Record<string, unknown>;\n const decodedObject: Record<string, unknown> = {};\n\n for (const key of Object.keys(shape)) {\n const decoder = shape[key];\n if (!decoder) {\n continue;\n }\n const hasKey = key in record;\n const rawValue = record[key];\n\n if (!hasKey || rawValue === undefined) {\n if (isOptionalDecoder(decoder)) {\n decodedObject[key] = undefined;\n continue;\n }\n\n return err(\n new DecodeFailure(`Missing field \"${key}\".`, {\n cause: value,\n path: [key],\n }),\n );\n }\n\n const decoded = decoder.decode(rawValue);\n if (isErr(decoded)) {\n return err(\n prependPathIfPossible(decoded.error, key) as\n | DecoderError<TShape[keyof TShape]>\n | DecodeFailure,\n );\n }\n\n decodedObject[key] = decoded.value;\n }\n\n return ok(decodedObject as { readonly [K in keyof TShape]: DecoderValue<TShape[K]> });\n },\n };\n}\n\nexport function field<K extends string, T, E>(\n key: K,\n decoder: Decoder<T, E>,\n): Decoder<T, E | DecodeFailure> {\n const shape = { [key]: decoder } as { readonly [P in K]: Decoder<T, E> };\n return map(object(shape), (value) => value[key]);\n}\n\nexport function optionalField<K extends string, T, E>(\n key: K,\n decoder: Decoder<T, E>,\n): Decoder<T | undefined, E | DecodeFailure> {\n const shape = { [key]: optional(decoder) } as {\n readonly [P in K]: OptionalDecoder<T, E>;\n };\n return map(object(shape), (value) => value[key]);\n}\n\nexport function union<A, B, ELeft, ERight>(\n left: Decoder<A, ELeft>,\n right: Decoder<B, ERight>,\n): Decoder<A | B, ELeft | ERight | DecodeFailure> {\n return {\n decode(value) {\n const leftDecoded = left.decode(value);\n if (isErr(leftDecoded)) {\n const rightDecoded = right.decode(value);\n if (isErr(rightDecoded)) {\n return err(\n new DecodeFailure('Expected one of the union members.', {\n cause: value,\n }),\n );\n }\n return rightDecoded;\n }\n return leftDecoded;\n },\n };\n}\n\nexport function map<A, B, E>(\n decoder: Decoder<A, E>,\n project: (value: A) => B,\n): Decoder<B, E> {\n return {\n decode(value) {\n const decoded = decoder.decode(value);\n return isErr(decoded) ? decoded : ok(project(decoded.value));\n },\n };\n}\n\nexport function andThen<A, B, E>(\n decoder: Decoder<A, E>,\n project: (value: A) => Decoder<B, E>,\n): Decoder<B, E> {\n return {\n decode(value) {\n const decoded = decoder.decode(value);\n return isErr(decoded) ? decoded : project(decoded.value).decode(valueOf(decoded));\n },\n };\n}\n\nexport function refine<A, B extends A, E>(\n decoder: Decoder<A, E>,\n predicate: (value: A) => value is B,\n message: string,\n): Decoder<B, E | DecodeFailure> {\n return {\n decode(value) {\n const decoded = decoder.decode(value);\n if (isErr(decoded)) {\n return decoded;\n }\n\n return predicate(decoded.value)\n ? ok(decoded.value)\n : err(new DecodeFailure(message, { cause: value }));\n },\n };\n}\n\nfunction prependPathIfPossible<E>(error: E, segment: DecodePathSegment): E | DecodeFailure {\n return error instanceof DecodeFailure ? error.at(segment) : error;\n}\n\nfunction isOptionalDecoder(\n value: Decoder<unknown, unknown>,\n): value is OptionalDecoder<unknown, unknown> {\n return '__soundscriptOptional' in value &&\n value.__soundscriptOptional === true;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction valueOf<T>(decoded: { readonly value: T }): T {\n return decoded.value;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soundscript/soundscript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -78,6 +78,11 @@
|
|
|
78
78
|
"types": "./index.d.ts",
|
|
79
79
|
"import": "./index.js"
|
|
80
80
|
},
|
|
81
|
+
"./project-transform": {
|
|
82
|
+
"types": "./project-transform/index.ts",
|
|
83
|
+
"import": "./project-transform/index.js",
|
|
84
|
+
"default": "./project-transform/index.js"
|
|
85
|
+
},
|
|
81
86
|
"./hkt": {
|
|
82
87
|
"types": "./hkt.d.ts",
|
|
83
88
|
"import": "./hkt.js"
|
|
@@ -163,6 +168,7 @@
|
|
|
163
168
|
"index.js",
|
|
164
169
|
"index.js.map",
|
|
165
170
|
"index.d.ts",
|
|
171
|
+
"project-transform/**",
|
|
166
172
|
"hkt.js",
|
|
167
173
|
"hkt.js.map",
|
|
168
174
|
"hkt.d.ts",
|
|
@@ -222,12 +228,15 @@
|
|
|
222
228
|
"numerics.d.ts",
|
|
223
229
|
"soundscript/**"
|
|
224
230
|
],
|
|
231
|
+
"dependencies": {
|
|
232
|
+
"typescript": "5.9.3"
|
|
233
|
+
},
|
|
225
234
|
"optionalDependencies": {
|
|
226
|
-
"@soundscript/cli-darwin-arm64": "0.1.
|
|
227
|
-
"@soundscript/cli-darwin-x64": "0.1.
|
|
228
|
-
"@soundscript/cli-linux-arm64": "0.1.
|
|
229
|
-
"@soundscript/cli-linux-x64": "0.1.
|
|
230
|
-
"@soundscript/cli-win32-x64": "0.1.
|
|
235
|
+
"@soundscript/cli-darwin-arm64": "0.1.16",
|
|
236
|
+
"@soundscript/cli-darwin-x64": "0.1.16",
|
|
237
|
+
"@soundscript/cli-linux-arm64": "0.1.16",
|
|
238
|
+
"@soundscript/cli-linux-x64": "0.1.16",
|
|
239
|
+
"@soundscript/cli-win32-x64": "0.1.16"
|
|
231
240
|
},
|
|
232
241
|
"repository": {
|
|
233
242
|
"type": "git",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createOnDemandTransformer } from './src/runtime/on_demand.ts';
|
|
2
|
+
export type {
|
|
3
|
+
OnDemandTransformer,
|
|
4
|
+
OnDemandTransformResult,
|
|
5
|
+
OnDemandTransformerOptions,
|
|
6
|
+
SyncOnDemandTransformer,
|
|
7
|
+
} from './src/runtime/on_demand.ts';
|
|
8
|
+
export { inlineSourceMapComment } from './src/runtime/source_maps.ts';
|