diff --git a/Cargo.lock b/Cargo.lock index 8307ca4..e2a9762 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,9 +75,9 @@ checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "ast_node" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e3e06ec6ac7d893a0db7127d91063ad7d9da8988f8a1a256f03729e6eec026" +checksum = "2ab31376d309dd3bfc9cfb3c11c93ce0e0741bbe0354b20e7f8c60b044730b79" dependencies = [ "proc-macro2", "quote", @@ -422,9 +422,9 @@ dependencies = [ [[package]] name = "deno_ast" -version = "0.38.1" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e2417aad5382d10d035e46d35f2f5fbbb93a922816408245ee585e7ca775194" +checksum = "32edef567e3090862e865c75628f4d35ace80ca90e0fc5263a7d10fa307ae899" dependencies = [ "anyhow", "base64", @@ -463,9 +463,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.77.0" +version = "0.78.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a8739bb6087061f8419e4c1719459a144ef477ab649dca597a0603290ec82" +checksum = "c4ccd2755a805983f96aeccd211c1f7585b6bfec77471f502c47227abe375682" dependencies = [ "anyhow", "async-trait", @@ -715,9 +715,9 @@ dependencies = [ [[package]] name = "from_variant" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a0b11eeb173ce52f84ebd943d42e58813a2ebb78a6a3ff0a243b71c5199cd7b" +checksum = "fdc9cc75639b041067353b9bce2450d6847e547276c6fbe4487d7407980e07db" dependencies = [ "proc-macro2", "swc_macros_common", @@ -1837,9 +1837,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "indexmap", "itoa", @@ -1990,9 +1990,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "string_enum" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b650ea2087d32854a0f20b837fc56ec987a1cb4f758c9757e1171ee9812da63" +checksum = "05e383308aebc257e7d7920224fa055c632478d92744eca77f99be8fa1545b90" dependencies = [ "proc-macro2", "quote", @@ -2028,9 +2028,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.33.25" +version = "0.33.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a529796c240cd87da18d26d63f9de4c7ad3680cf0a04b95f0c37f4c4f0a0da63" +checksum = "a2f9706038906e66f3919028f9f7a37f3ed552f1b85578e93f4468742e2da438" dependencies = [ "ast_node", "better_scoped_tls", @@ -2054,9 +2054,9 @@ dependencies = [ [[package]] name = "swc_config" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ada712ac5e28a301683c8af957e8a56deca675cbc376473dd207a527b989efb5" +checksum = "7be1a689e146be1eae53139482cb061dcf0fa01dff296bbe7b96fff92d8e2936" dependencies = [ "anyhow", "indexmap", @@ -2068,9 +2068,9 @@ dependencies = [ [[package]] name = "swc_config_macro" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2574f75082322a27d990116cd2a24de52945fc94172b24ca0b3e9e2a6ceb6b" +checksum = "7c5f56139042c1a95b54f5ca48baa0e0172d369bcc9d3d473dad1de36bae8399" dependencies = [ "proc-macro2", "quote", @@ -2080,9 +2080,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.113.0" +version = "0.113.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f99fdda741656887f4cf75c1cee249a5f0374d67d30acc2b073182e902546ff2" +checksum = "dc1690cc0c9ab60b44ac0225ba1e231ac532f7ba1d754df761c6ee607561afae" dependencies = [ "bitflags 2.5.0", "is-macro", @@ -2098,9 +2098,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.149.0" +version = "0.149.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c21b8ae99bc3b95c6f7909915cd1e5994bec4e5b576f2e2a6879e56f2770760" +checksum = "4fef147127a2926ca26171c7afcbf028ff86dc543ced87d316713f25620a15b9" dependencies = [ "memchr", "num-bigint", @@ -2117,9 +2117,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ab87ba81ae05efd394ab4a8cbdba595ac3554a5e393c76699449d47c43582e" +checksum = "090e409af49c8d1a3c13b3aab1ed09dd4eda982207eb3e63c2ad342f072b49c8" dependencies = [ "proc-macro2", "quote", @@ -2129,9 +2129,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.45.27" +version = "0.45.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a923880fc27cf5f3d2a684debb7c5a0ee60100af1bfe424cb5e722d290bf88a" +checksum = "92c68f934bd2c51f29c4ad0bcae09924e9dc30d7ce0680367d45b42d40338a67" dependencies = [ "anyhow", "pathdiff", @@ -2143,9 +2143,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.144.0" +version = "0.144.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da9f3a58f0a64410f4006eb1fdb64d190ad3cc6cd12a7bf1f0dbb916e4ca4c7" +checksum = "0499e69683ae5d67a20ff0279b94bc90f29df7922a46331b54d5dd367bf89570" dependencies = [ "either", "new_debug_unreachable", @@ -2165,9 +2165,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.138.0" +version = "0.138.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91771e358664649cf2cabec86a270bd9ce267f5213f299cacb255951b5edf06b" +checksum = "eddb95c2bdad1c9c29edf35712e1e0f9b9ddc1cdb5ba2d582fd93468cb075a03" dependencies = [ "better_scoped_tls", "bitflags 2.5.0", @@ -2188,9 +2188,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.127.0" +version = "0.127.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa5cd60314f35a114dc85955c6b645e9bb13fdfda4f732137ed62a482ca8990" +checksum = "53043d81678f3c693604eeb1d1f0fe6ba10f303104a31b954dbeebed9cadf530" dependencies = [ "swc_atoms", "swc_common", @@ -2202,9 +2202,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_macros" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e309b88f337da54ef7fe4c5b99c2c522927071f797ee6c9fb8b6bf2d100481" +checksum = "500a1dadad1e0e41e417d633b3d6d5de677c9e0d3159b94ba3348436cdb15aab" dependencies = [ "proc-macro2", "quote", @@ -2214,9 +2214,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.172.0" +version = "0.172.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "067a79cba791af32fb0634c0ca08051e47b56ccfe8d07349b7787b22da401084" +checksum = "7fbc414d6a9c5479cfb4c6e92fcdac504582bd7bc89a0ed7f8808b72dc8bd1f0" dependencies = [ "either", "rustc-hash", @@ -2234,9 +2234,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.184.0" +version = "0.184.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69c87599f4a10987fe2687967e5448858b458f2924faa62f044acd56f4e3ffda" +checksum = "565a76c4ca47ce31d78301c0beab878e4c2cb4f624691254d834ec8c0e236755" dependencies = [ "base64", "dashmap", @@ -2258,9 +2258,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.189.0" +version = "0.189.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ea0dc9076708448e8ded8e1119717e0e6e095b1ba42b4c8d7fdb1d26fba418" +checksum = "e209026c1d3c577cafac257d87e7c0d23119282fbdc8ed03d7f56077e95beb90" dependencies = [ "ryu-js", "serde", @@ -2275,9 +2275,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.128.0" +version = "0.128.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd533f5751b7a8673bd843151c4e6e64a2dcf6c1f65331401e88f244c0e85de7" +checksum = "fe5242670bc74e0a0b64b9d4912b37be36944517ce0881314162aeb4381272c3" dependencies = [ "indexmap", "num_cpus", @@ -2293,9 +2293,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.99.0" +version = "0.99.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c74008ebc5e0d3d9a1b3df54083ddbff1a375cfadff857da1fdc7837b48c52d" +checksum = "28a6ce28ad8e591f8d627f1f9cb26b25e5d83052a9bc1b674d95fc28040cfa98" dependencies = [ "num-bigint", "swc_atoms", @@ -2318,9 +2318,9 @@ dependencies = [ [[package]] name = "swc_macros_common" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5be7766a95a2840ded618baeaab63809b71230ef19094b34f76c8af4d85aa2" +checksum = "91745f3561057493d2da768437c427c0e979dff7396507ae02f16c981c4a8466" dependencies = [ "proc-macro2", "quote", @@ -2329,9 +2329,9 @@ dependencies = [ [[package]] name = "swc_visit" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0263be55289abfe9c877ffef83d877b5bdfac036ffe2de793f48f5e47e41dbae" +checksum = "043d11fe683dcb934583ead49405c0896a5af5face522e4682c16971ef7871b9" dependencies = [ "either", "swc_visit_macros", @@ -2339,9 +2339,9 @@ dependencies = [ [[package]] name = "swc_visit_macros" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33fc817055fe127b4285dc85058596768bfde7537ae37da82c67815557f03e33" +checksum = "4ae9ef18ff8daffa999f729db056d2821cd2f790f3a11e46422d19f46bb193e7" dependencies = [ "Inflector", "proc-macro2", @@ -2620,9 +2620,9 @@ checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" [[package]] name = "unicode-id-start" -version = "1.1.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8f73150333cb58412db36f2aca8f2875b013049705cc77b94ded70a1ab1f5da" +checksum = "02aebfa694eccbbbffdd92922c7de136b9fe764396d2f10e21bce1681477cfc1" [[package]] name = "unicode-ident" diff --git a/Cargo.toml b/Cargo.toml index 283679e..3d9e171 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" members = ["lib"] [workspace.dependencies] -deno_graph = "0.77.0" +deno_graph = "0.78.0" import_map = "0.19.1" serde = "1" @@ -45,7 +45,7 @@ default = ["sha256"] [dependencies] anyhow = "1" base64 = "0.21.0" -deno_ast = { version = "0.38.0", features = ["transpiling"] } +deno_ast = { version = "0.39.0", features = ["transpiling"] } deno_graph = { workspace = true } deno_npm = "0.21.0" deno_semver = "0.5.4" diff --git a/src/v2.rs b/src/v2.rs index 2bc98db..e8ae8ca 100644 --- a/src/v2.rs +++ b/src/v2.rs @@ -11,7 +11,6 @@ use std::task::Poll; use std::task::Waker; use deno_ast::EmitOptions; -use deno_ast::EmittedSource; use deno_ast::SourceMapOption; use deno_ast::TranspileOptions; use deno_graph::CapturingModuleParser; @@ -972,12 +971,9 @@ impl EszipV2 { media_type: module.media_type, scope_analysis: false, })?; - let EmittedSource { - text, - source_map: maybe_source_map, - } = parsed_source.transpile(transpile_options, emit_options)?.into_source(); - source = Arc::from(text.into_bytes()); - source_map = Arc::from(maybe_source_map.unwrap_or_default().into_bytes()); + let emit = parsed_source.transpile(transpile_options, emit_options)?.into_source(); + source = emit.source.into(); + source_map = Arc::from(emit.source_map.unwrap_or_default()); } _ => { return Err(anyhow::anyhow!(