From 41877a7469984178869194b219040f51af0a9f03 Mon Sep 17 00:00:00 2001 From: Jeremy Mack Date: Mon, 23 Sep 2024 03:41:08 -0500 Subject: [PATCH] feat: update to swc_core 90.35 and support new test style (#64) --- CONTRIBUTING.md | 6 + packages/typewind/Cargo.lock | 623 +++++++++--------- packages/typewind/Cargo.toml | 2 +- packages/typewind/rust-toolchain | 1 + packages/typewind/swc/lib.rs | 5 +- .../tests/__swc_snapshots__/swc/lib.rs/boo.js | 1 + 6 files changed, 326 insertions(+), 312 deletions(-) create mode 100644 packages/typewind/rust-toolchain create mode 100644 packages/typewind/tests/__swc_snapshots__/swc/lib.rs/boo.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 61d0377..721e871 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,12 @@ You can run the test suite using the following commands: cargo test ``` +You can run update the test suite snapshot using the following command: + +```sh +UPDATE=1 cargo test +``` + To test the features you've added, run the following command: ```sh diff --git a/packages/typewind/Cargo.lock b/packages/typewind/Cargo.lock index 670777d..d384eb9 100644 --- a/packages/typewind/Cargo.lock +++ b/packages/typewind/Cargo.lock @@ -58,21 +58,20 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" [[package]] name = "ast_node" -version = "0.9.5" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09c69dffe06d222d072c878c3afe86eee2179806f20503faec97250268b4c24" +checksum = "f9184f2b369b3e8625712493c89b785881f27eedc6cde480a81883cef78868b2" dependencies = [ - "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] @@ -109,9 +108,18 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64-simd" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +dependencies = [ + "simd-abstraction", +] [[package]] name = "better_scoped_tls" @@ -130,9 +138,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -177,6 +185,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + [[package]] name = "camino" version = "1.1.6" @@ -209,6 +223,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.19", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cc" version = "1.0.83" @@ -259,12 +287,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "deranged" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" - [[package]] name = "diff" version = "0.1.13" @@ -289,29 +311,15 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "enum-iterator" -version = "1.4.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" -dependencies = [ - "enum-iterator-derive", -] +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] -name = "enum-iterator-derive" -version = "1.2.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -351,14 +359,13 @@ dependencies = [ [[package]] name = "from_variant" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ec5dc38ee19078d84a692b1c41181ff9f94331c76cee66ff0208c770b5e54f" +checksum = "32016f1242eb82af5474752d00fd8ebcd9004bd69b462b1c91de833972d08ed4" dependencies = [ - "pmutil", "proc-macro2", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] @@ -388,18 +395,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "gimli" version = "0.28.0" @@ -421,6 +416,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -442,6 +443,20 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hstr" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae404c0c5d4e95d4858876ab02eecd6a196bb8caa42050dfa809938833fc412" +dependencies = [ + "hashbrown 0.14.5", + "new_debug_unreachable", + "once_cell", + "phf", + "rustc-hash", + "triomphe", +] + [[package]] name = "idna" version = "0.4.0" @@ -460,25 +475,24 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ - "autocfg", - "hashbrown", + "equivalent", + "hashbrown 0.14.5", ] [[package]] name = "is-macro" -version = "0.3.0" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4467ed1321b310c2625c5aa6c1b1ffc5de4d9e42668cf697a08fb033ee8265e" +checksum = "2069faacbe981460232f880d26bf3c7634e322d49053aa48c27e3ae642f728f1" dependencies = [ "Inflector", - "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] @@ -650,9 +664,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "outref" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" [[package]] name = "overload" @@ -697,13 +717,12 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "phf" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", - "phf_shared", - "proc-macro-hack", + "phf_shared 0.11.2", ] [[package]] @@ -712,22 +731,31 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ - "phf_shared", + "phf_shared 0.10.0", + "rand", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", "rand", ] [[package]] name = "phf_macros" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro-hack", + "phf_generator 0.11.2", + "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] @@ -740,21 +768,19 @@ dependencies = [ ] [[package]] -name = "pin-project-lite" -version = "0.2.13" +name = "phf_shared" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] [[package]] -name = "pmutil" -version = "0.6.1" +name = "pin-project-lite" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "ppv-lite86" @@ -778,41 +804,11 @@ dependencies = [ "yansi", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -848,9 +844,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -961,13 +957,14 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.42" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" dependencies = [ "bitvec", "bytecheck", - "hashbrown", + "bytes", + "hashbrown 0.12.3", "ptr_meta", "rend", "rkyv_derive", @@ -978,9 +975,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.42" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ "proc-macro2", "quote", @@ -1014,7 +1011,7 @@ version = "0.38.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -1077,40 +1074,41 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "sha-1" -version = "0.10.1" +name = "sha2" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -1126,6 +1124,15 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "simd-abstraction" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" +dependencies = [ + "outref", +] + [[package]] name = "simdutf8" version = "0.1.4" @@ -1177,6 +1184,25 @@ dependencies = [ "url", ] +[[package]] +name = "sourcemap" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" +dependencies = [ + "base64-simd", + "bitvec", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash", + "rustc_version", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1211,7 +1237,7 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot", - "phf_shared", + "phf_shared 0.10.0", "precomputed-hash", "serde", ] @@ -1222,23 +1248,22 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.10.0", + "phf_shared 0.10.0", "proc-macro2", "quote", ] [[package]] name = "string_enum" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fa4d4f81d7c05b9161f8de839975d3326328b8ba2831164b465524cc2f55252" +checksum = "05e383308aebc257e7d7920224fa055c632478d92744eca77f99be8fa1545b90" dependencies = [ - "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] @@ -1275,9 +1300,7 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f54563d7dcba626d4acfe14ed12def7ecc28e004debe3ecd2c3ee07cc47e449" dependencies = [ - "bytecheck", "once_cell", - "rkyv", "rustc-hash", "serde", "string_cache", @@ -1285,34 +1308,41 @@ dependencies = [ "triomphe", ] +[[package]] +name = "swc_atoms" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6567e4e67485b3e7662b486f1565bdae54bd5b9d6b16b2ba1a9babb1e42125" +dependencies = [ + "bytecheck", + "hstr", + "once_cell", + "rkyv", + "rustc-hash", + "serde", +] + [[package]] name = "swc_common" -version = "0.31.22" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d00f960c667c59c133f30492f4d07f26242fcf988a066d3871e6d3d838d528" +checksum = "9c84742fc22df1c293da5354c1cc8a5b45a045e9dc941005c1fd9cb4e9bdabc1" dependencies = [ - "anyhow", "ast_node", - "atty", "better_scoped_tls", - "bytecheck", "cfg-if", "either", "from_variant", "new_debug_unreachable", "num-bigint", "once_cell", - "parking_lot", - "rkyv", "rustc-hash", "serde", "siphasher", - "sourcemap", "string_cache", - "swc_atoms", + "swc_atoms 0.5.9", "swc_eq_ignore_macros", "swc_visit", - "termcolor", "tracing", "unicode-width", "url", @@ -1320,25 +1350,31 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.32.1" +version = "0.33.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c84742fc22df1c293da5354c1cc8a5b45a045e9dc941005c1fd9cb4e9bdabc1" +checksum = "a2f9706038906e66f3919028f9f7a37f3ed552f1b85578e93f4468742e2da438" dependencies = [ + "anyhow", "ast_node", + "atty", "better_scoped_tls", + "bytecheck", "cfg-if", "either", "from_variant", "new_debug_unreachable", "num-bigint", "once_cell", + "parking_lot", + "rkyv", "rustc-hash", "serde", "siphasher", - "string_cache", - "swc_atoms", + "sourcemap 8.0.1", + "swc_atoms 0.6.7", "swc_eq_ignore_macros", "swc_visit", + "termcolor", "tracing", "unicode-width", "url", @@ -1346,14 +1382,14 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.79.71" +version = "0.90.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cc00b001e77b2c9019cbd5034fddbb627bb23010864a0e57d4943efa70644b" +checksum = "ecbbbf25e5d035165bde87f2388f9fbe6d5ce38ddd2c6cb9f24084823a9c0044" dependencies = [ "once_cell", - "swc_atoms", - "swc_common 0.31.22", - "swc_ecma_ast 0.107.8", + "swc_atoms 0.6.7", + "swc_common 0.33.26", + "swc_ecma_ast 0.112.8", "swc_ecma_transforms_base", "swc_ecma_transforms_testing", "swc_ecma_visit", @@ -1365,139 +1401,141 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.107.8" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6528f3dd33e11eae9d7fe9fee4a79d5bbd211c74426ab2eec64dc82bd2eb74d" +checksum = "e063a1614daed3ea8be56e5dd8edb17003409088d2fc9ce4aca3378879812607" dependencies = [ - "bitflags 2.4.0", - "bytecheck", + "bitflags 2.6.0", "is-macro", "num-bigint", - "rkyv", "scoped-tls", "string_enum", - "swc_atoms", - "swc_common 0.31.22", + "swc_atoms 0.5.9", + "swc_common 0.32.1", "unicode-id", ] [[package]] name = "swc_ecma_ast" -version = "0.109.1" +version = "0.112.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e063a1614daed3ea8be56e5dd8edb17003409088d2fc9ce4aca3378879812607" +checksum = "d1d5c33c22ad50e8e34b3080a6fb133316d2eaa7d00400fc5018151f5ca44c5a" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", + "bytecheck", "is-macro", "num-bigint", + "phf", + "rkyv", "scoped-tls", "string_enum", - "swc_atoms", - "swc_common 0.32.1", - "unicode-id", + "swc_atoms 0.6.7", + "swc_common 0.33.26", + "unicode-id-start", ] [[package]] name = "swc_ecma_codegen" -version = "0.142.18" +version = "0.145.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "933643517578f6c383fead24be0ba707c8548d43a9f80c46cc6972c5d7a0ab3a" +checksum = "547ed57b827ea4df3e2c27cea153482f8b2ce2d271ae30c456fbb2d5a5ecc19d" dependencies = [ "memchr", "num-bigint", "once_cell", "rustc-hash", "serde", - "sourcemap", - "swc_atoms", - "swc_common 0.31.22", - "swc_ecma_ast 0.107.8", + "sourcemap 6.4.1", + "swc_atoms 0.5.9", + "swc_common 0.32.1", + "swc_ecma_ast 0.109.1", "swc_ecma_codegen_macros", "tracing", ] [[package]] name = "swc_ecma_codegen" -version = "0.145.5" +version = "0.148.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547ed57b827ea4df3e2c27cea153482f8b2ce2d271ae30c456fbb2d5a5ecc19d" +checksum = "154d03dc43e4033b668bc5021bd67088ff27f0d8da054348b5cd4e6fe94e7f26" dependencies = [ "memchr", "num-bigint", "once_cell", "rustc-hash", "serde", - "sourcemap", - "swc_atoms", - "swc_common 0.32.1", - "swc_ecma_ast 0.109.1", + "sourcemap 8.0.1", + "swc_atoms 0.6.7", + "swc_common 0.33.26", + "swc_ecma_ast 0.112.8", "swc_ecma_codegen_macros", "tracing", ] [[package]] name = "swc_ecma_codegen_macros" -version = "0.7.3" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcdff076dccca6cc6a0e0b2a2c8acfb066014382bc6df98ec99e755484814384" +checksum = "859fabde36db38634f3fad548dd5e3410c1aebba1b67a3c63e67018fa57a0bca" dependencies = [ - "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] name = "swc_ecma_parser" -version = "0.137.16" +version = "0.143.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f95601ae9654b664a44154bd5186af106df8e7de2dfecad211b29dc90b84185" +checksum = "40b7faa481ac015b330f1c4bc8df2c9947242020e23ccdb10bc7a8ef84342509" dependencies = [ "either", + "new_debug_unreachable", "num-bigint", "num-traits", + "phf", "serde", "smallvec", "smartstring", "stacker", - "swc_atoms", - "swc_common 0.31.22", - "swc_ecma_ast 0.107.8", + "swc_atoms 0.6.7", + "swc_common 0.33.26", + "swc_ecma_ast 0.112.8", "tracing", "typed-arena", ] [[package]] name = "swc_ecma_testing" -version = "0.20.19" +version = "0.22.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fe5b4d4ce8851df5e0fe7599b5df70ba4504c26e996bdf12c81c08e330c94b2" +checksum = "dbe778ce5eae6a7e620e1f6b5326e78f00203c4548e0c659fd22da8be0538fd1" dependencies = [ "anyhow", "hex", - "sha-1", + "sha2", "testing", "tracing", ] [[package]] name = "swc_ecma_transforms_base" -version = "0.130.25" +version = "0.137.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42198e3909a6d852ebd88897267ee89323a8ebdbdb436ec60f48079f7c188018" +checksum = "660badfe2eed8b6213ec9dcd71aa0786f8fb46ffa012e0313bcba1fe4a9a5c73" dependencies = [ "better_scoped_tls", - "bitflags 2.4.0", + "bitflags 2.6.0", "indexmap", "once_cell", "phf", "rustc-hash", "serde", "smallvec", - "swc_atoms", - "swc_common 0.31.22", - "swc_ecma_ast 0.107.8", + "swc_atoms 0.6.7", + "swc_common 0.33.26", + "swc_ecma_ast 0.112.8", "swc_ecma_parser", "swc_ecma_utils", "swc_ecma_visit", @@ -1506,9 +1544,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.133.25" +version = "0.140.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ddad20242eba6b08f14fba779c8354612f3812008f63f0a2655fbcd17be0ced" +checksum = "7c0ea6f85b7bf04391a172d7a369e49865effa77ec3a6cd0e969a274cfcb982d" dependencies = [ "ansi_term", "anyhow", @@ -1516,11 +1554,11 @@ dependencies = [ "hex", "serde", "serde_json", - "sha-1", - "sourcemap", - "swc_common 0.31.22", - "swc_ecma_ast 0.107.8", - "swc_ecma_codegen 0.142.18", + "sha2", + "sourcemap 8.0.1", + "swc_common 0.33.26", + "swc_ecma_ast 0.112.8", + "swc_ecma_codegen 0.148.18", "swc_ecma_parser", "swc_ecma_testing", "swc_ecma_transforms_base", @@ -1532,17 +1570,17 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.120.20" +version = "0.127.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058e23023eab86b548b0488b84a4d490f8d2f5e1de6483d82e352218fd59ae31" +checksum = "15d40abfc4f3a7bfdf54d11ac705cc9dd0836c48bf085b359143b4d40b50cb31" dependencies = [ "indexmap", "num_cpus", "once_cell", "rustc-hash", - "swc_atoms", - "swc_common 0.31.22", - "swc_ecma_ast 0.107.8", + "swc_atoms 0.6.7", + "swc_common 0.33.26", + "swc_ecma_ast 0.112.8", "swc_ecma_visit", "tracing", "unicode-id", @@ -1550,53 +1588,51 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.93.8" +version = "0.98.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9abcc6c3255eea772716872d9c958abfe97b1f4658c7a9d1d9dc55eb7e6da254" +checksum = "93692bdcdbb63db8f5e10fea5d202b5487cb27eb443aec424f4335c88f9864af" dependencies = [ "num-bigint", - "swc_atoms", - "swc_common 0.31.22", - "swc_ecma_ast 0.107.8", + "swc_atoms 0.6.7", + "swc_common 0.33.26", + "swc_ecma_ast 0.112.8", "swc_visit", "tracing", ] [[package]] name = "swc_eq_ignore_macros" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a95d367e228d52484c53336991fdcf47b6b553ef835d9159db4ba40efb0ee8" +checksum = "63db0adcff29d220c3d151c5b25c0eabe7e32dd936212b84cdaa1392e3130497" dependencies = [ - "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] name = "swc_error_reporters" -version = "0.15.22" +version = "0.17.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c5d3bfe85c5f3e50f5a604398ca6b0830a45344b602a53b153b46fe56d3f02" +checksum = "72100a5f7b0c178adf7bcc5e7c8ad9d4180f499a5f5bae9faf3f417c7cbc4915" dependencies = [ "anyhow", "miette", "once_cell", "parking_lot", - "swc_common 0.31.22", + "swc_common 0.33.26", ] [[package]] name = "swc_macros_common" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a273205ccb09b51fabe88c49f3b34c5a4631c4c00a16ae20e03111d6a42e832" +checksum = "f486687bfb7b5c560868f69ed2d458b880cebc9babebcb67e49f31b55c5bf847" dependencies = [ - "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] @@ -1610,25 +1646,25 @@ dependencies = [ [[package]] name = "swc_plugin_macro" -version = "0.9.15" +version = "0.9.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "785309d342a69df4c929ee59e14e36889ca832f1d2a3c1d03c47c93126c72dbc" +checksum = "3232db481484070637b20a155c064096c0ea1ba04fa2247b89b618661b3574f4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] name = "swc_plugin_proxy" -version = "0.36.8" +version = "0.41.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb75fb6cd712b8e5f8e2cf7d7ac9bbbdbd7e475af9de54842b97f2a02638d73" +checksum = "7e09ebf5da9eb13f431ebfb916cd3378a87ffae927ba896261ebc9dc094457ae" dependencies = [ "better_scoped_tls", "rkyv", - "swc_common 0.31.22", - "swc_ecma_ast 0.107.8", + "swc_common 0.33.26", + "swc_ecma_ast 0.112.8", "swc_trace_macro", "tracing", ] @@ -1641,14 +1677,14 @@ checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] name = "swc_visit" -version = "0.5.7" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c337fbb2d191bf371173dea6a957f01899adb8f189c6c31b122a6cfc98fc3" +checksum = "043d11fe683dcb934583ead49405c0896a5af5face522e4682c16971ef7871b9" dependencies = [ "either", "swc_visit_macros", @@ -1656,16 +1692,15 @@ dependencies = [ [[package]] name = "swc_visit_macros" -version = "0.5.8" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f322730fb82f3930a450ac24de8c98523af7d34ab8cb2f46bcb405839891a99" +checksum = "92807d840959f39c60ce8a774a3f83e8193c658068e6d270dbe0a05e40e90b41" dependencies = [ "Inflector", - "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] @@ -1681,9 +1716,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -1730,18 +1765,19 @@ dependencies = [ [[package]] name = "testing" -version = "0.33.25" +version = "0.35.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c722daaa5ad2208e7abd37aa92b4699bec2b053297859faecc5ccebf3bc7425" +checksum = "15028f8ec7f95006f4e00e6c5ab6620f322bc6dc208a6cba09afa36375981cec" dependencies = [ "ansi_term", - "cargo_metadata", + "cargo_metadata 0.15.4", "difference", "once_cell", "pretty_assertions", "regex", + "serde", "serde_json", - "swc_common 0.31.22", + "swc_common 0.33.26", "swc_error_reporters", "testing_macros", "tracing", @@ -1750,19 +1786,18 @@ dependencies = [ [[package]] name = "testing_macros" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c15b796025051a07f1ac695ee0cac0883f05a0d510c9d171ef8d31a992e6a5" +checksum = "a39660370116afe46d5ff8bcb01b7afe2140dda3137ef5cb1914681e37a4ee06" dependencies = [ "anyhow", "glob", "once_cell", - "pmutil", "proc-macro2", "quote", "regex", "relative-path", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] @@ -1793,7 +1828,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] @@ -1806,34 +1841,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" -dependencies = [ - "deranged", - "itoa", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" -dependencies = [ - "time-core", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1851,11 +1858,10 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1863,20 +1869,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.77", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -1884,20 +1890,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -1913,9 +1919,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.9" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" dependencies = [ "serde", "stable_deref_trait", @@ -1955,6 +1961,12 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" +[[package]] +name = "unicode-id-start" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc3882f69607a2ac8cc4de3ee7993d8f68bb06f2974271195065b3bd07f2edea" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -2007,17 +2019,14 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vergen" -version = "7.5.1" +version = "8.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21b881cd6636ece9735721cf03c1fe1e774fe258683d084bb2812ab67435749" +checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566" dependencies = [ "anyhow", - "cfg-if", - "enum-iterator", - "getset", + "cargo_metadata 0.18.1", + "regex", "rustversion", - "thiserror", - "time", ] [[package]] diff --git a/packages/typewind/Cargo.toml b/packages/typewind/Cargo.toml index e478a2e..4613f9d 100644 --- a/packages/typewind/Cargo.toml +++ b/packages/typewind/Cargo.toml @@ -13,7 +13,7 @@ lto = true [dependencies] serde = "1" serde_json = "1.0.93" -swc_core = { version = "0.79.28", features = ["ecma_plugin_transform"] } +swc_core = { version = "0.90.35", features = ["ecma_plugin_transform"] } swc_ecma_codegen = "0.145.5" # .cargo/config defines few alias to build plugin. diff --git a/packages/typewind/rust-toolchain b/packages/typewind/rust-toolchain new file mode 100644 index 0000000..aaceec0 --- /dev/null +++ b/packages/typewind/rust-toolchain @@ -0,0 +1 @@ +1.80.0 diff --git a/packages/typewind/swc/lib.rs b/packages/typewind/swc/lib.rs index 3288c3c..eea04d0 100644 --- a/packages/typewind/swc/lib.rs +++ b/packages/typewind/swc/lib.rs @@ -226,8 +226,5 @@ test!( Default::default(), |_| as_folder(TransformVisitor::new()), boo, - // Input codes - r#"let style = tw.flex.$lg(tw.bg_black$['20']).md(tw.important(tw.works).text_["18px"].text_["red-200"]).variant('&:nth-child(3)', tw.underline).raw("s-1/2")"#, - // Output codes after transformed with plugin - r#"let style = "flex @lg:bg-black/20 md:text-red-200 md:text-[18px] md:!works [&:nth-child(3)]:underline s-1/2""# + r#"let style = tw.flex.$lg(tw.bg_black$['20']).md(tw.important(tw.works).text_["18px"].text_["red-200"]).variant('&:nth-child(3)', tw.underline).raw("s-1/2")"# ); diff --git a/packages/typewind/tests/__swc_snapshots__/swc/lib.rs/boo.js b/packages/typewind/tests/__swc_snapshots__/swc/lib.rs/boo.js new file mode 100644 index 0000000..50c0311 --- /dev/null +++ b/packages/typewind/tests/__swc_snapshots__/swc/lib.rs/boo.js @@ -0,0 +1 @@ +let style = "flex @lg:bg-black/20 md:text-red-200 md:text-[18px] md:!works [&:nth-child(3)]:underline s-1/2";