diff --git a/.changeset/stupid-ravens-brush.md b/.changeset/stupid-ravens-brush.md new file mode 100644 index 00000000000..9124e4a33b4 --- /dev/null +++ b/.changeset/stupid-ravens-brush.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_plugin_runner: patch +--- + +feat(plugin/runner): Improve error message diff --git a/Cargo.lock b/Cargo.lock index 83852def12a..26c28c716dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,9 +55,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -216,7 +216,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -227,7 +227,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -258,7 +258,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -403,7 +403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.7", "serde", ] @@ -464,18 +464,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -488,7 +488,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -621,7 +621,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -1000,7 +1000,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -1015,12 +1015,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -1039,15 +1039,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "syn 2.0.55", + "strsim 0.11.1", + "syn 2.0.76", ] [[package]] @@ -1063,13 +1064,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.3", + "darling_core 0.20.10", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -1157,7 +1158,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -1166,7 +1167,16 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" dependencies = [ - "derive_builder_macro", + "derive_builder_macro 0.12.0", +] + +[[package]] +name = "derive_builder" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" +dependencies = [ + "derive_builder_macro 0.20.0", ] [[package]] @@ -1181,16 +1191,38 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder_core" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" +dependencies = [ + "darling 0.20.10", + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "derive_builder_macro" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ - "derive_builder_core", + "derive_builder_core 0.12.0", "syn 1.0.109", ] +[[package]] +name = "derive_builder_macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" +dependencies = [ + "derive_builder_core 0.20.0", + "syn 2.0.76", +] + [[package]] name = "dialoguer" version = "0.10.4" @@ -1314,10 +1346,10 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling 0.20.3", + "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -1412,7 +1444,7 @@ version = "0.1.9" dependencies = [ "proc-macro2", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -1483,7 +1515,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -1534,7 +1566,7 @@ dependencies = [ "clap 4.5.9", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", "walkdir", ] @@ -1561,6 +1593,18 @@ dependencies = [ "wasm-bindgen", ] +[[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.26.2" @@ -1593,8 +1637,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -1882,7 +1926,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.7", "same-file", "walkdir", "winapi-util", @@ -1937,7 +1981,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -2110,9 +2154,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -2227,9 +2271,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -2280,7 +2324,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -2357,7 +2401,7 @@ dependencies = [ "napi-derive-backend", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -2371,8 +2415,8 @@ dependencies = [ "proc-macro2", "quote", "regex", - "semver 1.0.21", - "syn 2.0.55", + "semver 1.0.23", + "syn 2.0.76", ] [[package]] @@ -2544,6 +2588,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "object" version = "0.36.1" @@ -2588,7 +2641,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -2738,7 +2791,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -2767,7 +2820,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -2865,7 +2918,7 @@ dependencies = [ "dashmap", "from_variant", "once_cell", - "semver 1.0.21", + "semver 1.0.23", "serde", "st-map", "tracing", @@ -2917,9 +2970,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -2966,9 +3019,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3058,14 +3111,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -3079,13 +3132,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] @@ -3096,9 +3149,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "region" @@ -3230,7 +3283,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.21", + "semver 1.0.23", ] [[package]] @@ -3271,9 +3324,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rusty_pool" @@ -3340,7 +3393,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -3401,9 +3454,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -3416,9 +3469,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -3446,13 +3499,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -3463,16 +3516,17 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -3713,7 +3767,7 @@ checksum = "9cf483ea7e0e3a03d1b91687895814425149ad77facd3e2b6839dde26da98454" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -3730,7 +3784,7 @@ dependencies = [ "quote", "serde", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -4005,7 +4059,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -4115,7 +4169,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -4302,7 +4356,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -4634,7 +4688,7 @@ dependencies = [ "preset_env_base", "pretty_assertions", "rustc-hash", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_json", "st-map", @@ -4673,7 +4727,7 @@ dependencies = [ "swc_ecma_ast", "swc_ecma_parser", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -4798,7 +4852,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5032,7 +5086,7 @@ version = "0.1.4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5172,7 +5226,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5251,7 +5305,7 @@ version = "0.3.13" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5325,7 +5379,7 @@ version = "0.9.16" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5366,6 +5420,7 @@ dependencies = [ "testing", "tokio", "tracing", + "vergen", "virtual-fs 0.11.4", "wasmer", "wasmer-cache", @@ -5391,7 +5446,7 @@ version = "0.1.3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5474,7 +5529,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5514,9 +5569,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -5660,7 +5715,7 @@ dependencies = [ "quote", "regex", "relative-path", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5677,22 +5732,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5733,7 +5788,9 @@ checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "libc", "num-conv", + "num_threads", "powerfmt", "serde", "time-core", @@ -5815,7 +5872,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -5939,7 +5996,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] @@ -6156,21 +6213,37 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "8.3.1" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +checksum = "c32e7318e93a9ac53693b6caccfb05ff22e04a44c7cf8a279051f24c09da286f" dependencies = [ "anyhow", "cargo_metadata", + "derive_builder 0.20.0", + "getset", "regex", "rustversion", + "time", + "vergen-lib", +] + +[[package]] +name = "vergen-lib" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e06bee42361e43b60f363bad49d63798d0f42fb1768091812270eca00c784720" +dependencies = [ + "anyhow", + "derive_builder 0.20.0", + "getset", + "rustversion", ] [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "virtual-fs" @@ -6391,7 +6464,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -6425,7 +6498,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6543,11 +6616,11 @@ checksum = "54a0f70c177b1c5062cfe0f5308c3317751796fef9403c22a0cd7b4cacd4ccd8" dependencies = [ "anyhow", "bytesize", - "derive_builder", + "derive_builder 0.12.0", "hex", "indexmap 2.2.6", "schemars", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_cbor", "serde_json", @@ -6565,11 +6638,11 @@ checksum = "d35974065bb02340d7b448f8a4c5a3156b524e3a6b29d59201b940cf4c2c384f" dependencies = [ "anyhow", "bytesize", - "derive_builder", + "derive_builder 0.12.0", "hex", "indexmap 2.2.6", "schemars", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_cbor", "serde_json", @@ -6703,7 +6776,7 @@ dependencies = [ "rand", "rkyv", "rusty_pool", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_cbor", "serde_derive", @@ -6770,7 +6843,7 @@ checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ "bitflags 2.5.0", "indexmap 2.2.6", - "semver 1.0.21", + "semver 1.0.23", ] [[package]] @@ -6824,7 +6897,7 @@ dependencies = [ "once_cell", "path-clean 1.0.1", "rand", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_cbor", "serde_json", @@ -7115,7 +7188,7 @@ dependencies = [ "cargo_metadata", "chrono", "clap 4.5.9", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_derive", "serde_json", @@ -7152,7 +7225,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.76", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 715fdb5040d..13303411fe7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -141,7 +141,7 @@ resolver = "2" unicode-id-start = "1.2.0" unicode-width = "0.1.4" url = "2.4.0" - vergen = { version = "8.0.0", default-features = false } + vergen = { version = "9.0.0", default-features = false } virtual-fs = { version = "=0.11.4", default-features = false } walkdir = "2.4.0" wasm-bindgen = "0.2.91" diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index d703e79a62b..ae240f0a6ea 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -277,9 +277,9 @@ dependencies = [ [[package]] name = "binding_macros" -version = "0.76.0" +version = "0.77.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f3a18f6c7f3990bc3b205ab46aa9d41ca30cab2a1a887025e78ef895b4b39fb" +checksum = "56398f78553adfb2efd3cedf9a19d379afccab2790a88fedf7fee7608d683e12" dependencies = [ "anyhow", "console_error_panic_hook", @@ -831,7 +831,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa", - "phf 0.10.1", + "phf 0.11.2", "smallvec", ] @@ -2322,9 +2322,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" dependencies = [ - "phf_macros 0.10.0", "phf_shared 0.10.0", - "proc-macro-hack", ] [[package]] @@ -2333,7 +2331,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_macros 0.11.2", + "phf_macros", "phf_shared 0.11.2", ] @@ -2367,20 +2365,6 @@ dependencies = [ "rand", ] -[[package]] -name = "phf_macros" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" -dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "phf_macros" version = "0.11.2" @@ -2517,12 +2501,6 @@ dependencies = [ "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.86" @@ -3281,9 +3259,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "swc" -version = "0.284.1" +version = "0.285.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833bb7f4073f08aec7144619a2cf682413b7a0cc8f21b7e76abd2fd02373685d" +checksum = "38ccac8796c84e723cc9e949dfa7126e1f1b06b36127b1e21ec5f8fc21bbbbc1" dependencies = [ "anyhow", "base64", @@ -3363,9 +3341,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.236.0" +version = "0.237.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf56bdfc5af60d362bfe63c002af34b9ffba711dd1630fc9d58c3b0a2f5ce54b" +checksum = "c77c112c218a09635d99a45802a81b4f341d6c28c81076aa2c29ba3bcd9151a9" dependencies = [ "anyhow", "crc", @@ -3417,9 +3395,9 @@ dependencies = [ [[package]] name = "swc_cli_impl" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba0d371944f2e45c2f58896406b44d6b2cd11d5c412df616a6958b7d91cf6cf7" +checksum = "e23d4691d032c2fa717f8efe18abb9faca2f55fba2d059f0b4263e15341e2821" dependencies = [ "anyhow", "clap", @@ -3472,9 +3450,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9859d605bfa3ba8323f37bc4f51839c0e21ea59b657f65865388b0adfeb0a413" +checksum = "feb87f8dc7be1a034d5c29bcc4be9d504ddfd2f8aa1a1338fc568e104e087d29" dependencies = [ "anyhow", "base64", @@ -3527,9 +3505,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.101.6" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "860c5d6e5014b47df5d7a15fb364c32ecfed29f13c1159bce2724d274feb586d" +checksum = "556864a8b67ce72cb8c22d32c703b7e563552a5d0f707939793b8b9ad411a330" dependencies = [ "binding_macros", "swc", @@ -3671,9 +3649,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.155.0" +version = "0.155.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644514f303dcad13f7d1c244b50af798e0549f6eb8c53d64dd2ba9824266c868" +checksum = "cc7641608ef117cfbef9581a99d02059b522fcca75e5244fa0cbbd8606689c6f" dependencies = [ "memchr", "num-bigint", @@ -3702,9 +3680,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f9cac39f19d6509db921f4b75934aaa64fc84b599416e5c1fcaed1c313132f" +checksum = "75429b44cc479cbe018d5994eddae5ac7ab887ebefeb3596720921bc4cdff551" dependencies = [ "swc_atoms", "swc_common", @@ -3732,13 +3710,14 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dade6e0c6e8ddb61281fee2331c3775a920c31535b91e8cace2e0c4eed6158d3" +checksum = "c988d9018d6abb22b0fcc2da6a624be2db7c56681b6180d1cb5faa2672fd8001" dependencies = [ "arrayvec", "indexmap 2.4.0", "is-macro", + "rustc-hash", "serde", "serde_derive", "smallvec", @@ -3758,9 +3737,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209e347cdc3fb56632a1d882f981f3448f5f529c16d8da9d770207fffda4a8f6" +checksum = "1b7a3e086151c70ff940531ddcd04c01351ae80aa4593fd2906255d18a836b4f" dependencies = [ "swc_atoms", "swc_common", @@ -3775,9 +3754,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aa87a6861b2adc8b0178fb450165101c4396409481c8726ec90ad28398cae5d" +checksum = "b3b74c89c9bd4fa532fba3d1ec47b129ec450b4143d3914118cd61b0e44d4a4b" dependencies = [ "serde", "swc_atoms", @@ -3793,9 +3772,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f577f098e7c3738ade709caadb17c9f3bd911ea2ee6cfacca561d12addcc5761" +checksum = "a40bf74a06c433eee502ea6347596d5766d77da8baf32653d14a6655df4e181a" dependencies = [ "serde", "swc_atoms", @@ -3812,9 +3791,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d52253dc2f83a3fca526c387c33e4ff9a8423b68c271414c9f870e1ced3231" +checksum = "10afb20890ffda37eefdfe06c3bb0d12e5ec8698667cb9e3689b74066b398845" dependencies = [ "swc_atoms", "swc_common", @@ -3828,9 +3807,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed343932876fad34b1d4a13e30c55b94531e89916f45e7c04203bc49a29565b9" +checksum = "0608c4814a362d5362bc536507d8c89b287521778e8b678fe4590bfa1843803a" dependencies = [ "serde", "swc_atoms", @@ -3846,9 +3825,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6b28a2c109466eaa809d9b9a5b81dcbb4e269ba293a9c5c34aabc67b6427bc" +checksum = "6f12ffb0f4282f4b333efa98c9653d181d89e1b5339d4be0d789189a246ef34b" dependencies = [ "swc_atoms", "swc_common", @@ -3862,9 +3841,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3a644e271ea2a9df88e3e456c5c204c4916ef5136b7d946f9cd25607f47ec6" +checksum = "bc16be9dd64e1b32569375b0b73ecc7dc74f9d848e8caaf2007896e2cf8d68a7" dependencies = [ "swc_atoms", "swc_common", @@ -3881,9 +3860,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55ffadc12067b21524bf7b5d6938021ee918f65f18937ed27245c23544bc910" +checksum = "e684ae87d26ad3012e588d0e268158cadee10ddc0cda261069f0f280a8b23ce7" dependencies = [ "swc_common", "swc_ecma_ast", @@ -3910,9 +3889,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.99.0" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c11bcc9e3dc49929500c07c8b0c84a88064847d31e9ee16204b257e6bd315c" +checksum = "89907376ce67b56d8fbf79cca830a12cb41f93dccc306008c07d8eba8f6d388e" dependencies = [ "auto_impl", "dashmap", @@ -3952,9 +3931,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.203.2" +version = "0.204.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9bc16bd0a3c295588939fe8d02f795d3463a2e1613600f9c860c7a9aadebe7c" +checksum = "34d88917a66b8f457c5953d2ff2d7788259658c89578636b28e9ac6ae56bbfd9" dependencies = [ "arrayvec", "indexmap 2.4.0", @@ -4010,9 +3989,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.216.0" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c01c4097d54b6992d926474546472f10f1f94799a6eb9b70176fc33e778573" +checksum = "e51992e6bb854ef2e6c7a1b9a14ed8d0e3c8f905d348f694759f9a97bfa6a425" dependencies = [ "anyhow", "dashmap", @@ -4035,9 +4014,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.238.0" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6a33679b1611630ee41f8ee8b41b9587de4171819698d313f7f8ae2c699f41a" +checksum = "82df2dd8048fe23f1df72acd52bfebf846b3d5a76e048eee32acf9af9bee6a98" dependencies = [ "swc_atoms", "swc_common", @@ -4055,9 +4034,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.144.0" +version = "0.145.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0a71579d030e12fd3cfbfc8712c4ce21afc526f2a759903c77d8df61950f5e" +checksum = "65f21494e75d0bd8ef42010b47cabab9caaed8f2207570e809f6f4eb51a710d1" dependencies = [ "better_scoped_tls", "bitflags 2.6.0", @@ -4079,9 +4058,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.133.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f37ec04525798a09ce02e52dc15433acee2d86664da0b8ede55bb5cefd95384" +checksum = "3c3d884594385bea9405a2e1721151470d9a14d3ceec5dd773c0ca6894791601" dependencies = [ "swc_atoms", "swc_common", @@ -4093,9 +4072,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.170.0" +version = "0.171.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb500b65423646da940e289ad37e7c88332d7194248c33fc63a9e768e104fe5" +checksum = "8f23da29c1279b6e0c1ac0df9d0f7fd6c955a141a9770e5a0a2d54292509bcf6" dependencies = [ "arrayvec", "indexmap 2.4.0", @@ -4142,9 +4121,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.189.0" +version = "0.190.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5bddea322502ce309f77b76dcd7994ff700fbba7caf9d12eb6fb7ef98ecd1b" +checksum = "5c4d0255362149854b923125e9910ce0a5405ce6d03fb325c5fdd8e9f13a0845" dependencies = [ "Inflector", "anyhow", @@ -4169,9 +4148,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.207.1" +version = "0.208.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc9b6dcb79ac6f396988c13ce2f782116aeb92e8ee77656072d1146697f66022" +checksum = "98d8447ea20ef76958a8240feef95743702485a84331e6df5bdbe7e383c87838" dependencies = [ "dashmap", "indexmap 2.4.0", @@ -4194,9 +4173,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.178.1" +version = "0.179.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b252ea08cfd11e434f4c625ec95493e06c8b000b50eb8e908d76f3325dd5dfa8" +checksum = "79938ff510fc647febd8c6c3ef4143d099fdad87a223680e632623d056dae2dd" dependencies = [ "either", "rustc-hash", @@ -4214,9 +4193,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.190.0" +version = "0.191.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e54a8c87d90812bf69b0f07931bb629111a3f24efe83b9190c3a40a5ebc25e" +checksum = "76c76d8b9792ce51401d38da0fa62158d61f6d80d16d68fe5b03ce4bf5fba383" dependencies = [ "base64", "dashmap", @@ -4240,9 +4219,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.197.3" +version = "0.198.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668e3ad397312253784cb1754b43516e68ab5dfb06a9c2827951b72b9a07f0e0" +checksum = "94b9c58783c96c4f3b115d2d12720de26698e7863bcc8ea5369f3493a8a95568" dependencies = [ "ryu-js", "serde", @@ -4274,9 +4253,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.134.1" +version = "0.134.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde8f1ef3f7bd53340c7bd679f1ec563a45225ac8fb63f22d6de1ff4b345475d" +checksum = "029eec7dd485923a75b5a45befd04510288870250270292fc2c1b3a9e7547408" dependencies = [ "indexmap 2.4.0", "num_cpus", @@ -4346,9 +4325,9 @@ dependencies = [ [[package]] name = "swc_fast_ts_strip" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1011ac056bae7c822a518ad32a90077ccb1f534cd29c983f8f688d0bf33c98e4" +checksum = "ad2f63a77a013fca54af8b3adf32e979815c1b850e190fc41dc5737d766090ce" dependencies = [ "anyhow", "serde", @@ -4378,9 +4357,9 @@ dependencies = [ [[package]] name = "swc_html" -version = "0.148.0" +version = "0.149.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "706509020207c5e4dc17e9c6c3adcec901ec5e0d06314050643c3efce8be7fb7" +checksum = "ddae7ea207c1529def7508d07f78fa2bc9b1f592d118a4cf4c857d408fe506db" dependencies = [ "swc_html_ast", "swc_html_codegen", @@ -4431,9 +4410,9 @@ dependencies = [ [[package]] name = "swc_html_minifier" -version = "0.145.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f944d0cf2352767ddee5f65a02c73dadcd2050a75eab8bee45a30f80b318199f" +checksum = "4292d13b76ea4c1ec4b96ee7dfa078bc9b1b7bc474594fa6289bf30ca3109d0d" dependencies = [ "once_cell", "serde", @@ -4519,9 +4498,9 @@ dependencies = [ [[package]] name = "swc_node_bundler" -version = "0.74.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50eb59d19ee732f43205ca3dbe5cb888a3082b5878c612210433d56b91cd4e2" +checksum = "972e413b33d296f7c43f039cb59178ba705e2459803bb8f36aa481163ace8bc0" dependencies = [ "anyhow", "dashmap", diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index 0ce3ca3730e..083f0620e68 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -26,20 +26,20 @@ resolver = "2" sourcemap = "8.0.1" swc_atoms = "0.6.7" swc_cached = "0.3.20" - swc_cli_impl = "0.19.0" + swc_cli_impl = "0.20.0" swc_common = "0.37.5" - swc_compiler_base = "0.18.1" + swc_compiler_base = "0.19.0" swc_config = "0.1.15" - swc_core = "0.101.6" + swc_core = "0.102.0" swc_css_ast = "0.144.0" swc_css_codegen = "0.155.0" swc_css_minifier = "0.120.0" swc_css_parser = "0.154.0" swc_error_reporters = "0.21.0" - swc_fast_ts_strip = "0.6.1" - swc_html = "0.148.0" + swc_fast_ts_strip = "0.7.0" + swc_html = "0.149.0" swc_html_ast = "0.37.0" - swc_html_minifier = "0.145.0" + swc_html_minifier = "0.146.0" swc_malloc = "0.5.11" swc_nodejs_common = "0.0.8" tracing = "0.1.40" diff --git a/crates/swc_core/build.rs b/crates/swc_core/build.rs index 67e46d8b16c..c10155fa5d5 100644 --- a/crates/swc_core/build.rs +++ b/crates/swc_core/build.rs @@ -5,7 +5,7 @@ use std::{ path::Path, }; -use vergen::EmitBuilder; +use vergen::{CargoBuilder, Emitter}; // Validate conflict between host / plugin features #[cfg(all( @@ -22,6 +22,8 @@ compile_error!( ); fn main() { + let cargo = CargoBuilder::all_cargo().unwrap(); + // Creates a static compile time constants for the version of swc_core. let pkg_version = env::var("CARGO_PKG_VERSION").unwrap(); let out_dir = env::var("OUT_DIR").expect("Outdir should exist"); @@ -33,5 +35,10 @@ fn main() { // Attempt to collect some build time env values but will skip if there are any // errors. - let _ = EmitBuilder::builder().all_cargo().emit(); + + Emitter::default() + .add_instructions(&cargo) + .unwrap() + .emit() + .unwrap(); } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 15ff1f2877b..95263d6f93d 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -45,6 +45,10 @@ css = ["swc_css_ast/rkyv-impl"] __rkyv = [] rkyv-impl = ["__rkyv", "swc_common/plugin-rt", "swc_plugin_proxy/plugin-rt"] +[build-dependencies] +vergen = { workspace = true, features = ["build", "cargo"] } + + [dependencies] anyhow = { workspace = true } enumset = { workspace = true } diff --git a/crates/swc_plugin_runner/build.rs b/crates/swc_plugin_runner/build.rs new file mode 100644 index 00000000000..bb189fc6fb9 --- /dev/null +++ b/crates/swc_plugin_runner/build.rs @@ -0,0 +1,18 @@ +use std::error::Error; + +use vergen::{BuildBuilder, CargoBuilder, Emitter}; + +fn main() -> Result<(), Box> { + let build = BuildBuilder::all_build()?; + let cargo = CargoBuilder::default() + .dependencies(true) + .name_filter("*_ast") + .build()?; + + Emitter::default() + .add_instructions(&build)? + .add_instructions(&cargo)? + .emit()?; + + Ok(()) +} diff --git a/crates/swc_plugin_runner/src/transform_executor.rs b/crates/swc_plugin_runner/src/transform_executor.rs index e09d3af60e8..c0c918ce895 100644 --- a/crates/swc_plugin_runner/src/transform_executor.rs +++ b/crates/swc_plugin_runner/src/transform_executor.rs @@ -391,12 +391,34 @@ impl TransformExecutor { transform_state.is_transform_schema_compatible()?; transform_state .run(program, self.unresolved_mark, should_enable_comments_proxy) - .context( - "failed to run Wasm plugin transform. Please ensure the version of `swc_core` \ - used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-core for compatibility information. If you are an author of the plugin, please update \ - `swc_core` to the compatible version. + .with_context(|| { + format!( + "failed to run Wasm plugin transform. Please ensure the version of `swc_core` \ + used by the plugin is compatible with the host runtime. See the \ + documentation for compatibility information. If you are an author of the \ + plugin, please update `swc_core` to the compatible version. - Note that if you want to use the os features like filesystem, you need to use `wasi`. Wasm itself does not have concept of filesystem.", - ) + Note that if you want to use the os features like filesystem, you need to use \ + `wasi`. Wasm itself does not have concept of filesystem. + + https://swc.rs/docs/plugin/selecting-swc-core + + See https://plugins.swc.rs/versions/from-plugin-runner/{PKG_VERSION} for the list of the compatible versions. + + Build info: + Date: {BUILD_DATE} + Timestamp: {BUILD_TIMESTAMP} + + Version info: + swc_plugin_runner: {PKG_VERSION} + Dependencies: {PKG_DEPS} + " + ) + }) } } + +const BUILD_DATE: &str = env!("VERGEN_BUILD_DATE"); +const BUILD_TIMESTAMP: &str = env!("VERGEN_BUILD_TIMESTAMP"); +const PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); +const PKG_DEPS: &str = env!("VERGEN_CARGO_DEPENDENCIES");