From 5cb05060e2a272bc8be299c2d03e2f2511070b20 Mon Sep 17 00:00:00 2001 From: Cong-Cong Pan Date: Sun, 22 Sep 2024 06:46:04 +0800 Subject: [PATCH] perf: remove swc unused features (#30) --- Cargo.lock | 1335 ++--------------- crates/binding/Cargo.toml | 1 - crates/core/Cargo.toml | 5 +- crates/core/src/add_jsx_attribute.rs | 4 +- crates/core/src/hast_to_swc_ast/mod.rs | 8 +- crates/core/src/lib.rs | 6 +- crates/core/src/remove_jsx_attribute.rs | 5 +- crates/core/src/replace_jsx_attribute.rs | 4 +- crates/core/src/svg_dynamic_title.rs | 4 +- crates/core/src/svg_em_dimensions.rs | 5 +- crates/core/src/transform_react_native_svg.rs | 7 +- .../core/src/transform_svg_component/mod.rs | 6 +- .../src/transform_svg_component/variables.rs | 6 +- 13 files changed, 112 insertions(+), 1284 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0a75c2..432b64f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,9 +45,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", "once_cell", - "serde", "version_check", "zerocopy", ] @@ -67,21 +65,6 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "anes" version = "0.1.6" @@ -109,12 +92,6 @@ version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - [[package]] name = "ast_node" version = "0.9.9" @@ -170,12 +147,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64-simd" version = "0.7.0" @@ -202,7 +173,6 @@ dependencies = [ "napi-build", "napi-derive", "svgr-rs", - "swc_core", ] [[package]] @@ -223,33 +193,6 @@ dependencies = [ "wyz", ] -[[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 = "browserslist-rs" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf0ca73de70c3da94e4194e4a01fe732378f55d47cf4c0588caab22a0dbfa14" -dependencies = [ - "ahash 0.8.11", - "chrono", - "either", - "indexmap", - "itertools 0.13.0", - "nom", - "once_cell", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -315,18 +258,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "windows-targets 0.52.6", -] - [[package]] name = "ciborium" version = "0.2.2" @@ -420,36 +351,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" - [[package]] name = "criterion" version = "0.5.1" @@ -462,7 +363,7 @@ dependencies = [ "clap", "criterion-plot", "is-terminal", - "itertools 0.10.5", + "itertools", "num-traits", "once_cell", "oorandom", @@ -483,7 +384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools 0.10.5", + "itertools", ] [[package]] @@ -517,16 +418,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[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 = "ctor" version = "0.2.8" @@ -537,19 +428,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - [[package]] name = "data-encoding" version = "2.6.0" @@ -578,16 +456,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - [[package]] name = "either" version = "1.13.0" @@ -600,12 +468,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -632,16 +494,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.15" @@ -675,15 +527,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.11", -] - [[package]] name = "hashbrown" version = "0.14.5" @@ -721,7 +564,7 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96274be293b8877e61974a607105d09c84caebe9620b47774aa8a6b942042dd4" dependencies = [ - "hashbrown 0.14.5", + "hashbrown", "new_debug_unreachable", "once_cell", "phf", @@ -729,29 +572,6 @@ dependencies = [ "triomphe", ] -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "idna" version = "0.5.0" @@ -775,8 +595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", - "hashbrown 0.14.5", - "serde", + "hashbrown", ] [[package]] @@ -817,15 +636,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.11" @@ -841,15 +651,6 @@ dependencies = [ "wasm-bindgen", ] -[[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 = "lazy_static" version = "1.5.0" @@ -903,15 +704,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "lru" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" -dependencies = [ - "hashbrown 0.13.2", -] - [[package]] name = "matchers" version = "0.1.0" @@ -935,28 +727,14 @@ checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" dependencies = [ "atty", "backtrace", - "miette-derive 4.7.1", + "miette-derive", "once_cell", - "owo-colors 3.5.0", + "owo-colors", "supports-color", "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap 0.15.2", - "thiserror", - "unicode-width", -] - -[[package]] -name = "miette" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" -dependencies = [ - "cfg-if", - "miette-derive 7.2.0", - "owo-colors 4.0.0", - "textwrap 0.16.1", + "textwrap", "thiserror", "unicode-width", ] @@ -972,23 +750,6 @@ dependencies = [ "syn 1.0.109", ] -[[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 2.0.72", -] - -[[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.7.4" @@ -1009,8 +770,6 @@ dependencies = [ "napi-derive", "napi-sys", "once_cell", - "serde", - "serde_json", ] [[package]] @@ -1063,25 +822,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -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 = "nu-ansi-term" version = "0.46.0" @@ -1170,12 +910,6 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[package]] -name = "owo-colors" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" - [[package]] name = "parking_lot" version = "0.12.3" @@ -1199,40 +933,12 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "path-clean" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" - -[[package]] -name = "path-clean" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" - -[[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.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap", -] - [[package]] name = "phf" version = "0.11.2" @@ -1343,24 +1049,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" -[[package]] -name = "preset_env_base" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b30eab18be480c194938e433e269d5298a279f6410f02fbc73f3576a325c110" -dependencies = [ - "ahash 0.8.11", - "anyhow", - "browserslist-rs", - "dashmap", - "from_variant", - "once_cell", - "semver 1.0.23", - "serde", - "st-map", - "tracing", -] - [[package]] name = "pretty_assertions" version = "1.4.0" @@ -1424,12 +1112,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[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.8.5" @@ -1655,17 +1337,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -1732,16 +1403,6 @@ dependencies = [ "url", ] -[[package]] -name = "st-map" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a8a5c4e5cc839409346495370b2df67489cafd7fa83616d0547a9697a6a89a1" -dependencies = [ - "arrayvec", - "static-map-macro", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1761,17 +1422,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "static-map-macro" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf483ea7e0e3a03d1b91687895814425149ad77facd3e2b6839dde26da98454" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -1858,58 +1508,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "swc" -version = "0.283.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cb7fe4bd6a604528819c84fc9acc5d5ec1b3bd0d11d13ee5d8a77d49ff678fa" -dependencies = [ - "anyhow", - "base64", - "dashmap", - "either", - "indexmap", - "jsonc-parser", - "lru", - "napi", - "napi-derive", - "once_cell", - "parking_lot", - "pathdiff", - "regex", - "rustc-hash", - "serde", - "serde_json", - "sourcemap", - "swc_atoms 0.6.7", - "swc_cached", - "swc_common 0.37.0", - "swc_compiler_base", - "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 0.21.0", - "swc_node_comments", - "swc_timer", - "swc_transform_common", - "swc_typescript", - "swc_visit 0.6.1", - "tracing", - "url", -] - [[package]] name = "swc_allocator" version = "0.1.8" @@ -1917,7 +1515,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc8bd3075d1c6964010333fae9ddcd91ad422a4f8eb8b3206a9b2b6afb4209e" dependencies = [ "bumpalo", - "hashbrown 0.14.5", + "hashbrown", "ptr_meta", "rustc-hash", "triomphe", @@ -1950,52 +1548,8 @@ dependencies = [ ] [[package]] -name = "swc_bundler" -version = "0.234.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350d5782eb76a7bfff1be77603bae126b4370cae02a7bc54d8a3bf04f396da13" -dependencies = [ - "anyhow", - "crc", - "indexmap", - "is-macro", - "once_cell", - "parking_lot", - "petgraph", - "radix_fmt", - "relative-path", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_optimization", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_fast_graph", - "swc_graph_analyzer", - "tracing", -] - -[[package]] -name = "swc_cached" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83406221c501860fce9c27444f44125eafe9e598b8b81be7563d7036784cd05c" -dependencies = [ - "ahash 0.8.11", - "anyhow", - "dashmap", - "once_cell", - "regex", - "serde", -] - -[[package]] -name = "swc_common" -version = "0.30.5" +name = "swc_common" +version = "0.30.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53e95bf36e3e217431c50eab784c5601bf5f0ed3657aac6bda57748fa4d6103b" dependencies = [ @@ -2013,734 +1567,149 @@ dependencies = [ "rustc-hash", "serde", "siphasher", - "string_cache", - "swc_atoms 0.4.43", - "swc_eq_ignore_macros", - "swc_visit 0.5.14", - "termcolor", - "tracing", - "unicode-width", - "url", -] - -[[package]] -name = "swc_common" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7200144c1d0b4b10c5b9057c3924365728da9e224f910ccaeabca6b573a6bd6a" -dependencies = [ - "ahash 0.8.11", - "ast_node", - "better_scoped_tls", - "cfg-if", - "either", - "from_variant", - "new_debug_unreachable", - "num-bigint", - "once_cell", - "parking_lot", - "rustc-hash", - "serde", - "siphasher", - "sourcemap", - "swc_allocator", - "swc_atoms 0.6.7", - "swc_eq_ignore_macros", - "swc_visit 0.6.1", - "tracing", - "unicode-width", - "url", -] - -[[package]] -name = "swc_compiler_base" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b47fac27c2e84e033bdea294ac12f575322c81c9d5d44f423e3f11ff239a86" -dependencies = [ - "anyhow", - "base64", - "napi", - "napi-derive", - "once_cell", - "pathdiff", - "rustc-hash", - "serde", - "serde_json", - "sourcemap", - "swc_allocator", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_config", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_minifier", - "swc_ecma_parser", - "swc_ecma_visit", - "swc_timer", -] - -[[package]] -name = "swc_config" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4740e53eaf68b101203c1df0937d5161a29f3c13bceed0836ddfe245b72dd000" -dependencies = [ - "anyhow", - "indexmap", - "serde", - "serde_json", - "sourcemap", - "swc_cached", - "swc_config_macro", -] - -[[package]] -name = "swc_config_macro" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5f56139042c1a95b54f5ca48baa0e0172d369bcc9d3d473dad1de36bae8399" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.72", -] - -[[package]] -name = "swc_core" -version = "0.100.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48834ffc99ba591e190e6276bdd71a1278c204d39a5b7b1dedcf7c82afda30ba" -dependencies = [ - "swc", - "swc_allocator", - "swc_atoms 0.6.7", - "swc_bundler", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_visit", - "swc_nodejs_common", - "vergen", -] - -[[package]] -name = "swc_ecma_ast" -version = "0.118.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d28b2b3ac8af922e693ee784881b2a32ca4604e1088072b66116003c225a44d9" -dependencies = [ - "bitflags", - "is-macro", - "num-bigint", - "phf", - "scoped-tls", - "serde", - "string_enum", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "unicode-id-start", -] - -[[package]] -name = "swc_ecma_codegen" -version = "0.155.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644514f303dcad13f7d1c244b50af798e0549f6eb8c53d64dd2ba9824266c868" -dependencies = [ - "memchr", - "num-bigint", - "once_cell", - "serde", - "sourcemap", - "swc_allocator", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_codegen_macros", - "tracing", -] - -[[package]] -name = "swc_ecma_codegen_macros" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859fabde36db38634f3fad548dd5e3410c1aebba1b67a3c63e67018fa57a0bca" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.72", -] - -[[package]] -name = "swc_ecma_compat_bugfixes" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f9cac39f19d6509db921f4b75934aaa64fc84b599416e5c1fcaed1c313132f" -dependencies = [ - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_compat_es2015", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_common" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9acdf402b36f8e83084b10e119d7ba9d07e5229ef39e1343f147db816c7b73e" -dependencies = [ - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", -] - -[[package]] -name = "swc_ecma_compat_es2015" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd07cbb52c1ac41115c9ddd5a4d046a7388008bd950b61a48df7f7f490f19827" -dependencies = [ - "arrayvec", - "indexmap", - "is-macro", - "serde", - "serde_derive", - "smallvec", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_config", - "swc_ecma_ast", - "swc_ecma_compat_common", - "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_compat_es2016" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209e347cdc3fb56632a1d882f981f3448f5f529c16d8da9d770207fffda4a8f6" -dependencies = [ - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2017" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a564f1b5e852a0ac656626ba689d49dd2751ba5b980903154aebc971729959d" -dependencies = [ - "serde", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2018" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f577f098e7c3738ade709caadb17c9f3bd911ea2ee6cfacca561d12addcc5761" -dependencies = [ - "serde", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_compat_common", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2019" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d52253dc2f83a3fca526c387c33e4ff9a8423b68c271414c9f870e1ced3231" -dependencies = [ - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2020" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed343932876fad34b1d4a13e30c55b94531e89916f45e7c04203bc49a29565b9" -dependencies = [ - "serde", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_compat_es2022", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2021" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6b28a2c109466eaa809d9b9a5b81dcbb4e269ba293a9c5c34aabc67b6427bc" -dependencies = [ - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2022" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3a644e271ea2a9df88e3e456c5c204c4916ef5136b7d946f9cd25607f47ec6" -dependencies = [ - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_compat_common", - "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_compat_es3" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55ffadc12067b21524bf7b5d6938021ee918f65f18937ed27245c23544bc910" -dependencies = [ - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_ext_transforms" -version = "0.120.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad03ee53c734eb74757d03c07ec71b1a982261830c9253ef3e2e4a089f9af25d" -dependencies = [ - "phf", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_lints" -version = "0.99.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c11bcc9e3dc49929500c07c8b0c84a88064847d31e9ee16204b257e6bd315c" -dependencies = [ - "auto_impl", - "dashmap", - "parking_lot", - "rayon", - "regex", - "serde", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_config", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_loader" -version = "0.49.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55fa3d55045b97894bfb04d38aff6d6302ac8a6a38e3bb3dfb0d20475c4974a9" -dependencies = [ - "anyhow", - "dashmap", - "lru", - "normpath", - "once_cell", - "parking_lot", - "path-clean 0.1.0", - "pathdiff", - "serde", - "serde_json", - "swc_atoms 0.6.7", - "swc_cached", - "swc_common 0.37.0", - "tracing", -] - -[[package]] -name = "swc_ecma_minifier" -version = "0.201.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d75a42254926bad8b7fa9390767a18ac608d99cfd5a3be675e4739c2cf7db1b" -dependencies = [ - "arrayvec", - "indexmap", - "num-bigint", - "num_cpus", - "once_cell", - "parking_lot", - "phf", - "radix_fmt", - "regex", - "rustc-hash", - "ryu-js", - "serde", - "serde_json", - "swc_allocator", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "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.149.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c7a81df222f44212c72fec4879c0d182c6eac66fb0e180afd05e8be6d920663" -dependencies = [ - "either", - "new_debug_unreachable", - "num-bigint", - "num-traits", - "phf", - "serde", - "smallvec", - "smartstring", - "stacker", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "tracing", - "typed-arena", -] - -[[package]] -name = "swc_ecma_preset_env" -version = "0.214.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e85162c77f8c80b55e5aed3a5e5477b74a53ce9cca05dec6e3dabec1de0f49af" -dependencies = [ - "anyhow", - "dashmap", - "indexmap", - "once_cell", - "preset_env_base", - "rustc-hash", - "semver 1.0.23", - "serde", - "serde_json", - "st-map", - "string_enum", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_transforms", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms" -version = "0.236.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d289a83ab829d076d6c2bf2cc0beea7fbf0480ac47a415401f683181a65f4856" -dependencies = [ - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "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", + "string_cache", + "swc_atoms 0.4.43", + "swc_eq_ignore_macros", + "swc_visit 0.5.14", + "termcolor", + "tracing", + "unicode-width", + "url", ] [[package]] -name = "swc_ecma_transforms_base" -version = "0.144.0" +name = "swc_common" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0a71579d030e12fd3cfbfc8712c4ce21afc526f2a759903c77d8df61950f5e" +checksum = "7200144c1d0b4b10c5b9057c3924365728da9e224f910ccaeabca6b573a6bd6a" dependencies = [ + "ast_node", "better_scoped_tls", - "bitflags", - "indexmap", + "cfg-if", + "either", + "from_variant", + "new_debug_unreachable", + "num-bigint", "once_cell", - "phf", "rustc-hash", "serde", - "smallvec", + "siphasher", + "swc_allocator", "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_eq_ignore_macros", + "swc_visit 0.6.1", "tracing", + "unicode-width", + "url", ] [[package]] -name = "swc_ecma_transforms_classes" -version = "0.133.0" +name = "swc_core" +version = "0.100.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f37ec04525798a09ce02e52dc15433acee2d86664da0b8ede55bb5cefd95384" +checksum = "48834ffc99ba591e190e6276bdd71a1278c204d39a5b7b1dedcf7c82afda30ba" dependencies = [ + "swc_allocator", "swc_atoms 0.6.7", "swc_common 0.37.0", "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_parser", "swc_ecma_transforms_base", - "swc_ecma_utils", "swc_ecma_visit", + "vergen", ] [[package]] -name = "swc_ecma_transforms_compat" -version = "0.170.0" +name = "swc_ecma_ast" +version = "0.118.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb500b65423646da940e289ad37e7c88332d7194248c33fc63a9e768e104fe5" +checksum = "d28b2b3ac8af922e693ee784881b2a32ca4604e1088072b66116003c225a44d9" dependencies = [ - "arrayvec", - "indexmap", + "bitflags", "is-macro", "num-bigint", - "serde", - "smallvec", + "phf", + "scoped-tls", + "string_enum", "swc_atoms 0.6.7", "swc_common 0.37.0", - "swc_config", - "swc_ecma_ast", - "swc_ecma_compat_bugfixes", - "swc_ecma_compat_common", - "swc_ecma_compat_es2015", - "swc_ecma_compat_es2016", - "swc_ecma_compat_es2017", - "swc_ecma_compat_es2018", - "swc_ecma_compat_es2019", - "swc_ecma_compat_es2020", - "swc_ecma_compat_es2021", - "swc_ecma_compat_es2022", - "swc_ecma_compat_es3", - "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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500a1dadad1e0e41e417d633b3d6d5de677c9e0d3159b94ba3348436cdb15aab" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.72", + "unicode-id-start", ] [[package]] -name = "swc_ecma_transforms_module" -version = "0.187.0" +name = "swc_ecma_codegen" +version = "0.155.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc022be297cdc70d5e71720587c7e810401a958577d77830f3108411e73c466d" +checksum = "644514f303dcad13f7d1c244b50af798e0549f6eb8c53d64dd2ba9824266c868" dependencies = [ - "Inflector", - "anyhow", - "bitflags", - "indexmap", - "is-macro", - "path-clean 1.0.1", - "pathdiff", - "regex", + "memchr", + "num-bigint", + "once_cell", "serde", + "sourcemap", + "swc_allocator", "swc_atoms 0.6.7", - "swc_cached", "swc_common 0.37.0", "swc_ecma_ast", - "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_codegen_macros", "tracing", ] [[package]] -name = "swc_ecma_transforms_optimization" -version = "0.205.0" +name = "swc_ecma_codegen_macros" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17446e46b75654901d962251ec4d0063423ee81759a325ed82fcf073308d97ca" +checksum = "859fabde36db38634f3fad548dd5e3410c1aebba1b67a3c63e67018fa57a0bca" dependencies = [ - "dashmap", - "indexmap", - "once_cell", - "petgraph", - "rustc-hash", - "serde_json", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_fast_graph", - "tracing", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.72", ] [[package]] -name = "swc_ecma_transforms_proposal" -version = "0.178.0" +name = "swc_ecma_parser" +version = "0.149.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9c7ddb3aae86f19eb9e41b0c62509d8e400c1dc79c0889df98f6df1ab893f3f" +checksum = "7c7a81df222f44212c72fec4879c0d182c6eac66fb0e180afd05e8be6d920663" dependencies = [ "either", - "rustc-hash", + "new_debug_unreachable", + "num-bigint", + "num-traits", + "phf", "serde", "smallvec", + "smartstring", + "stacker", "swc_atoms 0.6.7", "swc_common 0.37.0", "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", + "tracing", + "typed-arena", ] [[package]] -name = "swc_ecma_transforms_react" -version = "0.190.0" +name = "swc_ecma_transforms_base" +version = "0.144.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e54a8c87d90812bf69b0f07931bb629111a3f24efe83b9190c3a40a5ebc25e" +checksum = "7c0a71579d030e12fd3cfbfc8712c4ce21afc526f2a759903c77d8df61950f5e" dependencies = [ - "base64", - "dashmap", + "better_scoped_tls", + "bitflags", "indexmap", "once_cell", + "phf", + "rustc-hash", "serde", - "sha1", - "string_enum", - "swc_allocator", + "smallvec", "swc_atoms 0.6.7", "swc_common 0.37.0", - "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.195.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05edb03338cd1ce3986b459eb14f7b4b24eae85ebae7d96138884903748c56ec" -dependencies = [ - "ryu-js", - "serde", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "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.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb53b6fec4526660cc460f581b049a7f4bfb26b4b5d70aa0930c70abecf2f46" -dependencies = [ - "indexmap", - "rustc-hash", - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", "swc_ecma_utils", "swc_ecma_visit", - "swc_timer", "tracing", ] @@ -2796,50 +1765,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbe286e2eb813c957935bea1076cdb6d3cc9d6455dd29a0f3a283b7739bf4dc5" dependencies = [ "anyhow", - "miette 4.7.1", + "miette", "once_cell", "parking_lot", "swc_common 0.30.5", ] -[[package]] -name = "swc_error_reporters" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d049e9256abf29d9fc66d3db3ea44b6815a64ad565ce31e117a74ee96478bb3" -dependencies = [ - "anyhow", - "miette 7.2.0", - "once_cell", - "parking_lot", - "swc_common 0.37.0", -] - -[[package]] -name = "swc_fast_graph" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357e2c97bb51431d65080f25b436bc4e2fc1a7f64a643bc21a8353e478dc799f" -dependencies = [ - "indexmap", - "petgraph", - "rustc-hash", - "swc_common 0.37.0", -] - -[[package]] -name = "swc_graph_analyzer" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84e1d24a0d6e4066b42cfc00ab9b3109e314465aa199dd3e16849ed9566dce7" -dependencies = [ - "auto_impl", - "petgraph", - "swc_common 0.37.0", - "swc_fast_graph", - "tracing", -] - [[package]] name = "swc_macros_common" version = "0.3.13" @@ -2851,76 +1782,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "swc_node_comments" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d016ab18b432523b2a3c104ce3aaf7d869db46c0a41477dbfb6201ddc86c1eb0" -dependencies = [ - "dashmap", - "swc_atoms 0.6.7", - "swc_common 0.37.0", -] - -[[package]] -name = "swc_nodejs_common" -version = "0.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c121e55ae90c12401f80a95f0e6de71ba3f3c4dd22b512d163e46fae2f9e175b" -dependencies = [ - "anyhow", - "napi", - "serde", - "serde_json", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "swc_timer" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5fb6f8b8b85512aacbb3d7140a828666e0e0b1bcc69bf84000a0cd36306bab" -dependencies = [ - "tracing", -] - -[[package]] -name = "swc_trace_macro" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "swc_transform_common" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda3e80e1ad638d3575bc07745a914af13dcb02215098659f864731078271f2c" -dependencies = [ - "better_scoped_tls", - "once_cell", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "swc_typescript" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d043347b109a8aebfe01aaeada4af322304ea0f54ae8e5721df9afcb9305ca" -dependencies = [ - "swc_atoms 0.6.7", - "swc_common 0.37.0", - "swc_ecma_ast", - "thiserror", -] - [[package]] name = "swc_visit" version = "0.5.14" @@ -3088,7 +1949,7 @@ dependencies = [ "regex", "serde_json", "swc_common 0.30.5", - "swc_error_reporters 0.14.5", + "swc_error_reporters", "testing_macros", "tracing", "tracing-subscriber", @@ -3121,17 +1982,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "textwrap" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" -dependencies = [ - "smawk", - "unicode-linebreak", - "unicode-width", -] - [[package]] name = "thiserror" version = "1.0.63" @@ -3264,12 +2114,6 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -3473,15 +2317,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.48.0" diff --git a/crates/binding/Cargo.toml b/crates/binding/Cargo.toml index 936fb6b..e2bcbfb 100644 --- a/crates/binding/Cargo.toml +++ b/crates/binding/Cargo.toml @@ -14,7 +14,6 @@ crate-type = ["cdylib"] # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix napi = { version = "2.12.0", default-features = false, features = ["napi4"] } napi-derive = { version = "2.12.2" } -swc_core = { version = "0.100.1", features = ["base_node"] } svgr-rs = { path = "../core" } [build-dependencies] diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 838bf7e..ec72629 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -11,11 +11,8 @@ version = "0.1.3" regex = "1.7.3" swc_xml = "0.17.0" swc_core = { version = "0.100.1", features = [ + "__common", "ecma_ast", - "common_concurrent", - "bundler", - "ecma_loader", - "ecma_transforms", "ecma_visit", "ecma_codegen", "ecma_parser", diff --git a/crates/core/src/add_jsx_attribute.rs b/crates/core/src/add_jsx_attribute.rs index 9054d58..10a17ac 100644 --- a/crates/core/src/add_jsx_attribute.rs +++ b/crates/core/src/add_jsx_attribute.rs @@ -223,7 +223,7 @@ fn svg_prop_to_attr(key: &str, value: &str) -> Attribute { #[cfg(test)] mod tests { - use std::sync::Arc; + use std::rc::Rc; use swc_core::{ common::{FileName, SourceMap}, @@ -243,7 +243,7 @@ mod tests { } fn code_test(input: &str, opts: Options, expected: &str) { - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let lexer = Lexer::new( diff --git a/crates/core/src/hast_to_swc_ast/mod.rs b/crates/core/src/hast_to_swc_ast/mod.rs index a19f31b..7b066a4 100644 --- a/crates/core/src/hast_to_swc_ast/mod.rs +++ b/crates/core/src/hast_to_swc_ast/mod.rs @@ -248,7 +248,7 @@ pub fn to_swc_ast(hast: swc_xml::ast::Document) -> Option { #[cfg(test)] mod tests { - use std::{borrow::Borrow, path::PathBuf, sync::Arc}; + use std::{borrow::Borrow, path::PathBuf, rc::Rc}; use swc_core::{ common::{FileName, SourceFile, SourceMap}, @@ -259,7 +259,7 @@ mod tests { use super::*; - fn transform(cm: Arc, fm: Arc, minify: bool) -> String { + fn transform(cm: Rc, fm: Rc, minify: bool) -> String { let mut errors = vec![]; let doc = parse_file_as_document(fm.borrow(), Default::default(), &mut errors).unwrap(); @@ -291,7 +291,7 @@ mod tests { fn document_test(input: PathBuf) { let jsx_path = input.parent().unwrap().join("output.jsx"); - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.load_file(&input).expect("failed to load fixture file"); let res = transform(cm, fm, false); @@ -302,7 +302,7 @@ mod tests { } fn code_test(input: &str, expected: &str) { - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let res = transform(cm, fm, true); diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index bf85d2b..5e355f3 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -1,7 +1,7 @@ #![feature(path_file_prefix)] #![deny(clippy::all)] -use std::{borrow::Borrow, sync::Arc}; +use std::rc::Rc; use swc_core::{ common::{comments::SingleThreadedComments, FileName, SourceMap}, @@ -54,11 +54,11 @@ pub use self::core::state::{Caller, Config as State}; pub fn transform(code: String, config: Config, state: State) -> Result { let state = core::state::expand_state(&state); - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.new_source_file(FileName::Anon.into(), code); let mut errors = vec![]; - let document = parse_file_as_document(fm.borrow(), Default::default(), &mut errors) + let document = parse_file_as_document(fm.as_ref(), Default::default(), &mut errors) .map_err(|e| SvgrError::Parse(e.message().to_string()))?; let jsx_element = hast_to_swc_ast::to_swc_ast(document); diff --git a/crates/core/src/remove_jsx_attribute.rs b/crates/core/src/remove_jsx_attribute.rs index cfba981..e3d4393 100644 --- a/crates/core/src/remove_jsx_attribute.rs +++ b/crates/core/src/remove_jsx_attribute.rs @@ -51,8 +51,7 @@ impl VisitMut for Visitor { #[cfg(test)] mod tests { - use std::default::Default; - use std::sync::Arc; + use std::{default::Default, rc::Rc}; use swc_core::{ common::{FileName, SourceMap}, @@ -72,7 +71,7 @@ mod tests { } fn code_test(input: &str, opts: Options, expected: &str) { - let cm = Arc::new(SourceMap::default()); + let cm = Rc::new(SourceMap::default()); let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let lexer = Lexer::new( diff --git a/crates/core/src/replace_jsx_attribute.rs b/crates/core/src/replace_jsx_attribute.rs index 9580726..53c340d 100644 --- a/crates/core/src/replace_jsx_attribute.rs +++ b/crates/core/src/replace_jsx_attribute.rs @@ -64,7 +64,7 @@ fn get_attr_value(new: &str) -> JSXAttrValue { #[cfg(test)] mod tests { - use std::sync::Arc; + use std::rc::Rc; use swc_core::{ common::{FileName, SourceMap}, @@ -79,7 +79,7 @@ mod tests { use super::*; fn code_test(input: &str, replace_attr_values: HashMap, expected: &str) { - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let lexer = Lexer::new( diff --git a/crates/core/src/svg_dynamic_title.rs b/crates/core/src/svg_dynamic_title.rs index 11971e4..c19bde5 100644 --- a/crates/core/src/svg_dynamic_title.rs +++ b/crates/core/src/svg_dynamic_title.rs @@ -219,7 +219,7 @@ impl VisitMut for Visitor { #[cfg(test)] mod tests { - use std::sync::Arc; + use std::rc::Rc; use swc_core::{ common::{FileName, SourceMap}, @@ -234,7 +234,7 @@ mod tests { use super::*; fn code_test(input: &str, tag: String, expected: &str) { - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let lexer = Lexer::new( diff --git a/crates/core/src/svg_em_dimensions.rs b/crates/core/src/svg_em_dimensions.rs index e26c42c..8c19083 100644 --- a/crates/core/src/svg_em_dimensions.rs +++ b/crates/core/src/svg_em_dimensions.rs @@ -132,8 +132,7 @@ fn get_value(raw: Option<&Size>) -> JSXAttrValue { #[cfg(test)] mod tests { - use std::default::Default; - use std::sync::Arc; + use std::{default::Default, rc::Rc}; use swc_core::{ common::{FileName, SourceMap}, @@ -153,7 +152,7 @@ mod tests { } fn code_test(input: &str, opts: Options, expected: &str) { - let cm = Arc::new(SourceMap::default()); + let cm = Rc::new(SourceMap::default()); let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let lexer = Lexer::new( diff --git a/crates/core/src/transform_react_native_svg.rs b/crates/core/src/transform_react_native_svg.rs index cebb85b..8f11e68 100644 --- a/crates/core/src/transform_react_native_svg.rs +++ b/crates/core/src/transform_react_native_svg.rs @@ -1,4 +1,5 @@ -use std::{cell::RefCell, collections::HashMap, rc::Rc}; +use std::rc::Rc; +use std::{cell::RefCell, collections::HashMap}; use linked_hash_set::LinkedHashSet; use swc_core::common::SyntaxContext; @@ -249,8 +250,6 @@ impl VisitMut for ImportDeclVisitor { #[cfg(test)] mod tests { - use std::sync::Arc; - use swc_core::{ common::{comments::SingleThreadedComments, FileName, SourceMap}, ecma::{ @@ -264,7 +263,7 @@ mod tests { use super::*; fn code_test(input: &str, expected: &str) { - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let lexer = Lexer::new( diff --git a/crates/core/src/transform_svg_component/mod.rs b/crates/core/src/transform_svg_component/mod.rs index 21f7efc..d5c7f03 100644 --- a/crates/core/src/transform_svg_component/mod.rs +++ b/crates/core/src/transform_svg_component/mod.rs @@ -128,7 +128,7 @@ pub fn transform( #[cfg(test)] mod tests { - use std::{borrow::Borrow, sync::Arc}; + use std::rc::Rc; use swc_core::{ common::{FileName, SourceMap}, @@ -147,12 +147,12 @@ mod tests { state: &core::state::InternalConfig, expected: &str, ) { - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let mut recovered_errors = vec![]; let expr = parser::parse_file_as_expr( - fm.borrow(), + fm.as_ref(), parser::Syntax::Es(parser::EsSyntax { jsx: true, ..Default::default() diff --git a/crates/core/src/transform_svg_component/variables.rs b/crates/core/src/transform_svg_component/variables.rs index cd3be76..304b3c2 100644 --- a/crates/core/src/transform_svg_component/variables.rs +++ b/crates/core/src/transform_svg_component/variables.rs @@ -1,4 +1,4 @@ -use std::{borrow::Borrow, sync::Arc}; +use std::rc::Rc; use swc_core::common::SyntaxContext; use swc_core::{ @@ -323,12 +323,12 @@ pub fn get_variables( if let Some(caller) = &state.caller { if let Some(previous_export) = caller.previous_export.clone() { - let cm = Arc::::default(); + let cm = Rc::::default(); let fm = cm.new_source_file(FileName::Anon.into(), previous_export); let mut recovered_errors = vec![]; let module = parser::parse_file_as_module( - fm.borrow(), + fm.as_ref(), parser::Syntax::Es(parser::EsSyntax { jsx: true, ..Default::default()