diff --git a/Cargo.lock b/Cargo.lock index 1902aec..54a3953 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - [[package]] name = "allocator-api2" version = "0.2.18" @@ -173,21 +164,15 @@ dependencies = [ "syn", ] -[[package]] -name = "daachorse" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b7ef7a4be509357f4804d0a22e830daddb48f19fd604e4ad32ddce04a94c36" - [[package]] name = "dashmap" -version = "6.0.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", "crossbeam-utils", - "hashbrown", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -252,14 +237,20 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" + [[package]] name = "indexmap" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.1", "serde", ] @@ -341,31 +332,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "miette" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" -dependencies = [ - "cfg-if", - "miette-derive", - "owo-colors", - "textwrap", - "thiserror", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "mimalloc" version = "0.1.43" @@ -383,9 +349,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "napi" -version = "3.0.0-alpha.12" +version = "3.0.0-alpha.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9a0181ed74b13126d877e7a4c1f267c4fcb955b417fb884c56cb358827cef4" +checksum = "b68de52a0f006eee6a77552b63a22fbd7f96e86785f83a4d82659af81e471200" dependencies = [ "bitflags", "ctor", @@ -403,9 +369,9 @@ checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" [[package]] name = "napi-derive" -version = "3.0.0-alpha.12" +version = "3.0.0-alpha.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba9a47726fea1ade989a27d54f5420acaa546a648c870ad6951ff0288c44879" +checksum = "6383ab202e92f67479c6694074e91280a546564d3466eb58122246becd139bd7" dependencies = [ "convert_case", "napi-derive-backend", @@ -416,23 +382,22 @@ dependencies = [ [[package]] name = "napi-derive-backend" -version = "2.0.0-alpha.12" +version = "2.0.0-alpha.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f227e9f34f058f563dbee327f94e176ff4c6f7b26c057e18336715cfd5c3c3" +checksum = "9d30f2656bb709a6949a14e1bfc15414fee8bdd7418d62cb735a07bbced4513c" dependencies = [ "convert_case", "proc-macro2", "quote", - "regex", "semver", "syn", ] [[package]] name = "napi-sys" -version = "2.4.0" +version = "3.0.0-alpha.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" +checksum = "ab9d950ea3a522a8cb9e9237ba7cf977eeca1fadaec182163be6b0feebfc7361" dependencies = [ "libloading", ] @@ -501,15 +466,15 @@ checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" [[package]] name = "owo-colors" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" [[package]] name = "oxc" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bafee3fed7d463c3ef771ace3d0692e294e50d946cb13b4175c7615d5629027" +checksum = "24327e7a58d4e28217ba4bce5e582db05c2731d04b908a40b305b5d492f239fa" dependencies = [ "oxc_allocator", "oxc_ast", @@ -527,9 +492,9 @@ dependencies = [ [[package]] name = "oxc-browserslist" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b5ad390a7cf69d5f574ea41eada88a7c0947272647703fe1ec6ce23bfe1714" +checksum = "d240f6572a29895f324ad834a42a0c4bad0739269a08d0181ad7d6db7537e0d1" dependencies = [ "nom", "rustc-hash", @@ -539,6 +504,31 @@ dependencies = [ "time", ] +[[package]] +name = "oxc-miette" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e03e63fd113c068b82d07c9c614b0b146c08a3ac0a4dface3ea1d1a9d14d549e" +dependencies = [ + "cfg-if", + "owo-colors", + "oxc-miette-derive", + "textwrap", + "thiserror", + "unicode-width 0.2.0", +] + +[[package]] +name = "oxc-miette-derive" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e21f680e8c5f1900297d394627d495351b9e37761f7bbf90116bd5eeb6e80967" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "oxc-node" version = "0.0.0" @@ -558,9 +548,9 @@ dependencies = [ [[package]] name = "oxc_allocator" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff0bca77a2d50ab7ad00c2e6041fa497e61b74bd8933bfedf1adb7fa23b6d69" +checksum = "931f734a61f63a0571163b160b764d90d83077c4d2631d15b26fe1b66763dad8" dependencies = [ "allocator-api2", "bumpalo", @@ -568,14 +558,17 @@ dependencies = [ [[package]] name = "oxc_ast" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8682a40306a94ed0c05165fdfa0ffd0bca275dd368b401765b26eb9d5c2d2ddc" +checksum = "b9a771175e84c2324c841fe7ca3ddacb5df8102f043e2fc3e96d0bfee039c13d" dependencies = [ "bitflags", + "cow-utils", "num-bigint", + "num-traits", "oxc_allocator", "oxc_ast_macros", + "oxc_estree", "oxc_regular_expression", "oxc_span", "oxc_syntax", @@ -583,9 +576,9 @@ dependencies = [ [[package]] name = "oxc_ast_macros" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09d1bd60764db308e540d7e0b2855e63f37ba03074b7baca303a219c4b15147" +checksum = "ed71131e79889e226fb6510b90fa1a4a7495c8fdac43a4f505334fb0f1324e3e" dependencies = [ "proc-macro2", "quote", @@ -594,12 +587,14 @@ dependencies = [ [[package]] name = "oxc_cfg" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97980c48bb2ef79015bcd4dc9d7307080a3d3df6db64abf2dca199757f62b790" +checksum = "6e13f126deb1a5c4ac158816cd6dae5ad22004e9010de1b59e8fbfa20d636872" dependencies = [ "bitflags", "itertools", + "nonmax", + "oxc_index", "oxc_syntax", "petgraph", "rustc-hash", @@ -607,15 +602,14 @@ dependencies = [ [[package]] name = "oxc_codegen" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc62bcf2d1532d2983e65f1a57bbfd51e2093f49306e9aa2c68ce73fb06c17d" +checksum = "cab75b7507f21c284d4a8052dfc9a522b12b3dbc02afc38ce498b0945d9e7952" dependencies = [ + "assert-unchecked", "bitflags", "cow-utils", - "daachorse", "nonmax", - "once_cell", "oxc_allocator", "oxc_ast", "oxc_index", @@ -626,30 +620,55 @@ dependencies = [ "rustc-hash", ] +[[package]] +name = "oxc_data_structures" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60c1e9651f904dd130930ae4d567147e06155600f7e545376558a8f476ca398c" +dependencies = [ + "assert-unchecked", +] + [[package]] name = "oxc_diagnostics" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d13d2cfe0599ab204044a6a3b7e051f43ada33805ca962241cd093c6dbac6bcb" +checksum = "e37049d46eb02a97e4cc0900672a921666393c642c1ad419a20d483285f5b590" dependencies = [ - "miette", - "owo-colors", + "oxc-miette", "rustc-hash", - "textwrap", - "unicode-width", ] +[[package]] +name = "oxc_ecmascript" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93b4201e1ebf6c13ed7296268ef08dabb864218e835f2b1f174eea73958888d5" +dependencies = [ + "num-bigint", + "num-traits", + "oxc_ast", + "oxc_span", + "oxc_syntax", +] + +[[package]] +name = "oxc_estree" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fa45c638ccfd88b5c26147b0a98e1e8dd49542327dda94445b940ef91920d6a" + [[package]] name = "oxc_index" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f8f41bef7cee40604b4e15f4439ae79cbb02ad0a3e357c3ecee64f1a2a4135f" +checksum = "ae76739229d0cc5e834e0e3b9e8c4078a86828ff47f5bc71138e4571ce528f83" [[package]] name = "oxc_mangler" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db7a85cfdf8c2d191a6f102a8bbe3d116804fce0759cf59590440358c4d33ac1" +checksum = "8c0de32f12ac9f6def9b1a25f159a53c51fd1686b2252a0bafa67dd5d3f1df50" dependencies = [ "itertools", "oxc_ast", @@ -660,9 +679,9 @@ dependencies = [ [[package]] name = "oxc_parser" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9d3ad9f100094890cf87bd2f4c1197f8f2b56115c91e0eaa8da5b5b0aa2f7b" +checksum = "0106e10cd67a59d91a75232d4c40f188b8532efea9b9bbed110bce157e7d3b9a" dependencies = [ "assert-unchecked", "bitflags", @@ -682,13 +701,14 @@ dependencies = [ [[package]] name = "oxc_regular_expression" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f021c18692754a2647d862b2ff5bc2a33a3e74f25b4006a83a218ca971012ea" +checksum = "f1bd0d5b1b943173378a5f61d6a4c49edc7e8c9157241e9bbba54594d7449b4c" dependencies = [ "oxc_allocator", "oxc_ast_macros", "oxc_diagnostics", + "oxc_estree", "oxc_span", "phf", "rustc-hash", @@ -697,9 +717,9 @@ dependencies = [ [[package]] name = "oxc_resolver" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf8bcda84674ae69228a823dcdb81eac9a398d99f1bbc1dbf00623009fc11c1" +checksum = "aaa605931a9776ac77fe822bac420e8b0b72594daba8701bdcde50aecbde7ff6" dependencies = [ "cfg-if", "dashmap", @@ -717,9 +737,9 @@ dependencies = [ [[package]] name = "oxc_semantic" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531b9114917e38919395594ea5f3d289b1e763249ccadf64a322094ca1d66ebf" +checksum = "90df00caf2d0bc7adf30f60e16b7b0672f92e328d025b00b5ea0ace2edffb5c2" dependencies = [ "assert-unchecked", "indexmap", @@ -728,6 +748,7 @@ dependencies = [ "oxc_ast", "oxc_cfg", "oxc_diagnostics", + "oxc_ecmascript", "oxc_index", "oxc_span", "oxc_syntax", @@ -737,9 +758,9 @@ dependencies = [ [[package]] name = "oxc_sourcemap" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61beda59456de21699a848af5f01e5b8b5c314e1e693542566ed188c07c52c45" +checksum = "d7d136d620916c843b3921806be747cfd61894486cad68377f7410ba7e6ae4af" dependencies = [ "base64-simd", "cfg-if", @@ -752,21 +773,22 @@ dependencies = [ [[package]] name = "oxc_span" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "872f1d0c9422b43c07ab03de817b0c8cfde70e0b9b31bd9279cf87bfaba78694" +checksum = "c7b5d7caf8a20611f34c5c9ebdf232b6b42498e5424d02ef1e2dffe31553b49f" dependencies = [ "compact_str", - "miette", + "oxc-miette", "oxc_allocator", "oxc_ast_macros", + "oxc_estree", ] [[package]] name = "oxc_syntax" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4cb91daf6f98a036b245d24efc93bda2990c6aab1066d943d5ec6547e0070d" +checksum = "3135d5ddd0dc8ca535c0ac517a526ace8cac2699bb1345064c9fe046ca761dfa" dependencies = [ "assert-unchecked", "bitflags", @@ -774,6 +796,7 @@ dependencies = [ "nonmax", "oxc_allocator", "oxc_ast_macros", + "oxc_estree", "oxc_index", "oxc_span", "phf", @@ -784,18 +807,22 @@ dependencies = [ [[package]] name = "oxc_transformer" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c92adfab82bae90d52972bb01789f96679312fa419960af455d6fd44f4d088f" +checksum = "7ddfedbd5af5e66b6d1d0165a5e81c473544e77d1aa0e1552dd1c3d43541f008" dependencies = [ - "assert-unchecked", "base64", + "cow-utils", "dashmap", "indexmap", + "itoa", "oxc-browserslist", "oxc_allocator", "oxc_ast", + "oxc_data_structures", "oxc_diagnostics", + "oxc_ecmascript", + "oxc_parser", "oxc_regular_expression", "oxc_semantic", "oxc_span", @@ -810,15 +837,17 @@ dependencies = [ [[package]] name = "oxc_traverse" -version = "0.30.5" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d99fed14d07029902ae0e9a6fcc97789a41e1e1d88770008ff650f1a995725d7" +checksum = "7ef6ab3d857d404750ae266d1ade5ba95e6d59d617a92b44b2c63d860fc887e3" dependencies = [ "compact_str", "itoa", "memoffset", "oxc_allocator", "oxc_ast", + "oxc_data_structures", + "oxc_ecmascript", "oxc_semantic", "oxc_span", "oxc_syntax", @@ -964,35 +993,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - [[package]] name = "ropey" version = "1.6.1" @@ -1047,18 +1047,18 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", @@ -1067,9 +1067,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "indexmap", "itoa", @@ -1136,9 +1136,9 @@ checksum = "e9557cb6521e8d009c51a8666f09356f4b817ba9ba0981a305bd86aee47bd35c" [[package]] name = "syn" -version = "2.0.75" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -1153,7 +1153,7 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ "smawk", "unicode-linebreak", - "unicode-width", + "unicode-width 0.1.13", ] [[package]] @@ -1283,6 +1283,12 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "version_check" version = "0.9.5" diff --git a/Cargo.toml b/Cargo.toml index 3226a1f..52f749a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] napi = { version = "3.0.0-alpha", default-features = false, features = ["serde-json", "napi3"] } napi-derive = { version = "3.0.0-alpha", default-features = false, features = ["type-def"] } -oxc = { version = "0.30", features = ["codegen", "transformer", "sourcemap_concurrent", "semantic"] } +oxc = { version = "0.36", features = ["codegen", "transformer", "sourcemap_concurrent", "semantic"] } oxc_resolver = "2" phf = "0.11" serde = { version = "1.0", features = ["derive"] } diff --git a/src/lib.rs b/src/lib.rs index 696f9d4..007c378 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -147,14 +147,14 @@ impl Output { /// Returns the generated code /// Cache the result of this function if you need to use it multiple times pub fn source(&self) -> String { - self.0.source_text.clone() + self.0.code.clone() } #[napi] /// Returns the source map as a JSON string /// Cache the result of this function if you need to use it multiple times pub fn source_map(&self) -> Option { - self.0.source_map.clone().map(|s| s.to_json_string()) + self.0.map.clone().map(|s| s.to_json_string()) } } @@ -183,7 +183,7 @@ impl Task for TransformTask { Ok(output) } - fn finally(&mut self, _: Env) -> Result<()> { + fn finally(mut self, _: Env) -> Result<()> { mem::drop(mem::replace(&mut self.source, Either3::A(String::new()))); Ok(()) } @@ -202,7 +202,6 @@ fn oxc_transform(src_path: &Path, code: &S) -> Result { let source_type = SourceType::from_path(src_path).unwrap_or_default(); let source_str = code.try_as_str()?; let ParserReturn { - trivias, mut program, errors, .. @@ -214,7 +213,7 @@ fn oxc_transform(src_path: &Path, code: &S) -> Result { format!("Failed to parse {}: {}", src_path.display(), msg), )); } - let (symbols, scopes) = SemanticBuilder::new(source_str) + let (symbols, scopes) = SemanticBuilder::new() .build(&program) .semantic .into_symbol_table_and_scope_tree(); @@ -222,10 +221,7 @@ fn oxc_transform(src_path: &Path, code: &S) -> Result { let TransformerReturn { errors, .. } = Transformer::new( &allocator, src_path, - source_type, - source_str, - trivias, - Default::default(), + &Default::default(), ) .build_with_symbols_and_scopes(symbols, scopes, &mut program); @@ -581,18 +577,18 @@ fn transform_output(url: String, output: LoadFnOutput) -> Result { let transform_output = oxc_transform(src_path, output.source.as_ref().unwrap())?; let output_code = transform_output .0 - .source_map + .map .map(|sm| sm.to_data_url()) .map(|sm| { const SOURCEMAP_PREFIX: &str = "\n//# sourceMappingURL="; - let len = sm.len() + transform_output.0.source_text.len() + 22; + let len = sm.len() + transform_output.0.code.len() + 22; let mut output_code = String::with_capacity(len + 22); - output_code.push_str(&transform_output.0.source_text); + output_code.push_str(&transform_output.0.code); output_code.push_str(SOURCEMAP_PREFIX); output_code.push_str(sm.as_str()); output_code }) - .unwrap_or_else(|| transform_output.0.source_text); + .unwrap_or_else(|| transform_output.0.code); tracing::debug!("loaded {} format: {}", url, output.format); Ok(LoadFnOutput {