From af95d6e30eda420d7e48caff316755b90535a364 Mon Sep 17 00:00:00 2001 From: Ben Berman Date: Mon, 29 May 2023 17:07:21 -0400 Subject: [PATCH 1/4] Ben Berman: just add Cargo.toml/lock --- apps/sim-engine/Cargo.lock | 1677 ++++++++++++++++++++-- apps/sim-engine/lib/execution/Cargo.toml | 2 + 2 files changed, 1596 insertions(+), 83 deletions(-) diff --git a/apps/sim-engine/Cargo.lock b/apps/sim-engine/Cargo.lock index 968565c..4b841c4 100644 --- a/apps/sim-engine/Cargo.lock +++ b/apps/sim-engine/Cargo.lock @@ -2,6 +2,31 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aead" version = "0.3.2" @@ -67,6 +92,34 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom 0.2.7", + "once_cell", + "serde", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.4" @@ -109,7 +162,7 @@ checksum = "0609c78bd572f4edc74310dfb63a01f5609d53fa8b4dd7c4d98aef3b3e8d72d1" dependencies = [ "proc-macro-hack", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -118,6 +171,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7d0a018de4f6aa429b9d33d69edf69072b1c5b1cb8d3e4a5f7ef898fc3eb76" +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + [[package]] name = "arrow-format" version = "0.7.0" @@ -134,7 +193,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afc54f0b14083abaf6bc71cf1aeccd7831a24b1e29d07683ba9a4a0f6c5d9326" dependencies = [ - "ahash", + "ahash 0.7.6", "arrow-format", "bytemuck", "chrono", @@ -168,7 +227,20 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.99", +] + +[[package]] +name = "ast_node" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c704e2f6ee1a98223f5a7629a6ef0f3decb3b552ed282889dc957edff98ce1e6" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 1.0.99", ] [[package]] @@ -281,7 +353,7 @@ checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -301,12 +373,39 @@ dependencies = [ "winapi", ] +[[package]] +name = "auto_impl" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.99", +] + [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base-x" version = "0.2.11" @@ -319,12 +418,27 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "better_scoped_tls" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73e8ecdec39e98aa3b19e8cd0b8ed8f77ccb86a6b0b2dc7cd86d105438a2123" +dependencies = [ + "scoped-tls", +] + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84" + [[package]] name = "block-buffer" version = "0.9.0" @@ -334,6 +448,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "blocking" version = "1.2.0" @@ -348,6 +471,31 @@ dependencies = [ "once_cell", ] +[[package]] +name = "browserslist-rs" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bda9b4595376bf255f68dafb5dcc5b0e2842b38dc2a7b52c4e0bfe9fd1c651" +dependencies = [ + "ahash 0.8.3", + "anyhow", + "chrono", + "either", + "getrandom 0.2.7", + "itertools", + "js-sys", + "nom", + "once_cell", + "quote", + "serde", + "serde-wasm-bindgen", + "serde_json", + "string_cache", + "string_cache_codegen", + "thiserror", + "wasm-bindgen", +] + [[package]] name = "bstr" version = "0.2.17" @@ -383,7 +531,7 @@ checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -418,13 +566,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "fdbc37d37da9e5bce8173f3a41b71d9bf3c674deebbaceacd0ebdabde76efb03" dependencies = [ + "android-tzdata", "iana-time-zone", - "num-integer", + "js-sys", "num-traits", + "time 0.1.45", + "wasm-bindgen", "winapi", ] @@ -444,7 +595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_derive", "clap_lex", "indexmap", @@ -464,7 +615,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -598,6 +749,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "crypto-mac" version = "0.10.1" @@ -637,7 +798,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" dependencies = [ "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -680,6 +841,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "dashmap" +version = "5.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3495912c9c1ccf2e18976439f4443f3fee0fd61f424ff99fde6a66b15ecb448f" +dependencies = [ + "cfg-if", + "hashbrown", + "lock_api", + "parking_lot_core 0.9.3", +] + +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + [[package]] name = "digest" version = "0.9.0" @@ -689,6 +868,16 @@ dependencies = [ "generic-array", ] +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + [[package]] name = "discard" version = "1.0.4" @@ -726,7 +915,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.99", "synstructure", ] @@ -770,6 +959,8 @@ dependencies = [ "serde", "serde_json", "stateful", + "swc", + "swc_common", "thiserror", "tokio", "tracing", @@ -832,13 +1023,19 @@ dependencies = [ "instant", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flatbuffers" version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b428b715fdbdd1c364b84573b5fdc0f84f8e423661b9f398735278bc7f2b6a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "smallvec", "thiserror", ] @@ -884,14 +1081,25 @@ checksum = "ee1b05cbd864bcaecbd3455d6d967862d446e4ebfc3c2e5e5b9841e53cba6673" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] +[[package]] +name = "from_variant" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d449976075322384507443937df2f1d5577afbf4282f12a5a66ef29fa3e6307" +dependencies = [ + "pmutil", + "proc-macro2", + "swc_macros_common", + "syn 1.0.99", +] + [[package]] name = "fslock" version = "0.1.8" @@ -973,7 +1181,7 @@ checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -1034,8 +1242,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1048,6 +1258,12 @@ dependencies = [ "polyval", ] +[[package]] +name = "gimli" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" + [[package]] name = "glob" version = "0.3.0" @@ -1106,6 +1322,9 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] [[package]] name = "heck" @@ -1128,7 +1347,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" dependencies = [ - "digest", + "digest 0.9.0", "hmac", ] @@ -1139,7 +1358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ "crypto-mac", - "digest", + "digest 0.9.0", ] [[package]] @@ -1204,15 +1423,20 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] +[[package]] +name = "if_chain" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" + [[package]] name = "indexmap" version = "1.9.1" @@ -1221,6 +1445,7 @@ checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", + "serde", ] [[package]] @@ -1238,6 +1463,25 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "is-macro" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7d079e129b77477a49c5c4f1cfe9ce6c2c909ef52520693e8e811a714c7b20" +dependencies = [ + "Inflector", + "pmutil", + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "is_ci" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" + [[package]] name = "isahc" version = "0.9.14" @@ -1261,6 +1505,15 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.8" @@ -1288,6 +1541,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41ee439ee368ba4a77ac70d04f14015415af8600d6c894dc1f11bd79758c57d5" +[[package]] +name = "jsonc-parser" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b56a20e76235284255a09fcd1f45cf55d3c524ea657ebd3854735925c57743d" +dependencies = [ + "serde_json", +] + [[package]] name = "kdtree" version = "0.6.0" @@ -1312,6 +1574,79 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lexical" +version = "6.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6" +dependencies = [ + "lexical-core", +] + +[[package]] +name = "lexical-core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" +dependencies = [ + "lexical-parse-float", + "lexical-parse-integer", + "lexical-util", + "lexical-write-float", + "lexical-write-integer", +] + +[[package]] +name = "lexical-parse-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +dependencies = [ + "lexical-parse-integer", + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-parse-integer" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" +dependencies = [ + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-util" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +dependencies = [ + "static_assertions", +] + +[[package]] +name = "lexical-write-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +dependencies = [ + "lexical-util", + "lexical-write-integer", + "static_assertions", +] + +[[package]] +name = "lexical-write-integer" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +dependencies = [ + "lexical-util", + "static_assertions", +] + [[package]] name = "libc" version = "0.2.132" @@ -1366,6 +1701,15 @@ dependencies = [ "value-bag", ] +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown", +] + [[package]] name = "matchers" version = "0.1.0" @@ -1375,12 +1719,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "memchr" version = "2.5.0" @@ -1417,6 +1755,37 @@ dependencies = [ "uuid", ] +[[package]] +name = "miette" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" +dependencies = [ + "atty", + "backtrace", + "miette-derive", + "once_cell", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.99", +] + [[package]] name = "mime" version = "0.3.16" @@ -1433,6 +1802,21 @@ dependencies = [ "unicase", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.8.4" @@ -1458,13 +1842,19 @@ dependencies = [ "tracing", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + [[package]] name = "nix" version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", "cfg-if", "libc", @@ -1492,10 +1882,29 @@ dependencies = [ ] [[package]] -name = "num" -version = "0.4.0" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normpath" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a9da8c9922c35a1033d76f7272dfc2e7ee20392083d75aeea6ced23c6266578" +dependencies = [ + "winapi", +] + +[[package]] +name = "num" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" dependencies = [ "num-bigint", "num-complex", @@ -1514,6 +1923,7 @@ dependencies = [ "autocfg", "num-integer", "num-traits", + "serde", ] [[package]] @@ -1587,11 +1997,20 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.30.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.13.1" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "opaque-debug" @@ -1645,6 +2064,12 @@ version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + [[package]] name = "parking" version = "2.0.0" @@ -1699,11 +2124,77 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "path-clean" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros", + "phf_shared", + "proc-macro-hack", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] [[package]] name = "pin-project" @@ -1722,7 +2213,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -1752,6 +2243,17 @@ dependencies = [ "array-init-cursor", ] +[[package]] +name = "pmutil" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.99", +] + [[package]] name = "polling" version = "2.3.0" @@ -1783,6 +2285,30 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "preset_env_base" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a48d8ea8b031bde7755cdf6f87f7123a0cbefc36b0cd09cbb2de726594393" +dependencies = [ + "ahash 0.7.6", + "anyhow", + "browserslist-rs", + "dashmap", + "from_variant", + "once_cell", + "semver 1.0.17", + "serde", + "st-map", + "tracing", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1792,7 +2318,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.99", "version_check", ] @@ -1815,22 +2341,37 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + [[package]] name = "quote" -version = "1.0.21" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] +[[package]] +name = "radix_fmt" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce082a9940a7ace2ad4a8b7d0b1eac6aa378895f18be598230c5f2284ac05426" + [[package]] name = "rand" version = "0.7.3" @@ -1942,7 +2483,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1951,6 +2492,8 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] @@ -1969,13 +2512,25 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver", + "semver 0.9.0", ] [[package]] @@ -1990,6 +2545,12 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "ryu-js" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6518fc26bced4d53678a22d6e423e9d8716377def84545fe328236e3af070e7f" + [[package]] name = "schannel" version = "0.1.20" @@ -2000,6 +2561,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.1.0" @@ -2015,6 +2582,15 @@ dependencies = [ "semver-parser", ] +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +dependencies = [ + "serde", +] + [[package]] name = "semver-parser" version = "0.7.0" @@ -2041,6 +2617,17 @@ dependencies = [ "serde_json", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_derive" version = "1.0.144" @@ -2049,7 +2636,7 @@ checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2086,6 +2673,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha1" version = "0.6.1" @@ -2107,10 +2705,10 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest", + "digest 0.9.0", "opaque-debug", ] @@ -2171,6 +2769,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + [[package]] name = "slab" version = "0.4.7" @@ -2197,6 +2801,23 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + +[[package]] +name = "smawk" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" + [[package]] name = "socket2" version = "0.4.4" @@ -2207,6 +2828,21 @@ dependencies = [ "winapi", ] +[[package]] +name = "sourcemap" +version = "6.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed16231c92d0a6f0388f56e0ab2be24ecff1173f8e22f0ea5e074d0525631cb" +dependencies = [ + "data-encoding", + "if_chain", + "rustc_version", + "serde", + "serde_json", + "unicode-id", + "url", +] + [[package]] name = "spinning_top" version = "0.2.4" @@ -2216,6 +2852,35 @@ dependencies = [ "lock_api", ] +[[package]] +name = "st-map" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09d891835f076b0d4a58dd4478fb54d47aa3da1f7a4c6e89ad6c791357ab5ed" +dependencies = [ + "arrayvec", + "static-map-macro", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stacker" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "winapi", +] + [[package]] name = "standback" version = "0.2.17" @@ -2246,6 +2911,24 @@ dependencies = [ "uuid", ] +[[package]] +name = "static-map-macro" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b862d598fbc9f7085b017890e2e61433f501e7467f2c585323e1aa3c07ef8599" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "stdweb" version = "0.4.20" @@ -2270,7 +2953,7 @@ dependencies = [ "quote", "serde", "serde_derive", - "syn", + "syn 1.0.99", ] [[package]] @@ -2286,7 +2969,7 @@ dependencies = [ "serde_derive", "serde_json", "sha1", - "syn", + "syn 1.0.99", ] [[package]] @@ -2295,6 +2978,45 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot 0.12.1", + "phf_shared", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "string_enum" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0090512bdfee4b56d82480d66c0fd8a6f53f0fe0f97e075e949b252acdd482e0" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 1.0.99", +] + [[package]] name = "strsim" version = "0.10.0" @@ -2307,6 +3029,34 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "supports-color" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" +dependencies = [ + "atty", + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" +dependencies = [ + "atty", +] + +[[package]] +name = "supports-unicode" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" +dependencies = [ + "atty", +] + [[package]] name = "surf" version = "2.3.2" @@ -2331,25 +3081,717 @@ dependencies = [ ] [[package]] -name = "syn" -version = "1.0.99" +name = "swc" +version = "0.261.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "bafeb2f0a45583e39e5b0cc3e9b9de06912b4562e175f3cd48bfc16241586ff7" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" + "ahash 0.7.6", + "anyhow", + "base64", + "dashmap", + "either", + "indexmap", + "jsonc-parser", + "lru", + "once_cell", + "parking_lot 0.12.1", + "pathdiff", + "regex", + "rustc-hash", + "serde", + "serde_json", + "sourcemap", + "swc_atoms", + "swc_cached", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_ext_transforms", + "swc_ecma_lints", + "swc_ecma_loader", + "swc_ecma_minifier", + "swc_ecma_parser", + "swc_ecma_preset_env", + "swc_ecma_transforms", + "swc_ecma_transforms_base", + "swc_ecma_transforms_compat", + "swc_ecma_transforms_optimization", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_error_reporters", + "swc_node_comments", + "swc_timer", + "swc_visit", + "tracing", + "url", +] + +[[package]] +name = "swc_atoms" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d0307dc4bfd107d49c7528350c372758cfca94fb503629b9a056e6a1572860" +dependencies = [ + "once_cell", + "rustc-hash", + "serde", + "string_cache", + "string_cache_codegen", + "triomphe", +] + +[[package]] +name = "swc_cached" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9745d42d167cb60aeb1e85d2ee813ca455c3185bf7417f11fd102d745ae2b9e1" +dependencies = [ + "ahash 0.7.6", + "anyhow", + "dashmap", + "once_cell", + "regex", + "serde", +] + +[[package]] +name = "swc_common" +version = "0.31.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20fd4a53e21f2fd0c184a6391b505eacafa1e1b596ff1199abf723107c9c24f7" +dependencies = [ + "ahash 0.7.6", + "ast_node", + "better_scoped_tls", + "cfg-if", + "either", + "from_variant", + "new_debug_unreachable", + "num-bigint", + "once_cell", + "parking_lot 0.12.1", + "rustc-hash", + "serde", + "siphasher", + "sourcemap", + "string_cache", + "swc_atoms", + "swc_eq_ignore_macros", + "swc_visit", + "tracing", + "unicode-width", + "url", +] + +[[package]] +name = "swc_config" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89c8fc2c12bb1634c7c32fc3c9b6b963ad8f034cc62c4ecddcf215dc4f6f959d" +dependencies = [ + "indexmap", + "serde", + "serde_json", + "swc_config_macro", +] + +[[package]] +name = "swc_config_macro" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dadb9998d4f5fc36ef558ed5a092579441579ee8c6fcce84a5228cca9df4004" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 1.0.99", +] + +[[package]] +name = "swc_ecma_ast" +version = "0.104.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed057aa0db9150059f2129175970c6f54249fa6fe877c31073923e554906e9b5" +dependencies = [ + "bitflags 2.3.1", + "is-macro", + "num-bigint", + "scoped-tls", + "serde", + "string_enum", + "swc_atoms", + "swc_common", + "unicode-id", +] + +[[package]] +name = "swc_ecma_codegen" +version = "0.139.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be1f15631f3d10a010927beced91945dbc266f067ce937415814c3afcd987e6" +dependencies = [ + "memchr", + "num-bigint", + "once_cell", + "rustc-hash", + "serde", + "sourcemap", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_codegen_macros", + "tracing", +] + +[[package]] +name = "swc_ecma_codegen_macros" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ee0caee1018808d94ecd09490cb7affd3d504b19aa11c49238f5fc4b54901" dependencies = [ + "pmutil", "proc-macro2", "quote", - "syn", + "swc_macros_common", + "syn 1.0.99", +] + +[[package]] +name = "swc_ecma_ext_transforms" +version = "0.103.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7a2d99c3ba596c08b7c4815f7bfb1c225671205db2289606b2890e0b8c42f93" +dependencies = [ + "phf", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_lints" +version = "0.82.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e24aeb2b3406fa5b654cc3772475d5cb226072fec0679be470c30c7911c670" +dependencies = [ + "ahash 0.7.6", + "auto_impl", + "dashmap", + "parking_lot 0.12.1", + "rayon", + "regex", + "serde", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_loader" +version = "0.43.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace7885cc24831a0fd5fbbb1651682297f33a6ac6ec03278a3beb0af35a0bd59" +dependencies = [ + "ahash 0.7.6", + "anyhow", + "dashmap", + "lru", + "normpath", + "once_cell", + "parking_lot 0.12.1", + "path-clean", + "pathdiff", + "serde", + "serde_json", + "swc_cached", + "swc_common", + "tracing", +] + +[[package]] +name = "swc_ecma_minifier" +version = "0.181.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad046c046a41e35515ac163bfa88bc25293753356a6a273cf5122f4bc9f76972" +dependencies = [ + "ahash 0.7.6", + "arrayvec", + "indexmap", + "num-bigint", + "num_cpus", + "once_cell", + "parking_lot 0.12.1", + "radix_fmt", + "regex", + "rustc-hash", + "ryu-js", + "serde", + "serde_json", + "swc_atoms", + "swc_cached", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_optimization", + "swc_ecma_usage_analyzer", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_timer", + "tracing", +] + +[[package]] +name = "swc_ecma_parser" +version = "0.134.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f687ebf8b158ea866b42b5c7b5da723937b6bffd968211385563ae6f63498c" +dependencies = [ + "either", + "lexical", + "num-bigint", + "serde", + "smallvec", + "smartstring", + "stacker", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "tracing", + "typed-arena", +] + +[[package]] +name = "swc_ecma_preset_env" +version = "0.195.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26aa16890bdef4a994a3d42e2f132e9360b4fef5fd207b87c6fe408ef2f78b91" +dependencies = [ + "ahash 0.7.6", + "anyhow", + "dashmap", + "indexmap", + "once_cell", + "preset_env_base", + "semver 1.0.17", + "serde", + "serde_json", + "st-map", + "string_enum", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms" +version = "0.218.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e1a7ef24bb0acf913eac0e39dba5df047898e601fac5688b4bc274ad92e088" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_compat", + "swc_ecma_transforms_module", + "swc_ecma_transforms_optimization", + "swc_ecma_transforms_proposal", + "swc_ecma_transforms_react", + "swc_ecma_transforms_typescript", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_base" +version = "0.127.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e15d0b062e21e00575d87e9345ad091393606e9db5d559fddb48fbc0316c9f37" +dependencies = [ + "better_scoped_tls", + "bitflags 2.3.1", + "indexmap", + "once_cell", + "phf", + "rustc-hash", + "serde", + "smallvec", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_utils", + "swc_ecma_visit", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_classes" +version = "0.116.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14097a936e02feaa98214dc969052e4aa72d5846d7f266ccd77f321abbc4c1d0" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_compat" +version = "0.153.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92b30fef227a72a6ff223a54160699c4ea6906a8ca8f28f75d8af1a7407f7a0" +dependencies = [ + "ahash 0.7.6", + "arrayvec", + "indexmap", + "is-macro", + "num-bigint", + "serde", + "smallvec", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_classes", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "984d5ac69b681fc5438f9abf82b0fda34fe04e119bc75f8213b7e01128c7c9a2" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 1.0.99", +] + +[[package]] +name = "swc_ecma_transforms_module" +version = "0.170.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c23711b106ed4545cb9682fddbc8144415e45833b41261ed34e47a14797c340" +dependencies = [ + "Inflector", + "ahash 0.7.6", + "anyhow", + "bitflags 2.3.1", + "indexmap", + "is-macro", + "path-clean", + "pathdiff", + "regex", + "serde", + "swc_atoms", + "swc_cached", + "swc_common", + "swc_ecma_ast", + "swc_ecma_loader", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_optimization" +version = "0.187.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcaad3e318530ca9057859d194228f5ab542fbcd7b047746017ec8e06812d58e" +dependencies = [ + "ahash 0.7.6", + "dashmap", + "indexmap", + "once_cell", + "petgraph", + "rustc-hash", + "serde_json", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_fast_graph", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_proposal" +version = "0.161.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b985329ea8c6b2478c8eb39353cdff7f0ac6fb0f4730e9ddc308a70b58f1c52" +dependencies = [ + "either", + "rustc-hash", + "serde", + "smallvec", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_classes", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_react" +version = "0.173.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2dd2a040feb697f028fe88e5b0ce26e5e7741bbdfeebdf4990886c3754e40cf" +dependencies = [ + "ahash 0.7.6", + "base64", + "dashmap", + "indexmap", + "once_cell", + "serde", + "sha-1", + "string_enum", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_typescript" +version = "0.177.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b8eb074d4e90a5f2efa4daeab80680a065f532ca75da87cc53b551057d5e8e" +dependencies = [ + "serde", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_react", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_usage_analyzer" +version = "0.13.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cebb989c8eb597cee4d02c23d4bad266707e41a14420cf4d86775419756aff91" +dependencies = [ + "ahash 0.7.6", + "indexmap", + "rustc-hash", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_timer", + "tracing", +] + +[[package]] +name = "swc_ecma_utils" +version = "0.117.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91a45b955ec94b185c5e9ea3ab2bc55fc086ffde62cf035cbefd1b736651641d" +dependencies = [ + "indexmap", + "num_cpus", + "once_cell", + "rustc-hash", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_visit", + "tracing", + "unicode-id", +] + +[[package]] +name = "swc_ecma_visit" +version = "0.90.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "580203f0f520e9fbb0a8eed6bf841e7513b2c4fc64113c2144c80a7150170778" +dependencies = [ + "num-bigint", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_visit", + "tracing", +] + +[[package]] +name = "swc_eq_ignore_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c20468634668c2bbab581947bb8c75c97158d5a6959f4ba33df20983b20b4f6" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "swc_error_reporters" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40447c9a45f005713fd7471e212e06283f29a97ecd330b515f2813f6bc2c52a1" +dependencies = [ + "anyhow", + "miette", + "once_cell", + "parking_lot 0.12.1", + "swc_common", +] + +[[package]] +name = "swc_fast_graph" +version = "0.19.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8028a7ce23426f6afd2c49a36ab6220d34f358527dadad163ed5847b32d9c76" +dependencies = [ + "indexmap", + "petgraph", + "rustc-hash", + "swc_common", +] + +[[package]] +name = "swc_macros_common" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e582c3e3c2269238524923781df5be49e011dbe29cf7683a2215d600a562ea6" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "swc_node_comments" +version = "0.18.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5773506ea76f6a1b8282078a2a4e8d437a8ef522193923649d87155ae7e676b" +dependencies = [ + "ahash 0.7.6", + "dashmap", + "swc_atoms", + "swc_common", +] + +[[package]] +name = "swc_timer" +version = "0.19.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51ead4ffe0e69ac6a7aa7014e1b1ddd47da05ec4330787bf4a0cbcdae43e0538" +dependencies = [ + "tracing", +] + +[[package]] +name = "swc_trace_macro" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4795c8d23e0de62eef9cac0a20ae52429ee2ffc719768e838490f195b7d7267" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "swc_visit" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f412dd4fbc58f509a04e64f5c8038333142fc139e8232f01b883db0094b3b51" +dependencies = [ + "either", + "swc_visit_macros", +] + +[[package]] +name = "swc_visit_macros" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfc226380ba54a5feed2c12f3ccd33f1ae8e959160290e5d2d9b4e918b6472a" +dependencies = [ + "Inflector", + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 1.0.99", +] + +[[package]] +name = "syn" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.99", "unicode-xid", ] @@ -2372,11 +3814,26 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "textwrap" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] [[package]] name = "thiserror" @@ -2395,7 +3852,7 @@ checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2407,6 +3864,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + [[package]] name = "time" version = "0.2.27" @@ -2453,7 +3921,7 @@ dependencies = [ "proc-macro2", "quote", "standback", - "syn", + "syn 1.0.99", ] [[package]] @@ -2497,7 +3965,7 @@ checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2541,7 +4009,7 @@ checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2629,6 +4097,16 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "triomphe" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" +dependencies = [ + "serde", + "stable_deref_trait", +] + [[package]] name = "trybuild" version = "1.0.64" @@ -2644,6 +4122,12 @@ dependencies = [ "toml", ] +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + [[package]] name = "typenum" version = "1.15.0" @@ -2665,12 +4149,28 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +[[package]] +name = "unicode-id" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a" + [[package]] name = "unicode-ident" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +[[package]] +name = "unicode-linebreak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" +dependencies = [ + "hashbrown", + "regex", +] + [[package]] name = "unicode-normalization" version = "0.1.21" @@ -2680,6 +4180,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + [[package]] name = "unicode-xid" version = "0.2.3" @@ -2698,13 +4204,12 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", "serde", ] @@ -2725,7 +4230,7 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4afe785c0357a4c1b0a6464ab72899e688d26eafc63e0b626e2ce2d35b147477" dependencies = [ - "bitflags", + "bitflags 1.3.2", "fslock", "lazy_static", "libc", @@ -2772,6 +4277,12 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2780,9 +4291,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2790,16 +4301,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.18", "wasm-bindgen-shared", ] @@ -2817,9 +4328,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2827,22 +4338,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "web-sys" diff --git a/apps/sim-engine/lib/execution/Cargo.toml b/apps/sim-engine/lib/execution/Cargo.toml index 458ac10..0b0b2ad 100644 --- a/apps/sim-engine/lib/execution/Cargo.toml +++ b/apps/sim-engine/lib/execution/Cargo.toml @@ -21,6 +21,8 @@ rand = "0.8.5" rayon = "1.5.3" serde = { version = "1.0.138", features = ["derive"] } serde_json = "1.0.82" +swc = "0.261.29" +swc_common = "0.31.11" thiserror = "1.0.31" tokio = { version = "1.19.2", features = ["macros", "rt", "sync", "process", "time"] } tracing = "0.1.35" From 57e958c38946f76a044d8daf25a8386e2ff3a62c Mon Sep 17 00:00:00 2001 From: Ben Berman Date: Mon, 4 Sep 2023 09:42:43 -0400 Subject: [PATCH 2/4] Allow behaviors to be written in TypeScript --- .../state/behavior_execution/behavior.rs | 13 +++ .../state/behavior_execution/config.rs | 11 ++- .../state/behavior_execution/package.js | 11 ++- .../execution/src/runner/javascript/error.rs | 3 + .../src/runner/javascript/modules.rs | 1 + .../execution/src/runner/javascript/task.rs | 2 +- .../lib/execution/src/runner/language.rs | 81 ++++++++++++++++++- .../lib/execution/src/runner/target.rs | 2 +- .../src/experiment/run.rs | 3 +- .../lib/experiment-structure/src/manifest.rs | 4 +- 10 files changed, 115 insertions(+), 16 deletions(-) diff --git a/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/behavior.rs b/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/behavior.rs index 0d38f25..09525cf 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/behavior.rs +++ b/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/behavior.rs @@ -31,6 +31,19 @@ impl Behavior { pub fn language(&self) -> Result { Language::from_file_name(&self.name) } + + /// Returns the source code the runner should execute internally, compiling + /// the user code if necessary. + /// May analyze the source code for validity. + pub fn get_runner_source(&self) -> Result> { + let language = self.language()?; + let compiled = self + .behavior_src + .as_ref() + .map(|src| language.compile_source(&self.name, &src)); + + compiled.transpose() + } } impl fmt::Debug for Behavior { diff --git a/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/config.rs b/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/config.rs index 091e6dd..d38ab42 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/config.rs +++ b/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/config.rs @@ -118,16 +118,19 @@ pub fn exp_init_message( let shared = behavior.shared(); let keys = behavior.keys(); - let language = Language::from_file_name(file_name) - .map_err(|_| Error::from("Couldn't get language from behavior file name"))?; + let language = shared.language().map_err(|_| { + Error::from(format!( + "Couldn't get language from behavior file name {file_name}" + )) + })?; let id = behavior_ids .name_to_index .get(shared.name.as_bytes()) .ok_or_else(|| Error::from("Couldn't get index from behavior name"))?; let source = shared - .behavior_src - .clone() + .get_runner_source()? .ok_or_else(|| Error::from("SharedBehavior didn't have an attached source"))?; + let required_field_keys = keys .inner .iter() diff --git a/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/package.js b/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/package.js index ee38e7e..32fcc74 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/package.js +++ b/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/package.js @@ -11,6 +11,8 @@ const BEHAVIOR_IDS_FIELD_KEY = "_PRIVATE_7_behavior_ids"; // middle of running the behavior execution package, but `__behaviors` // contains behavior ids and shouldn't be modified. +const supported_languages = ["JavaScript", "TypeScript"]; + const prepare_user_trace = (error, trace) => { let behavior_index = -1; for (var i = trace.length - 1; i >= 0; --i) { @@ -73,14 +75,17 @@ const load_behaviors = (experiment, behavior_descs) => { const behaviors = {}; for (var i = 0; i < behavior_descs.length; ++i) { const desc = behavior_descs[i]; - if (desc.language !== "JavaScript") { + + if (!supported_languages.includes(desc.language)) { behaviors[desc.id] = { language: desc.language, }; + continue; } const code = desc.source; + let fn; try { fn = new Function( @@ -102,7 +107,7 @@ const load_behaviors = (experiment, behavior_descs) => { trace.msg; throw new Error(JSON.stringify(trace)); } - + let t = typeof fn; if (t !== "function") { throw new TypeError( @@ -209,7 +214,7 @@ export const run_task = ( // We do this because behavior ids are shallow-loaded and // `b_id` is an Arrow Vec rather than a clean array const behavior = experiment.behaviors[[b_id.get(0), b_id.get(1)]]; - if (behavior.language !== "JavaScript") { + if (!supported_languages.includes(behavior.language)) { // TODO: A simple optimization would be to count the number of // next-up behaviors in each language (other than JS) and // (ignoring ties) choose the language with the most. This diff --git a/apps/sim-engine/lib/execution/src/runner/javascript/error.rs b/apps/sim-engine/lib/execution/src/runner/javascript/error.rs index a85b5b8..7e0d4f2 100644 --- a/apps/sim-engine/lib/execution/src/runner/javascript/error.rs +++ b/apps/sim-engine/lib/execution/src/runner/javascript/error.rs @@ -91,6 +91,9 @@ pub enum JavaScriptError { None => String::new() })] JavascriptException(String, Option), + + #[error("Could not compile TypeScript file {filename}: {error}")] + TypeScriptCompilation { filename: String, error: String }, } impl From<&str> for JavaScriptError { diff --git a/apps/sim-engine/lib/execution/src/runner/javascript/modules.rs b/apps/sim-engine/lib/execution/src/runner/javascript/modules.rs index 66cfaa5..1f3ce0c 100644 --- a/apps/sim-engine/lib/execution/src/runner/javascript/modules.rs +++ b/apps/sim-engine/lib/execution/src/runner/javascript/modules.rs @@ -42,6 +42,7 @@ pub(in crate::runner::javascript) fn import_module<'s>( let source_code = read_file(path).map_err(|err| { JavaScriptError::AccessJavascriptImport(path.to_string(), err.to_string()) })?; + let js_source_code = new_js_string(scope, &source_code); let js_path = new_js_string(scope, path); let source_map_url = v8::undefined(scope); diff --git a/apps/sim-engine/lib/execution/src/runner/javascript/task.rs b/apps/sim-engine/lib/execution/src/runner/javascript/task.rs index 6193b08..591b709 100644 --- a/apps/sim-engine/lib/execution/src/runner/javascript/task.rs +++ b/apps/sim-engine/lib/execution/src/runner/javascript/task.rs @@ -13,7 +13,7 @@ pub(in crate::runner::javascript) fn get_next_task<'s>( let target = target.to_rust_string_lossy(scope); match target.as_str() { - "JavaScript" => MessageTarget::JavaScript, + "JavaScript" | "TypeScript" => MessageTarget::JavaScript, "Python" => MessageTarget::Python, "Rust" => MessageTarget::Rust, "Dynamic" => MessageTarget::Dynamic, diff --git a/apps/sim-engine/lib/execution/src/runner/language.rs b/apps/sim-engine/lib/execution/src/runner/language.rs index ea736ee..a1492b1 100644 --- a/apps/sim-engine/lib/execution/src/runner/language.rs +++ b/apps/sim-engine/lib/execution/src/runner/language.rs @@ -2,7 +2,7 @@ use core::fmt; use serde::{Deserialize, Serialize}; -use crate::{Error, Result}; +use crate::{runner::JavaScriptError, Error, Result}; /// Supported languages #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -10,6 +10,7 @@ pub enum Language { JavaScript = 0, Python = 1, Rust = 2, + TypeScript = 3, } impl fmt::Display for Language { @@ -19,9 +20,13 @@ impl fmt::Display for Language { } impl Language { - pub const NUM: usize = 3; - pub const ORDERED: [Language; Self::NUM] = - [Language::JavaScript, Language::Python, Language::Rust]; + pub const NUM: usize = 4; + pub const ORDERED: [Language; Self::NUM] = [ + Language::JavaScript, + Language::Python, + Language::Rust, + Language::TypeScript, + ]; pub fn as_index(self) -> usize { self as usize @@ -43,8 +48,76 @@ impl Language { match file_path.extension().and_then(std::ffi::OsStr::to_str) { Some("py") => Ok(Language::Python), Some("js") => Ok(Language::JavaScript), + Some("ts") => Ok(Language::TypeScript), Some("rs") => Ok(Language::Rust), _ => Err(Error::ParseBehavior(file_name.to_string())), } } + + /// Add a compilation step if necessary, compiling from source code provided + /// by the user to the code that the runners can execute. + /// + /// TODO: Check validity of types + /// TODO: Add source map support + pub fn compile_source(&self, filename: &str, source: &str) -> Result { + if *self != Language::TypeScript { + return Ok(source.to_string()); + } + + strip_typescript(filename, source) + } + + /// Whether one language uses the same execution environment as another. + /// Useful for shared worker logic (the JavaScript worker is used for TypeScript support). + pub fn uses_same_runner(&self, other: &Language) -> bool { + match (self, other) { + (Language::JavaScript, Language::TypeScript) => true, + (Language::TypeScript, Language::JavaScript) => true, + _ => self == other, + } + } +} + +fn strip_typescript(filename: &str, source_code: &str) -> Result { + use std::sync::Arc; + + use swc::config::Options; + use swc_common::{errors::Handler, Globals}; + + eprintln!( + "Stripping typescript from {filename} (source code: {})", + source_code.len() + ); + + let source_map = Arc::new(Default::default()); + let compiler = swc::Compiler::new(Arc::clone(&source_map)); + let source_file = source_map.new_source_file( + swc_common::FileName::Real(filename.into()), + source_code.into(), + ); + + let handler = Handler::with_emitter_writer(Box::new(vec![]), Some(source_map)); + + let options = Options::default(); + + swc_common::GLOBALS.set(&Globals::default(), || { + let s = compiler.process_js_file(source_file, &handler, &options); + + match s { + Ok(v) => { + if handler.has_errors() { + Err(Error::JavaScript(JavaScriptError::TypeScriptCompilation { + filename: filename.to_string(), + error: "Invalid TypeScript".to_string(), + })) + } else { + Ok(v.code) + } + } + Err(_e) => Err(Error::JavaScript(JavaScriptError::TypeScriptCompilation { + filename: filename.to_string(), + error: "Invalid TypeScript".to_string(), + })), + } + }) } diff --git a/apps/sim-engine/lib/execution/src/runner/target.rs b/apps/sim-engine/lib/execution/src/runner/target.rs index 7b32a29..72a1f7a 100644 --- a/apps/sim-engine/lib/execution/src/runner/target.rs +++ b/apps/sim-engine/lib/execution/src/runner/target.rs @@ -37,7 +37,7 @@ impl From for MessageTarget { match l { Language::Rust => Self::Rust, Language::Python => Self::Python, - Language::JavaScript => Self::JavaScript, + Language::JavaScript | Language::TypeScript => Self::JavaScript, } } } diff --git a/apps/sim-engine/lib/experiment-structure/src/experiment/run.rs b/apps/sim-engine/lib/experiment-structure/src/experiment/run.rs index 904c9a5..1357dd9 100644 --- a/apps/sim-engine/lib/experiment-structure/src/experiment/run.rs +++ b/apps/sim-engine/lib/experiment-structure/src/experiment/run.rs @@ -68,6 +68,7 @@ impl ExperimentRun { #[allow(clippy::match_like_matches_macro)] let requires_init = match (language, &self.simulation.package_init.initial_state.name) { (Language::JavaScript, InitialStateName::InitJs) => true, + (Language::TypeScript, InitialStateName::InitJs) => true, (Language::Python, InitialStateName::InitPy) => true, _ => false, }; @@ -81,7 +82,7 @@ impl ExperimentRun { .any(|behavior| { behavior .language() - .map(|behavior_lang| behavior_lang == language) + .map(|behavior_lang| behavior_lang.uses_same_runner(&language)) .unwrap_or(false) }) } diff --git a/apps/sim-engine/lib/experiment-structure/src/manifest.rs b/apps/sim-engine/lib/experiment-structure/src/manifest.rs index 90afb45..e1aa08f 100644 --- a/apps/sim-engine/lib/experiment-structure/src/manifest.rs +++ b/apps/sim-engine/lib/experiment-structure/src/manifest.rs @@ -29,7 +29,7 @@ pub struct ManifestError; pub type Result = error_stack::Result; -const BEHAVIOR_FILE_EXTENSIONS: [&str; 3] = ["js", "py", "rs"]; +const BEHAVIOR_FILE_EXTENSIONS: [&str; 4] = ["js", "py", "rs", "ts"]; const DATASET_FILE_EXTENSIONS: [&str; 2] = ["csv", "json"]; /// Contains all the necessary information required to run a simulation. @@ -611,7 +611,7 @@ fn get_behavior_from_dependency_projects( } else { name_root.replace('_', "-") }; - let full_name = "@hash/".to_string() + &dir + "/" + file_name; + let full_name = format!("@hash/{dir}/{file_name}"); if file_extension == "rs" { possible_names.push(name_root.to_string()); From 6660b9aa7d7df102e7489918c006baa23224e8bb Mon Sep 17 00:00:00 2001 From: Ben Berman Date: Mon, 4 Sep 2023 09:48:20 -0400 Subject: [PATCH 3/4] Add TypeScript stripping for state initialization (init.ts) --- .../src/package/simulation/init/js_py.rs | 7 ++- .../src/package/simulation/init/js_py/task.rs | 30 ++++++++- .../src/package/simulation/init/state.rs | 1 + .../src/package/simulation/init/task.rs | 7 ++- .../execution/src/package/simulation/task.rs | 7 +-- .../src/config/experiment.rs | 2 +- .../lib/experiment-structure/src/manifest.rs | 61 +++++++++++-------- 7 files changed, 79 insertions(+), 36 deletions(-) diff --git a/apps/sim-engine/lib/execution/src/package/simulation/init/js_py.rs b/apps/sim-engine/lib/execution/src/package/simulation/init/js_py.rs index 0f02ae1..d3f3dee 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/init/js_py.rs +++ b/apps/sim-engine/lib/execution/src/package/simulation/init/js_py.rs @@ -8,7 +8,7 @@ use stateful::{agent::Agent, field::FieldSpecMapAccessor}; pub use self::{ message::{FailedMessage, JsPyInitTaskMessage, StartMessage, SuccessMessage}, - task::{JsInitTask, PyInitTask}, + task::{TsInitTask, JsInitTask, PyInitTask}, }; use crate::{ package::simulation::{ @@ -46,6 +46,9 @@ impl InitPackage for JsPyInit { InitialStateName::InitJs => InitTask::JsInitTask(JsInitTask { initial_state_source: self.initial_state.src.clone(), }), + InitialStateName::InitTs => InitTask::TsInitTask(TsInitTask { + initial_state_source: self.initial_state.src.clone(), + }), name => { // should be unreachable return Err(Error::from(format!( @@ -89,7 +92,7 @@ impl InitPackageCreator for JsPyInitCreator { _accessor: FieldSpecMapAccessor, ) -> Result> { match &init_config.initial_state.name { - InitialStateName::InitPy | InitialStateName::InitJs => Ok(Box::new(JsPyInit { + InitialStateName::InitPy | InitialStateName::InitJs | InitialStateName::InitTs => Ok(Box::new(JsPyInit { initial_state: init_config.initial_state.clone(), comms, })), diff --git a/apps/sim-engine/lib/execution/src/package/simulation/init/js_py/task.rs b/apps/sim-engine/lib/execution/src/package/simulation/init/js_py/task.rs index 28972dc..d1cb402 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/init/js_py/task.rs +++ b/apps/sim-engine/lib/execution/src/package/simulation/init/js_py/task.rs @@ -3,7 +3,7 @@ use crate::{ js_py::{JsPyInitTaskMessage, StartMessage}, InitTaskMessage, }, - runner::MessageTarget, + runner::{Language, MessageTarget}, task::{TargetedTaskMessage, Task, TaskMessage}, worker::WorkerHandler, Result, @@ -33,6 +33,34 @@ impl WorkerHandler for JsInitTask { } } +#[derive(Clone, Debug)] +pub struct TsInitTask { + pub initial_state_source: String, +} + +impl Task for TsInitTask { + fn name(&self) -> &'static str { + "TsInit" + } +} + +impl WorkerHandler for TsInitTask { + fn start_message(&self) -> Result { + let javascript_source = + Language::TypeScript.compile_source("init.ts", &self.initial_state_source)?; + + let jspy_init_task_msg = JsPyInitTaskMessage::Start(StartMessage { + initial_state_source: javascript_source, + }); + + let init_task_msg = InitTaskMessage::JsPyInitTaskMessage(jspy_init_task_msg); + Ok(TargetedTaskMessage { + target: MessageTarget::JavaScript, + payload: TaskMessage::Init(init_task_msg), + }) + } +} + #[derive(Clone, Debug)] pub struct PyInitTask { pub initial_state_source: String, diff --git a/apps/sim-engine/lib/execution/src/package/simulation/init/state.rs b/apps/sim-engine/lib/execution/src/package/simulation/init/state.rs index 2e5f4e1..9308102 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/init/state.rs +++ b/apps/sim-engine/lib/execution/src/package/simulation/init/state.rs @@ -6,6 +6,7 @@ pub enum InitialStateName { InitJson, InitPy, InitJs, + InitTs, } #[derive(Deserialize, Serialize, Debug, Clone)] diff --git a/apps/sim-engine/lib/execution/src/package/simulation/init/task.rs b/apps/sim-engine/lib/execution/src/package/simulation/init/task.rs index bfa3cf6..be62f5c 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/init/task.rs +++ b/apps/sim-engine/lib/execution/src/package/simulation/init/task.rs @@ -1,5 +1,5 @@ use crate::{ - package::simulation::init::js_py::{JsInitTask, PyInitTask}, + package::simulation::init::js_py::{TsInitTask, JsInitTask, PyInitTask}, task::{ StoreAccessValidator, TargetedTaskMessage, Task, TaskDistributionConfig, TaskSharedStore, }, @@ -8,10 +8,12 @@ use crate::{ Error, Result, }; + /// All init package tasks are registered in this enum #[derive(Clone, Debug)] pub enum InitTask { JsInitTask(JsInitTask), + TsInitTask(TsInitTask), PyInitTask(PyInitTask), } @@ -19,6 +21,7 @@ impl Task for InitTask { fn name(&self) -> &'static str { match self { Self::JsInitTask(task) => task.name(), + Self::TsInitTask(task) => task.name(), Self::PyInitTask(task) => task.name(), } } @@ -26,6 +29,7 @@ impl Task for InitTask { fn distribution(&self) -> TaskDistributionConfig { match self { Self::JsInitTask(task) => task.distribution(), + Self::TsInitTask(task) => task.distribution(), Self::PyInitTask(task) => task.distribution(), } } @@ -47,6 +51,7 @@ impl WorkerHandler for InitTask { fn start_message(&self) -> Result { match self { Self::JsInitTask(inner) => inner.start_message(), + Self::TsInitTask(inner) => inner.start_message(), Self::PyInitTask(inner) => inner.start_message(), } } diff --git a/apps/sim-engine/lib/execution/src/package/simulation/task.rs b/apps/sim-engine/lib/execution/src/package/simulation/task.rs index 025a493..55c9b91 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/task.rs +++ b/apps/sim-engine/lib/execution/src/package/simulation/task.rs @@ -2,12 +2,9 @@ use crate::{ package::simulation::{ context::ContextTask, init::InitTask, output::OutputTask, state::StateTask, }, - task::{ - StoreAccessValidator, TargetedTaskMessage, Task, TaskDistributionConfig, TaskMessage, - TaskSharedStore, - }, + task::{StoreAccessValidator, Task, TaskDistributionConfig, TaskSharedStore, TargetedTaskMessage, TaskMessage}, worker::WorkerHandler, - worker_pool::{SplitConfig, WorkerPoolHandler}, + worker_pool::{WorkerPoolHandler, SplitConfig}, Result, }; diff --git a/apps/sim-engine/lib/experiment-structure/src/config/experiment.rs b/apps/sim-engine/lib/experiment-structure/src/config/experiment.rs index 4e1a75b..c0bc085 100644 --- a/apps/sim-engine/lib/experiment-structure/src/config/experiment.rs +++ b/apps/sim-engine/lib/experiment-structure/src/config/experiment.rs @@ -37,7 +37,7 @@ impl ExperimentConfig { let package_config = PackageConfigBuilder::new() .add_init_package(match simulation.package_init.initial_state.name { InitialStateName::InitJson => InitPackageName::Json, - InitialStateName::InitPy | InitialStateName::InitJs => InitPackageName::JsPy, + InitialStateName::InitPy | InitialStateName::InitJs | InitialStateName::InitTs=> InitPackageName::JsPy, }) .build()?; let base_globals: Globals = serde_json::from_str(&simulation.globals_src) diff --git a/apps/sim-engine/lib/experiment-structure/src/manifest.rs b/apps/sim-engine/lib/experiment-structure/src/manifest.rs index e1aa08f..e1e4f4e 100644 --- a/apps/sim-engine/lib/experiment-structure/src/manifest.rs +++ b/apps/sim-engine/lib/experiment-structure/src/manifest.rs @@ -85,8 +85,11 @@ impl Manifest { "js" => InitialStateName::InitJs, "py" => InitialStateName::InitPy, "json" => InitialStateName::InitJson, - _ => bail!(Report::new(ManifestError) - .attach_printable(format!("Not a valid initial state file: {path:?}"))), + "ts" => InitialStateName::InitTs, + _ => bail!( + Report::new(ManifestError) + .attach_printable(format!("Not a valid initial state file: {path:?}")) + ), }, src: file_contents(path)?, })) @@ -112,30 +115,34 @@ impl Manifest { Report::new(ManifestError).attach_printable(format!("Not a directory: {src_folder:?}")) ); - let js_path = src_folder.join("init.js"); - let py_path = src_folder.join("init.py"); - let json_path = src_folder.join("init.json"); + let paths_to_check = [ + "init.js", + "init.py", + "init.json", + "init.ts", + ].iter().map(|file_name| src_folder.join(file_name)); - tracing::debug!("Reading initial state files"); - if js_path.is_file() { - if py_path.is_file() { - tracing::warn!(r#""init.py" was supplied with "init.js", ignoring "init.py""#); - } - if json_path.is_file() { - tracing::warn!(r#""init.json" was supplied with "init.js", ignoring "init.json""#); - } - self.set_initial_state_from_file(js_path) - } else if py_path.is_file() { - if json_path.is_file() { - tracing::warn!(r#""init.json" was supplied with "init.py", ignoring "init.json""#); - } - self.set_initial_state_from_file(py_path) - } else if json_path.is_file() { - self.set_initial_state_from_file(json_path) - } else { - bail!(Report::new(ManifestError) - .attach_printable(format!("No initial state found in {src_folder:?}"))); + let existing_paths = paths_to_check.filter(|path| path.is_file()).collect::>(); + + if existing_paths.is_empty() { + bail!( + Report::new(ManifestError) + .attach_printable(format!("Couldn't find any initial state file in: {src_folder:?}")) + ); } + + let path = &existing_paths[0]; + + if existing_paths.len() > 1 { + tracing::warn!(r#"Multiple state initialization files found. Using "{}". (ignoring: "{}")"#, + path.display(), + existing_paths[1..].iter().map(|path| path.display().to_string()).collect::>().join("\", \""), + ); + } + + tracing::debug!("Reading initial state file: {}", path.display()); + + self.set_initial_state_from_file(path) } /// Reads the content from the file at the provided `path` describing the @@ -642,8 +649,10 @@ fn get_behavior_from_dependency_projects( }) }) { None => { - bail!(Report::new(ManifestError) - .attach_printable(format!("Could not find dependency behavior: {name}"))) + bail!( + Report::new(ManifestError) + .attach_printable(format!("Could not find dependency behavior: {name}")) + ) } Some(behavior) => { let mut behavior = behavior.clone(); From 23db251cdb344ae2031eb535e0ba68d8a59fcc16 Mon Sep 17 00:00:00 2001 From: Ben Berman Date: Mon, 4 Sep 2023 11:44:38 -0400 Subject: [PATCH 4/4] Remove trailing whitespace --- .../src/package/simulation/state/behavior_execution/package.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/package.js b/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/package.js index 32fcc74..c334d6e 100644 --- a/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/package.js +++ b/apps/sim-engine/lib/execution/src/package/simulation/state/behavior_execution/package.js @@ -107,7 +107,6 @@ const load_behaviors = (experiment, behavior_descs) => { trace.msg; throw new Error(JSON.stringify(trace)); } - let t = typeof fn; if (t !== "function") { throw new TypeError(