diff --git a/Cargo.lock b/Cargo.lock index 6d888ab..78f87d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,6 +60,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "ansi_term" version = "0.12.1" @@ -71,15 +77,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "ast_node" -version = "0.9.7" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e521452c6bce47ee5a5461c5e5d707212907826de14124962c58fcaf463115e" +checksum = "f9184f2b369b3e8625712493c89b785881f27eedc6cde480a81883cef78868b2" dependencies = [ "proc-macro2", "quote", @@ -170,6 +176,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +dependencies = [ + "allocator-api2", +] + [[package]] name = "bytecheck" version = "0.6.12" @@ -284,6 +299,41 @@ dependencies = [ "typenum", ] +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.60", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.60", +] + [[package]] name = "dashmap" version = "5.5.3" @@ -291,7 +341,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -313,6 +363,37 @@ dependencies = [ "uuid", ] +[[package]] +name = "derive_builder" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" +dependencies = [ + "derive_builder_core", + "syn 2.0.60", +] + [[package]] name = "diff" version = "0.1.13" @@ -363,6 +444,12 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -374,9 +461,9 @@ dependencies = [ [[package]] name = "from_variant" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a0b11eeb173ce52f84ebd943d42e58813a2ebb78a6a3ff0a243b71c5199cd7b" +checksum = "32016f1242eb82af5474752d00fd8ebcd9004bd69b462b1c91de833972d08ed4" dependencies = [ "proc-macro2", "swc_macros_common", @@ -433,9 +520,13 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] [[package]] name = "hermit-abi" @@ -464,7 +555,7 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96274be293b8877e61974a607105d09c84caebe9620b47774aa8a6b942042dd4" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", "new_debug_unreachable", "once_cell", "phf", @@ -472,6 +563,12 @@ dependencies = [ "triomphe", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.5.0" @@ -495,7 +592,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -579,14 +676,28 @@ checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" dependencies = [ "atty", "backtrace", - "miette-derive", + "miette-derive 4.7.1", "once_cell", - "owo-colors", + "owo-colors 3.5.0", "supports-color", "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap", + "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.1.0", + "textwrap 0.16.1", "thiserror", "unicode-width", ] @@ -602,6 +713,17 @@ 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.60", +] + [[package]] name = "miniz_oxide" version = "0.7.2" @@ -700,6 +822,12 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "owo-colors" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" + [[package]] name = "parking_lot" version = "0.12.2" @@ -912,9 +1040,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -1034,9 +1162,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" @@ -1044,6 +1172,12 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +[[package]] +name = "ryu-js" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" + [[package]] name = "scoped-tls" version = "1.0.1" @@ -1118,10 +1252,10 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.10.0" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -1194,9 +1328,9 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "sourcemap" -version = "8.0.1" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" +checksum = "dab08a862c70980b8e23698b507e272317ae52a608a164a844111f5372374f1f" dependencies = [ "base64-simd", "bitvec", @@ -1264,9 +1398,9 @@ dependencies = [ [[package]] name = "string_enum" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6960defec35d15d58331ffb8a315d551634f757fe139c7b3d6063cae88ec90f6" +checksum = "05e383308aebc257e7d7920224fa055c632478d92744eca77f99be8fa1545b90" dependencies = [ "proc-macro2", "quote", @@ -1274,6 +1408,12 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "supports-color" version = "1.3.1" @@ -1302,6 +1442,19 @@ dependencies = [ "atty", ] +[[package]] +name = "swc_allocator" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc8bd3075d1c6964010333fae9ddcd91ad422a4f8eb8b3206a9b2b6afb4209e" +dependencies = [ + "bumpalo", + "hashbrown 0.14.5", + "ptr_meta", + "rustc-hash", + "triomphe", +] + [[package]] name = "swc_atoms" version = "0.5.9" @@ -1366,7 +1519,7 @@ dependencies = [ "string_cache", "swc_atoms 0.5.9", "swc_eq_ignore_macros", - "swc_visit", + "swc_visit 0.5.13", "termcolor", "tracing", "unicode-width", @@ -1375,13 +1528,12 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.33.25" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a529796c240cd87da18d26d63f9de4c7ad3680cf0a04b95f0c37f4c4f0a0da63" +checksum = "0a69266c96a6a41bc2de27fdf14fdf5995549b6244f99c9b07604569576657eb" dependencies = [ "anyhow", "ast_node", - "atty", "better_scoped_tls", "bytecheck", "cfg-if", @@ -1396,9 +1548,10 @@ dependencies = [ "serde", "siphasher", "sourcemap", + "swc_allocator", "swc_atoms 0.6.7", "swc_eq_ignore_macros", - "swc_visit", + "swc_visit 0.6.2", "termcolor", "tracing", "unicode-width", @@ -1407,9 +1560,9 @@ dependencies = [ [[package]] name = "swc_config" -version = "0.1.12" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ada712ac5e28a301683c8af957e8a56deca675cbc376473dd207a527b989efb5" +checksum = "4740e53eaf68b101203c1df0937d5161a29f3c13bceed0836ddfe245b72dd000" dependencies = [ "anyhow", "indexmap", @@ -1421,9 +1574,9 @@ dependencies = [ [[package]] name = "swc_config_macro" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2574f75082322a27d990116cd2a24de52945fc94172b24ca0b3e9e2a6ceb6b" +checksum = "7c5f56139042c1a95b54f5ca48baa0e0172d369bcc9d3d473dad1de36bae8399" dependencies = [ "proc-macro2", "quote", @@ -1433,13 +1586,14 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.90.37" +version = "0.104.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecbbbf25e5d035165bde87f2388f9fbe6d5ce38ddd2c6cb9f24084823a9c0044" +checksum = "c99f06e547d867763baa35a3f58aca9c894735d6318f56cb9944819d47c4d5dd" dependencies = [ "once_cell", + "swc_allocator", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_quote_macros", @@ -1456,9 +1610,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.112.8" +version = "0.119.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1d5c33c22ad50e8e34b3080a6fb133316d2eaa7d00400fc5018151f5ca44c5a" +checksum = "69e9696b3d02197c16ba7548c95b31f7ca79532200d269ce3ad03a5b2174cf28" dependencies = [ "bitflags", "bytecheck", @@ -1469,24 +1623,24 @@ dependencies = [ "scoped-tls", "string_enum", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "unicode-id-start", ] [[package]] name = "swc_ecma_codegen" -version = "0.148.18" +version = "0.156.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "154d03dc43e4033b668bc5021bd67088ff27f0d8da054348b5cd4e6fe94e7f26" +checksum = "91593151f66eb0a731a63e5a5c1253cb51bb04dee2b6733dcb5e5ee0c86480dc" dependencies = [ "memchr", "num-bigint", "once_cell", - "rustc-hash", "serde", "sourcemap", + "swc_allocator", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", "swc_ecma_codegen_macros", "tracing", @@ -1494,9 +1648,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "0.7.5" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ab87ba81ae05efd394ab4a8cbdba595ac3554a5e393c76699449d47c43582e" +checksum = "859fabde36db38634f3fad548dd5e3410c1aebba1b67a3c63e67018fa57a0bca" dependencies = [ "proc-macro2", "quote", @@ -1506,9 +1660,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.143.16" +version = "0.150.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b7faa481ac015b330f1c4bc8df2c9947242020e23ccdb10bc7a8ef84342509" +checksum = "071840b1838add74470d759f69783f41f860c1dc69a1317db3bd2efbed9b8338" dependencies = [ "either", "new_debug_unreachable", @@ -1520,7 +1674,7 @@ dependencies = [ "smartstring", "stacker", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", "tracing", "typed-arena", @@ -1528,15 +1682,15 @@ dependencies = [ [[package]] name = "swc_ecma_quote_macros" -version = "0.54.13" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a0e789f5cced50904847f0fefef0f416156c12f0e0cf8b054f6fba6233023a" +checksum = "019157849effc56b81eb30784fd8250d10d6166acca1ca435c350df14253f610" dependencies = [ "anyhow", "proc-macro2", "quote", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", "swc_ecma_parser", "swc_macros_common", @@ -1545,22 +1699,22 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "0.22.22" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5704ef494b1805bc4566ff566b964bc1e9d3fb0f0e046ad6392b09a54de844" +checksum = "4fe99d65324a07ff5a85ae8a616633eca3b99537becc44e1ed6b2e91d4075858" dependencies = [ "anyhow", "hex", "sha2", - "testing 0.35.23", + "testing 0.40.0", "tracing", ] [[package]] name = "swc_ecma_transforms_base" -version = "0.137.21" +version = "0.147.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "660badfe2eed8b6213ec9dcd71aa0786f8fb46ffa012e0313bcba1fe4a9a5c73" +checksum = "5b1e55ce789bd4411b1e0a8b83149c70dd1186e38471fd65860dcece8a522f2f" dependencies = [ "better_scoped_tls", "bitflags", @@ -1571,7 +1725,7 @@ dependencies = [ "serde", "smallvec", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_utils", @@ -1581,9 +1735,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_macros" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e309b88f337da54ef7fe4c5b99c2c522927071f797ee6c9fb8b6bf2d100481" +checksum = "500a1dadad1e0e41e417d633b3d6d5de677c9e0d3159b94ba3348436cdb15aab" dependencies = [ "proc-macro2", "quote", @@ -1593,19 +1747,20 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.183.19" +version = "0.193.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2570aa788b03d38404558d4822c7b88a35a930a47cf2417cc7732a032015e43d" +checksum = "bb0e3627caeba0c9a7ecf2fe68c21dcd5e67bcd2c4bb357df3008cc0aed3ce5d" dependencies = [ "base64", "dashmap", "indexmap", "once_cell", "serde", - "sha-1", + "sha1", "string_enum", + "swc_allocator", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_config", "swc_ecma_ast", "swc_ecma_parser", @@ -1617,9 +1772,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.140.18" +version = "0.150.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0ea6f85b7bf04391a172d7a369e49865effa77ec3a6cd0e969a274cfcb982d" +checksum = "c2c741b78571e1597df977cd91ba9e605e08caa588a186c2ede7740dc08cb1a6" dependencies = [ "ansi_term", "anyhow", @@ -1629,7 +1784,7 @@ dependencies = [ "serde_json", "sha2", "sourcemap", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", "swc_ecma_codegen", "swc_ecma_parser", @@ -1638,21 +1793,22 @@ dependencies = [ "swc_ecma_utils", "swc_ecma_visit", "tempfile", - "testing 0.35.23", + "testing 0.40.0", ] [[package]] name = "swc_ecma_utils" -version = "0.127.20" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d40abfc4f3a7bfdf54d11ac705cc9dd0836c48bf085b359143b4d40b50cb31" +checksum = "90b316ef306ff4b81505c697d112be0173a412c382acc7c572c98600c26ee80d" dependencies = [ "indexmap", "num_cpus", "once_cell", "rustc-hash", + "ryu-js", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", "swc_ecma_visit", "tracing", @@ -1661,15 +1817,16 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.98.7" +version = "0.105.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93692bdcdbb63db8f5e10fea5d202b5487cb27eb443aec424f4335c88f9864af" +checksum = "bc4e8093063408a54afdee982ce1a47180de9047875adcbcfb7c0be2d827ac26" dependencies = [ + "new_debug_unreachable", "num-bigint", "swc_atoms 0.6.7", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", - "swc_visit", + "swc_visit 0.6.2", "tracing", ] @@ -1691,7 +1848,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19c5d3bfe85c5f3e50f5a604398ca6b0830a45344b602a53b153b46fe56d3f02" dependencies = [ "anyhow", - "miette", + "miette 4.7.1", "once_cell", "parking_lot", "swc_common 0.31.22", @@ -1699,15 +1856,15 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "0.17.19" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3329e73f159a3d38d4cd5f606a0918eeff39f5bbdbdafd9b6fecb290d2e9a32d" +checksum = "2a961c23b25962fa92d476316b1c39b1bdfedd0446588c0bbc7255166e3b4c52" dependencies = [ "anyhow", - "miette", + "miette 7.2.0", "once_cell", "parking_lot", - "swc_common 0.33.25", + "swc_common 0.38.0", ] [[package]] @@ -1730,9 +1887,9 @@ dependencies = [ [[package]] name = "swc_macros_common" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5be7766a95a2840ded618baeaab63809b71230ef19094b34f76c8af4d85aa2" +checksum = "f486687bfb7b5c560868f69ed2d458b880cebc9babebcb67e49f31b55c5bf847" dependencies = [ "proc-macro2", "quote", @@ -1761,13 +1918,13 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "0.41.7" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e09ebf5da9eb13f431ebfb916cd3378a87ffae927ba896261ebc9dc094457ae" +checksum = "d9108a667cb1f43c0615e1b2b9aaf1ce31794aac418f16e4ebc0b2ee43cc9d1c" dependencies = [ "better_scoped_tls", "rkyv", - "swc_common 0.33.25", + "swc_common 0.38.0", "swc_ecma_ast", "swc_trace_macro", "tracing", @@ -1794,6 +1951,16 @@ dependencies = [ "swc_visit_macros", ] +[[package]] +name = "swc_visit" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ceb044142ba2719ef9eb3b6b454fce61ab849eb696c34d190f04651955c613d" +dependencies = [ + "either", + "new_debug_unreachable", +] + [[package]] name = "swc_visit_macros" version = "0.5.11" @@ -1888,20 +2055,20 @@ dependencies = [ [[package]] name = "testing" -version = "0.35.23" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "689e2661712768726869f62945ccbe5d76ab3a3957b88221275bebe22a0761c8" +checksum = "97d2604f8ab1afd3de49f1a1994b6b77c6a5881e6334d8f6d08bd1151a0d9860" dependencies = [ "ansi_term", - "cargo_metadata 0.15.4", + "cargo_metadata 0.18.1", "difference", "once_cell", "pretty_assertions", "regex", "serde", "serde_json", - "swc_common 0.33.25", - "swc_error_reporters 0.17.19", + "swc_common 0.38.0", + "swc_error_reporters 0.22.0", "testing_macros", "tracing", "tracing-subscriber", @@ -1934,6 +2101,17 @@ 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.59" @@ -2042,9 +2220,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" dependencies = [ "serde", "stable_deref_trait", @@ -2076,9 +2254,9 @@ checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" [[package]] name = "unicode-id-start" -version = "1.1.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8f73150333cb58412db36f2aca8f2875b013049705cc77b94ded70a1ab1f5da" +checksum = "97e2a3c5fc9de285c0e805d98eba666adb4b2d9e1049ce44821ff7707cc34e91" [[package]] name = "unicode-ident" @@ -2132,14 +2310,27 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vergen" -version = "8.3.1" +version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +checksum = "349ed9e45296a581f455bc18039878f409992999bc1d5da12a6800eb18c8752f" dependencies = [ "anyhow", "cargo_metadata 0.18.1", + "derive_builder", "regex", "rustversion", + "vergen-lib", +] + +[[package]] +name = "vergen-lib" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229eaddb0050920816cf051e619affaf18caa3dd512de8de5839ccbc8e53abb0" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fb76492..51397fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,9 @@ [workspace] +resolver = "2" +members = ["crates/common", "crates/debug_label", "crates/react_refresh"] -members = [ - "crates/common", - "crates/debug_label", - "crates/react_refresh", -] +[workspace.dependencies] +swc_core = "0.104.2" [profile.release] # This removes more dead code @@ -13,4 +12,4 @@ lto = true # Optimize for size opt-level = "s" # Strip debug symbols -strip = "symbols" \ No newline at end of file +strip = "symbols" diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 9dd3927..700df2f 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -9,4 +9,4 @@ edition = "2021" [dependencies] serde = "1.0.160" serde_json = "1.0.96" -swc_core = { version = "0.90.37", features = ["common", "ecma_ast"] } +swc_core = { workspace = true, features = ["common", "ecma_ast"] } diff --git a/crates/common/src/atom_import_map.rs b/crates/common/src/atom_import_map.rs index cd49ca3..60d8ad3 100644 --- a/crates/common/src/atom_import_map.rs +++ b/crates/common/src/atom_import_map.rs @@ -75,7 +75,7 @@ impl AtomImportMap { .. }) => { if let Expr::Ident(obj) = &**obj { - if let Some(..) = self.namespace_imports.get(&obj.sym) { + if self.namespace_imports.get(&obj.sym).is_some() { return ATOM_IMPORTS.contains(&&*prop.sym); } } diff --git a/crates/debug_label/Cargo.toml b/crates/debug_label/Cargo.toml index d9a37db..3f72ca3 100644 --- a/crates/debug_label/Cargo.toml +++ b/crates/debug_label/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] common = { path = "../common" } -swc_core = { version = "0.90.37", features = [ +swc_core = { workspace = true, features = [ "ecma_ast", "ecma_parser", "ecma_utils", @@ -20,7 +20,7 @@ swc_core = { version = "0.90.37", features = [ ] } [dev-dependencies] -swc_core = { version = "0.90.37", features = [ +swc_core = { workspace = true, features = [ "ecma_plugin_transform", "ecma_transforms_react", "testing_transform", diff --git a/crates/debug_label/src/lib.rs b/crates/debug_label/src/lib.rs index 45286ca..8c6348e 100644 --- a/crates/debug_label/src/lib.rs +++ b/crates/debug_label/src/lib.rs @@ -2,8 +2,7 @@ use common::{parse_plugin_config, AtomImportMap, Config}; use swc_core::{ - common::DUMMY_SP, - common::{util::take::Take, FileName}, + common::{util::take::Take, FileName, SyntaxContext, DUMMY_SP}, ecma::{ ast::*, atoms::JsWord, @@ -27,16 +26,8 @@ fn create_debug_label_assign_expr(atom_name_id: Id) -> Expr { let atom_name = atom_name_id.0.clone(); Expr::Assign(AssignExpr { left: AssignTarget::Simple(SimpleAssignTarget::Member(MemberExpr { - obj: Box::new(Expr::Ident(Ident { - sym: atom_name_id.0, - span: DUMMY_SP.with_ctxt(atom_name_id.1), - optional: false, - })), - prop: MemberProp::Ident(Ident { - sym: "debugLabel".into(), - span: DUMMY_SP, - optional: false, - }), + obj: Box::new(Expr::Ident(atom_name_id.into())), + prop: MemberProp::Ident("debugLabel".into()), span: DUMMY_SP, })), right: Box::new(Expr::Lit(Lit::Str(Str { @@ -72,7 +63,7 @@ impl DebugLabelTransformVisitor { let stmt = match stmt.try_into_stmt() { Ok(mut stmt) => { stmt.visit_mut_with(self); - ::from_stmt(stmt) + T::from(stmt) } Err(node) => match node.try_into_module_decl() { Ok(mut module_decl) => { @@ -109,40 +100,33 @@ impl DebugLabelTransformVisitor { }; // Variable declaration - stmts_updated.push(::from_stmt(Stmt::Decl( - Decl::Var(Box::new(VarDecl { + stmts_updated.push(T::from(Stmt::Decl(Decl::Var(Box::new( + VarDecl { declare: Default::default(), decls: vec![VarDeclarator { definite: false, init: Some(default_export.expr), - name: Pat::Ident( - Ident::new(atom_name.clone(), DUMMY_SP).into(), - ), + name: Pat::Ident(atom_name.clone().into()), span: DUMMY_SP, }], kind: VarDeclKind::Const, span: DUMMY_SP, - })), - ))); - // Assign debug label - stmts_updated.push(::from_stmt(Stmt::Expr( - ExprStmt { - span: DUMMY_SP, - expr: Box::new(create_debug_label_assign_expr(( - atom_name.clone(), - Default::default(), - ))), + ctxt: SyntaxContext::empty(), }, - ))); + ))))); + // Assign debug label + stmts_updated.push(T::from(Stmt::Expr(ExprStmt { + span: DUMMY_SP, + expr: Box::new(create_debug_label_assign_expr(( + atom_name.clone(), + SyntaxContext::empty(), + ))), + }))); // export default expression stmts_updated.push( ::try_from_module_decl( ModuleDecl::ExportDefaultExpr(ExportDefaultExpr { - expr: Box::new(Expr::Ident(Ident { - sym: atom_name.clone(), - span: DUMMY_SP, - optional: false, - })), + expr: Box::new(Expr::Ident(atom_name.into())), span: DUMMY_SP, }), ) @@ -165,7 +149,7 @@ impl DebugLabelTransformVisitor { continue; } - stmts_updated.push(::from_stmt(Stmt::Expr(ExprStmt { + stmts_updated.push(T::from(Stmt::Expr(ExprStmt { span: DUMMY_SP, expr: Box::new(self.debug_label_expr.take().unwrap()), }))) @@ -185,12 +169,8 @@ impl VisitMut for DebugLabelTransformVisitor { fn visit_mut_var_declarator(&mut self, var_declarator: &mut VarDeclarator) { let old_var_declarator = self.current_var_declarator.take(); - self.current_var_declarator = if let Pat::Ident(BindingIdent { - id: Ident { span, sym, .. }, - .. - }) = &var_declarator.name - { - Some((sym.clone(), span.ctxt)) + self.current_var_declarator = if let Pat::Ident(id) = &var_declarator.name { + Some(id.to_id()) } else { None }; diff --git a/crates/debug_label/tests/fixture.rs b/crates/debug_label/tests/fixture.rs index 534be06..76d92f5 100644 --- a/crates/debug_label/tests/fixture.rs +++ b/crates/debug_label/tests/fixture.rs @@ -3,7 +3,7 @@ use std::{fs::read_to_string, path::PathBuf}; use common::parse_plugin_config; use swc_core::{ common::{chain, FileName, Mark}, - ecma::parser::{EsConfig, Syntax}, + ecma::parser::{EsSyntax, Syntax}, ecma::transforms::{ base::resolver, react::{react, Options, RefreshOptions}, @@ -21,7 +21,7 @@ fn test(input: PathBuf) { let output = input.with_file_name("output.js"); test_fixture( - Syntax::Es(EsConfig { + Syntax::Es(EsSyntax { jsx: true, ..Default::default() }), diff --git a/crates/react_refresh/Cargo.toml b/crates/react_refresh/Cargo.toml index 90cbfda..c960634 100644 --- a/crates/react_refresh/Cargo.toml +++ b/crates/react_refresh/Cargo.toml @@ -8,7 +8,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] common = { path = "../common" } -swc_core = { version = "0.90.37", features = [ +swc_core = { workspace = true, features = [ "ecma_ast", "ecma_quote", "ecma_parser", @@ -18,7 +18,7 @@ swc_core = { version = "0.90.37", features = [ ] } [dev-dependencies] -swc_core = { version = "0.90.37", features = [ +swc_core = { workspace = true, features = [ "ecma_plugin_transform", "ecma_transforms_react", "testing_transform", diff --git a/crates/react_refresh/src/lib.rs b/crates/react_refresh/src/lib.rs index dd09c7d..f44e080 100644 --- a/crates/react_refresh/src/lib.rs +++ b/crates/react_refresh/src/lib.rs @@ -2,8 +2,7 @@ use common::{parse_plugin_config, AtomImportMap, Config}; use swc_core::{ - common::FileName, - common::DUMMY_SP, + common::{FileName, SyntaxContext, DUMMY_SP}, ecma::{ ast::*, visit::{as_folder, noop_visit_mut_type, Fold, FoldWith, VisitMut, VisitMutWith}, @@ -35,14 +34,15 @@ pub struct ReactRefreshTransformVisitor { fn create_react_refresh_call_expr_(key: String, atom_expr: &CallExpr) -> CallExpr { CallExpr { span: DUMMY_SP, + ctxt: SyntaxContext::empty(), callee: Callee::Expr(Box::new(Expr::Member(MemberExpr { span: DUMMY_SP, obj: Box::new(Expr::Member(MemberExpr { span: DUMMY_SP, - obj: Box::new(Expr::Ident(Ident::new("globalThis".into(), DUMMY_SP))), - prop: MemberProp::Ident(Ident::new("jotaiAtomCache".into(), DUMMY_SP)), + obj: Box::new(Expr::Ident("globalThis".into())), + prop: MemberProp::Ident("jotaiAtomCache".into()), })), - prop: MemberProp::Ident(Ident::new("get".into(), DUMMY_SP)), + prop: MemberProp::Ident("get".into()), }))), args: vec![ ExprOrSpread { diff --git a/crates/react_refresh/tests/fixture.rs b/crates/react_refresh/tests/fixture.rs index 8fe4bea..027a34f 100644 --- a/crates/react_refresh/tests/fixture.rs +++ b/crates/react_refresh/tests/fixture.rs @@ -3,7 +3,7 @@ use std::{fs::read_to_string, path::PathBuf}; use common::parse_plugin_config; use swc_core::{ common::{chain, FileName, Mark}, - ecma::parser::{EsConfig, Syntax}, + ecma::parser::{EsSyntax, Syntax}, ecma::transforms::{ base::resolver, react::{react, Options, RefreshOptions}, @@ -21,7 +21,7 @@ fn test(input: PathBuf) { let output = input.with_file_name("output.js"); test_fixture( - Syntax::Es(EsConfig { + Syntax::Es(EsSyntax { jsx: true, ..Default::default() }),