From 0a0050f8779ec7e9cd648677d2d1dfc3b42e7f95 Mon Sep 17 00:00:00 2001 From: serg-and Date: Tue, 29 Oct 2024 11:04:15 +0100 Subject: [PATCH 01/10] bump swc_core to 0.106.* --- Cargo.lock | 1268 ++++++++++++++++++++++++++++-------------------- Cargo.toml | 2 +- rust-toolchain | 2 +- src/app.rs | 21 +- src/page.rs | 8 +- src/utils.rs | 33 +- 6 files changed, 765 insertions(+), 569 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d8bd2b..1c3bfd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,24 +14,24 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -40,25 +40,31 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "0.7.19" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 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" @@ -70,20 +76,32 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "ast_node" -version = "0.9.6" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e3e06ec6ac7d893a0db7127d91063ad7d9da8988f8a1a256f03729e6eec026" +checksum = "f9184f2b369b3e8625712493c89b785881f27eedc6cde480a81883cef78868b2" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.23", + "syn 2.0.85", +] + +[[package]] +name = "ast_node" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4d23a6d1d5f18bdbc06d9aa908880e5f49205156ba804751af731c51f5cf81a" +dependencies = [ + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.85", ] [[package]] @@ -92,30 +110,30 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] @@ -125,25 +143,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] -name = "better_scoped_tls" -version = "0.1.1" +name = "base64-simd" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794edcc9b3fb07bb4aecaa11f093fd45663b4feadb782d68303a2268bc2701de" +checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" dependencies = [ - "scoped-tls", + "simd-abstraction", ] [[package]] -name = "bitflags" -version = "1.3.2" +name = "better_scoped_tls" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "297b153aa5e573b5863108a6ddc9d5c968bd0b20e75cc614ee9821d2f45679c7" +dependencies = [ + "scoped-tls", +] [[package]] name = "bitflags" -version = "2.3.3" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -166,11 +187,20 @@ 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.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -179,29 +209,41 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" + [[package]] name = "camino" -version = "1.1.4" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -214,7 +256,21 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.17", + "semver 1.0.23", + "serde", + "serde_json", + "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.23", "serde", "serde_json", "thiserror", @@ -222,9 +278,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.73" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -234,9 +293,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -252,20 +311,45 @@ dependencies = [ ] [[package]] -name = "ctor" -version = "0.1.23" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" +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.85", +] + +[[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 1.0.99", + "syn 2.0.85", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "debugid" @@ -277,6 +361,37 @@ dependencies = [ "uuid", ] +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.85", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.85", +] + [[package]] name = "diff" version = "0.1.13" @@ -301,9 +416,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "equivalent" @@ -313,9 +428,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -323,28 +438,45 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" + +[[package]] +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[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", - "syn 2.0.23", + "syn 2.0.85", +] + +[[package]] +name = "from_variant" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d8947525c49c73130b5a7187b55b027b6b78fe60268d9f4c283ed690698cb1" +dependencies = [ + "proc-macro2", + "swc_macros_common", + "syn 2.0.85", ] [[package]] @@ -355,9 +487,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -365,9 +497,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -376,15 +508,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "hashbrown" @@ -392,14 +524,24 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", ] [[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 = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "hermit-abi" @@ -410,6 +552,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hex" version = "0.4.3" @@ -418,22 +566,29 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hstr" -version = "0.2.7" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fafeca18cf0927e23ea44d7a5189c10536279dfe9094e0dfa953053fbb5377" +checksum = "dae404c0c5d4e95d4858876ab02eecd6a196bb8caa42050dfa809938833fc412" dependencies = [ + "hashbrown 0.14.5", "new_debug_unreachable", "once_cell", "phf", "rustc-hash", - "smallvec", + "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.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -447,62 +602,61 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "2.2.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.0", ] [[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.23", + "syn 2.0.85", ] [[package]] name = "is_ci" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.8" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -510,12 +664,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchers" @@ -523,14 +674,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[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 = "miette" @@ -540,14 +691,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", ] @@ -560,23 +725,34 @@ checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "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.85", ] [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "next_superjson" @@ -585,7 +761,7 @@ dependencies = [ "serde", "serde_json", "swc_core", - "testing 0.33.19", + "testing 0.33.25", ] [[package]] @@ -600,11 +776,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", "serde", @@ -612,56 +787,52 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "object" -version = "0.29.0" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] -name = "output_vt100" -version = "0.1.3" +name = "outref" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" -dependencies = [ - "winapi", -] +checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" [[package]] name = "overload" @@ -675,11 +846,17 @@ 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.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -687,22 +864,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", - "windows-sys 0.36.1", + "windows-targets", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" @@ -744,7 +921,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.85", ] [[package]] @@ -767,27 +944,19 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] -name = "pmutil" -version = "0.6.1" +name = "ppv-lite86" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.23", + "zerocopy", ] -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - [[package]] name = "precomputed-hash" version = "0.1.1" @@ -796,30 +965,28 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "pretty_assertions" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ - "ctor", "diff", - "output_vt100", "yansi", ] [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" dependencies = [ "cc", ] @@ -841,14 +1008,14 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -882,40 +1049,32 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "regex" -version = "1.6.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -924,38 +1083,56 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", ] [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relative-path" -version = "1.7.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0df32d82cedd1499386877b062ebe8721f806de80b08d183c70184ef17dd1d42" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "rend" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ "bytecheck", ] [[package]] name = "rkyv" -version = "0.7.42" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", + "bytes", "hashbrown 0.12.3", "ptr_meta", "rend", @@ -967,20 +1144,20 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.41" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1c672430eb41556291981f45ca900a0239ad007242d1cb4b4167af842db666" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -999,28 +1176,34 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.3.3", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "ryu-js" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" [[package]] name = "scoped-tls" @@ -1030,9 +1213,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "seahash" @@ -1051,9 +1234,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -1066,31 +1249,32 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.144" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.144" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1108,30 +1292,45 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[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" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smartstring" @@ -1146,23 +1345,26 @@ dependencies = [ [[package]] name = "smawk" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "sourcemap" -version = "6.4.1" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4cbf65ca7dc576cf50e21f8d0712d96d4fcfd797389744b7b222a85cdf5bd90" +checksum = "dab08a862c70980b8e23698b507e272317ae52a608a164a844111f5372374f1f" dependencies = [ + "base64-simd", + "bitvec", "data-encoding", "debugid", "if_chain", + "rustc-hash", "rustc_version", "serde", "serde_json", - "unicode-id", + "unicode-id-start", "url", ] @@ -1174,15 +1376,15 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" dependencies = [ "cc", "cfg-if", "libc", "psm", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -1219,21 +1421,27 @@ dependencies = [ [[package]] name = "string_enum" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b650ea2087d32854a0f20b837fc56ec987a1cb4f758c9757e1171ee9812da63" +checksum = "05e383308aebc257e7d7920224fa055c632478d92744eca77f99be8fa1545b90" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.23", + "syn 2.0.85", ] +[[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.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4872ced36b91d47bae8a214a683fe54e7078875b399dfa251df346c9b547d1f9" +checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" dependencies = [ "atty", "is_ci", @@ -1257,11 +1465,24 @@ dependencies = [ "atty", ] +[[package]] +name = "swc_allocator" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76aa0eb65c0f39f9b6d82a7e5192c30f7ac9a78f084a21f270de1d8c600ca388" +dependencies = [ + "bumpalo", + "hashbrown 0.14.5", + "ptr_meta", + "rustc-hash", + "triomphe", +] + [[package]] name = "swc_atoms" -version = "0.5.6" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d0307dc4bfd107d49c7528350c372758cfca94fb503629b9a056e6a1572860" +checksum = "9f54563d7dcba626d4acfe14ed12def7ecc28e004debe3ecd2c3ee07cc47e449" dependencies = [ "once_cell", "rustc-hash", @@ -1273,9 +1494,9 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "0.6.5" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d538eaaa6f085161d088a04cf0a3a5a52c5a7f2b3bd9b83f73f058b0ed357c0" +checksum = "b25ff0f3fd48ab1a95d86fd0505fdd1ac904f84d0350dc8222bbc824e9d4fdf6" dependencies = [ "bytecheck", "hstr", @@ -1287,17 +1508,16 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.31.16" +version = "0.31.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6414bd4e553f5638961d39b07075ffd37a3d63176829592f4a5900260d94ca1" +checksum = "88d00f960c667c59c133f30492f4d07f26242fcf988a066d3871e6d3d838d528" dependencies = [ - "ahash 0.8.3", - "ast_node", + "ast_node 0.9.9", "atty", "better_scoped_tls", "cfg-if", "either", - "from_variant", + "from_variant 0.1.9", "new_debug_unreachable", "num-bigint", "once_cell", @@ -1306,9 +1526,9 @@ dependencies = [ "serde", "siphasher", "string_cache", - "swc_atoms 0.5.6", + "swc_atoms 0.5.9", "swc_eq_ignore_macros", - "swc_visit", + "swc_visit 0.5.14", "termcolor", "tracing", "unicode-width", @@ -1317,18 +1537,17 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.33.18" +version = "0.40.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e8b15d0fb87691e27c8f3cf953748db3ccd2a39e165d6d5275a48fb0d29e3" +checksum = "ca32839a37f3b12213b18623b1bd58d37641cab750c50c3c287876cb98b12ab4" dependencies = [ "anyhow", - "ast_node", - "atty", + "ast_node 1.0.0", "better_scoped_tls", "bytecheck", "cfg-if", "either", - "from_variant", + "from_variant 1.0.0", "new_debug_unreachable", "num-bigint", "once_cell", @@ -1338,9 +1557,10 @@ dependencies = [ "serde", "siphasher", "sourcemap", - "swc_atoms 0.6.5", + "swc_allocator", + "swc_atoms 1.0.2", "swc_eq_ignore_macros", - "swc_visit", + "swc_visit 0.6.2", "termcolor", "tracing", "unicode-width", @@ -1349,13 +1569,14 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.90.14" +version = "0.106.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1304ef91579d46206f5244e6286f28a979acf3d9caf98a05d05cc2b0bb94df45" +checksum = "0d4d1040f3e4289cdae3e53965b9100b1af09a0422382e8f5161f7a438705c14" dependencies = [ "once_cell", - "swc_atoms 0.6.5", - "swc_common 0.33.18", + "swc_allocator", + "swc_atoms 1.0.2", + "swc_common 0.40.2", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_transforms_base", @@ -1370,11 +1591,11 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.112.4" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36226eb87bfd2f5620bde04f149a4b869ab34e78496d60cb0d8eb9da765d0732" +checksum = "84d568834a727fc06c608db119dcea52c2d58e9426e92e72f358e2f7dc847063" dependencies = [ - "bitflags 2.3.3", + "bitflags", "bytecheck", "is-macro", "num-bigint", @@ -1382,25 +1603,26 @@ dependencies = [ "rkyv", "scoped-tls", "string_enum", - "swc_atoms 0.6.5", - "swc_common 0.33.18", - "unicode-id", + "swc_atoms 1.0.2", + "swc_common 0.40.2", + "unicode-id-start", ] [[package]] name = "swc_ecma_codegen" -version = "0.148.7" +version = "0.158.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba8669ab28bb5d1e65c1e8690257c026745ac368e0101c2c6544d4a03afc95e" +checksum = "e2549dd7b0f4db0b127fe286958f749b4e2d5467cb6739a78ac887df4f33dcef" dependencies = [ "memchr", "num-bigint", "once_cell", - "rustc-hash", + "regex", "serde", "sourcemap", - "swc_atoms 0.6.5", - "swc_common 0.33.18", + "swc_allocator", + "swc_atoms 1.0.2", + "swc_common 0.40.2", "swc_ecma_ast", "swc_ecma_codegen_macros", "tracing", @@ -1408,21 +1630,21 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "0.7.4" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "394b8239424b339a12012ceb18726ed0244fce6bf6345053cb9320b2791dcaa5" +checksum = "859fabde36db38634f3fad548dd5e3410c1aebba1b67a3c63e67018fa57a0bca" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.23", + "syn 2.0.85", ] [[package]] name = "swc_ecma_parser" -version = "0.143.5" +version = "0.152.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20823cac99a9adbd4c03fb5e126aaccbf92446afedad99252a0e1fc76e2ffc43" +checksum = "b888663998ef49da15d1dd3377e6b62bab4f994588e4f405628cb058d11ce8b3" dependencies = [ "either", "new_debug_unreachable", @@ -1433,8 +1655,8 @@ dependencies = [ "smallvec", "smartstring", "stacker", - "swc_atoms 0.6.5", - "swc_common 0.33.18", + "swc_atoms 1.0.2", + "swc_common 0.40.2", "swc_ecma_ast", "tracing", "typed-arena", @@ -1442,33 +1664,33 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "0.22.20" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1279bd6336c901852146c05a0dbae09f78056b0ab32ffa64b5a1088da073d48" +checksum = "d88a64496b73a0e9c9d8333d14d39904e8d87dbcefe7baaa161803a7f5bae110" dependencies = [ "anyhow", "hex", "sha2", - "testing 0.35.19", + "testing 0.42.1", "tracing", ] [[package]] name = "swc_ecma_transforms_base" -version = "0.137.10" +version = "0.149.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66539401f619730b26d380a120b91b499f80cbdd9bb15d00aa73bc3a4d4cc394" +checksum = "f2194d20416a03ae02058934f8387691809f86466a2f2e7a65c56dcb001bd46b" dependencies = [ "better_scoped_tls", - "bitflags 2.3.3", + "bitflags", "indexmap", "once_cell", "phf", "rustc-hash", "serde", "smallvec", - "swc_atoms 0.6.5", - "swc_common 0.33.18", + "swc_atoms 1.0.2", + "swc_common 0.40.2", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_utils", @@ -1478,9 +1700,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.140.10" +version = "0.152.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70d13125e86b0aa940ba326930447a43e0640fa6fed1ca512a1ae78ecafc278" +checksum = "b0cd337a171f362abb45841429b75c8fa78750fefa4896c8b1900ba16e4a2e71" dependencies = [ "ansi_term", "anyhow", @@ -1490,7 +1712,7 @@ dependencies = [ "serde_json", "sha2", "sourcemap", - "swc_common 0.33.18", + "swc_common 0.40.2", "swc_ecma_ast", "swc_ecma_codegen", "swc_ecma_parser", @@ -1499,21 +1721,22 @@ dependencies = [ "swc_ecma_utils", "swc_ecma_visit", "tempfile", - "testing 0.35.19", + "testing 0.42.1", ] [[package]] name = "swc_ecma_utils" -version = "0.127.7" +version = "0.137.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14482e455df85486d68a51533a31645d511e56df93a35cadf0eabbe7abe96b98" +checksum = "939f21c75eff61ad3e485fc54d38988f2f9744ceda24a3feb8228dd072171d94" dependencies = [ "indexmap", "num_cpus", "once_cell", "rustc-hash", - "swc_atoms 0.6.5", - "swc_common 0.33.18", + "ryu-js", + "swc_atoms 1.0.2", + "swc_common 0.40.2", "swc_ecma_ast", "swc_ecma_visit", "tracing", @@ -1522,71 +1745,72 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.98.4" +version = "0.107.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0127694c36d656ea9eab5c170cdd8ab398246ae2a335de26961c913a4aca47" +checksum = "b5983d63df36fdefec8b4bdb88d1fdcd06c9acb815d987c871409a5a64d58f63" dependencies = [ + "new_debug_unreachable", "num-bigint", - "swc_atoms 0.6.5", - "swc_common 0.33.18", + "swc_atoms 1.0.2", + "swc_common 0.40.2", "swc_ecma_ast", - "swc_visit", + "swc_visit 0.6.2", "tracing", ] [[package]] name = "swc_eq_ignore_macros" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "695a1d8b461033d32429b5befbf0ad4d7a2c4d6ba9cd5ba4e0645c615839e8e4" +checksum = "63db0adcff29d220c3d151c5b25c0eabe7e32dd936212b84cdaa1392e3130497" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.85", ] [[package]] name = "swc_error_reporters" -version = "0.15.16" +version = "0.15.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "108322b719696e8c368c39dc6d8748494ea2aa870e7d80ea5956078aa6b4dd4d" +checksum = "19c5d3bfe85c5f3e50f5a604398ca6b0830a45344b602a53b153b46fe56d3f02" dependencies = [ "anyhow", - "miette", + "miette 4.7.1", "once_cell", "parking_lot", - "swc_common 0.31.16", + "swc_common 0.31.22", ] [[package]] name = "swc_error_reporters" -version = "0.17.17" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76d4fb0aae65d68fd03b44d8ee0d66fa6b08c5fe0d9bb34c150ec0cad5a998" +checksum = "83f9286183c9be40aafcbbe8c397403fb32af812a3dffe93eee9067aee4fbedb" dependencies = [ "anyhow", - "miette", + "miette 7.2.0", "once_cell", "parking_lot", - "swc_common 0.33.18", + "swc_common 0.40.2", ] [[package]] name = "swc_macros_common" -version = "0.3.9" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50176cfc1cbc8bb22f41c6fe9d1ec53fbe057001219b5954961b8ad0f336fce9" +checksum = "27e18fbfe83811ffae2bb23727e45829a0d19c6870bced7c0f545cc99ad248dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.85", ] [[package]] name = "swc_plugin" -version = "0.90.0" +version = "0.90.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5df720531bfbd7ceb1139319c39c20c446abfb8f7e0eb47b104205a71152b4" +checksum = "3b059b8bb5b74cc5fc54559e8de09195fbddd20f4bb363b176b741993ef4894a" dependencies = [ "once_cell", ] @@ -1599,18 +1823,18 @@ checksum = "3232db481484070637b20a155c064096c0ea1ba04fa2247b89b618661b3574f4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.85", ] [[package]] name = "swc_plugin_proxy" -version = "0.41.4" +version = "0.50.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1a30d289547b936d33a8e5222e049c89b9c84ab706aac0a5c224ecf1b21bcb" +checksum = "62a0c7f6098cb0ea5d0191bc02c5b3705000f2dd94c6da31f3ac47adf77ae419" dependencies = [ "better_scoped_tls", "rkyv", - "swc_common 0.33.18", + "swc_common 0.40.2", "swc_ecma_ast", "swc_trace_macro", "tracing", @@ -1618,44 +1842,53 @@ dependencies = [ [[package]] name = "swc_trace_macro" -version = "0.1.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" +checksum = "69aa25f667e4d74ab10a17a266edeb8b354273817b20b91e60471f1c860a221b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.85", ] [[package]] name = "swc_visit" -version = "0.5.9" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "358e246dedeb4ae8efacebcce1360dc2f9b6c0b4c1ad8b737cc60f5b6633691a" +checksum = "043d11fe683dcb934583ead49405c0896a5af5face522e4682c16971ef7871b9" dependencies = [ "either", "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.10" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbbb9d77d5112f90ed7ea00477135b16c4370c872b93a0b63b766e8710650ad" +checksum = "92807d840959f39c60ce8a774a3f83e8193c658068e6d270dbe0a05e40e90b41" dependencies = [ "Inflector", - "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.23", + "syn 2.0.85", ] [[package]] name = "syn" -version = "1.0.99" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -1664,9 +1897,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -1681,22 +1914,22 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "once_cell", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -1713,19 +1946,19 @@ dependencies = [ [[package]] name = "testing" -version = "0.33.19" +version = "0.33.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "359d2548f4919624af6cd1001e0a3ac9f081f8312e47fdca7650c11c9935981b" +checksum = "1c722daaa5ad2208e7abd37aa92b4699bec2b053297859faecc5ccebf3bc7425" dependencies = [ "ansi_term", - "cargo_metadata", + "cargo_metadata 0.15.4", "difference", "once_cell", "pretty_assertions", "regex", "serde_json", - "swc_common 0.31.16", - "swc_error_reporters 0.15.16", + "swc_common 0.31.22", + "swc_error_reporters 0.15.22", "testing_macros", "tracing", "tracing-subscriber", @@ -1733,20 +1966,20 @@ dependencies = [ [[package]] name = "testing" -version = "0.35.19" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd2a7fea73e3b4693c08cbdf71806e4a51effdcbe82bebdb12532b49784232e8" +checksum = "9217860da21fabe9c65981ba42f6dad2bd8f463b670448afe79aa9d50f0bc137" dependencies = [ "ansi_term", - "cargo_metadata", + "cargo_metadata 0.18.1", "difference", "once_cell", "pretty_assertions", "regex", "serde", "serde_json", - "swc_common 0.33.18", - "swc_error_reporters 0.17.17", + "swc_common 0.40.2", + "swc_error_reporters 1.0.0", "testing_macros", "tracing", "tracing-subscriber", @@ -1754,9 +1987,9 @@ dependencies = [ [[package]] name = "testing_macros" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d3864d4184569c1428645a51a304b3b6e8d3094cd61fb3cce8dfdd9f6d0f72" +checksum = "a39660370116afe46d5ff8bcb01b7afe2140dda3137ef5cb1914681e37a4ee06" dependencies = [ "anyhow", "glob", @@ -1765,14 +1998,25 @@ dependencies = [ "quote", "regex", "relative-path", - "syn 2.0.23", + "syn 2.0.85", ] [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +dependencies = [ + "smawk", + "unicode-linebreak", + "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", @@ -1781,55 +2025,55 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.34" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.34" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.85", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +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", @@ -1837,20 +2081,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.23", + "syn 2.0.85", ] [[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", @@ -1858,20 +2102,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", @@ -1887,9 +2131,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.8" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" +checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" dependencies = [ "serde", "stable_deref_trait", @@ -1897,63 +2141,66 @@ dependencies = [ [[package]] name = "typed-arena" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-id" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe8d9274f490a36442acb4edfd0c4e473fdfc6a8b5cd32f28a0235761aedbe" +checksum = "10103c57044730945224467c09f71a4db0071c123a0648cc3e818913bde6b561" + +[[package]] +name = "unicode-id-start" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-linebreak" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" -dependencies = [ - "regex", -] +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "url" -version = "2.4.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -1962,9 +2209,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.3" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" @@ -1974,19 +2221,34 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vergen" -version = "8.2.4" +version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbc5ad0d9d26b2c49a5ab7da76c3e79d3ee37e7821799f8223fcb8f2f391a2e7" +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]] 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 = "wasi" @@ -2012,11 +2274,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -2025,192 +2287,120 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] -name = "windows_i686_gnu" -version = "0.52.0" +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" +name = "wyz" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" +name = "yansi" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] -name = "wyz" -version = "0.5.1" +name = "zerocopy" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "tap", + "byteorder", + "zerocopy-derive", ] [[package]] -name = "yansi" -version = "0.5.1" +name = "zerocopy-derive" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] diff --git a/Cargo.toml b/Cargo.toml index b4d2535..1061206 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] serde = "1.0.144" serde_json = "1.0.85" -swc_core = { version = "0.90.*", features = ["ecma_plugin_transform", "ecma_ast", "ecma_utils", "ecma_visit", "ecma_transforms", "ecma_parser", "common"] } +swc_core = { version = "0.106.*", features = ["ecma_plugin_transform", "ecma_ast", "ecma_utils", "ecma_visit", "ecma_transforms", "ecma_parser", "common"] } [dev-dependencies] testing = "0.33.11" diff --git a/rust-toolchain b/rust-toolchain index 30c785b..06d1588 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-03-09 \ No newline at end of file +nightly-2024-04-24 \ No newline at end of file diff --git a/src/app.rs b/src/app.rs index 5617bdc..519b284 100644 --- a/src/app.rs +++ b/src/app.rs @@ -79,7 +79,7 @@ impl VisitMut for AppTransformer { vec![ ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl { specifiers: vec![ImportNamedSpecifier { - local: Ident::new(SERIALIZER_FUNCTION.into(), DUMMY_SP), + local: Ident::new_no_ctxt(SERIALIZER_FUNCTION.into(), DUMMY_SP), span: DUMMY_SP, imported: None, is_type_only: false, @@ -90,7 +90,7 @@ impl VisitMut for AppTransformer { })), ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl { specifiers: vec![ImportDefaultSpecifier { - local: Ident::new(DESERIALIZER_COMPONENT.into(), DUMMY_SP), + local: Ident::new_no_ctxt(DESERIALIZER_COMPONENT.into(), DUMMY_SP), span: DUMMY_SP, } .into()], @@ -171,7 +171,10 @@ impl VisitMut for AppTransformer { // replace attrs elem.opening.attrs = vec![ JSXAttr { - name: Ident::new(DESERIALIZER_PROPS_ATTR.into(), DUMMY_SP).into(), + name: JSXAttrName::Ident(IdentName::new( + DESERIALIZER_PROPS_ATTR.into(), + DUMMY_SP, + )), span: DUMMY_SP, value: Some( JSXExprContainer { @@ -181,13 +184,14 @@ impl VisitMut for AppTransformer { props: list, }) .into()], - callee: Box::new(Expr::Ident(Ident::new( + callee: Box::new(Expr::Ident(Ident::new_no_ctxt( SERIALIZER_FUNCTION.into(), DUMMY_SP, ))) .into(), span: DUMMY_SP, type_args: None, + ..Default::default() })) .into(), span: DUMMY_SP, @@ -197,7 +201,10 @@ impl VisitMut for AppTransformer { } .into(), JSXAttr { - name: Ident::new(DESERIALIZER_PROPS_COMPONENT.into(), DUMMY_SP).into(), + name: JSXAttrName::Ident(IdentName::new( + DESERIALIZER_PROPS_COMPONENT.into(), + DUMMY_SP, + )), span: DUMMY_SP, value: Some( JSXExprContainer { @@ -211,10 +218,10 @@ impl VisitMut for AppTransformer { ]; // change element name - elem.opening.name = Ident::new(DESERIALIZER_COMPONENT.into(), DUMMY_SP).into(); + elem.opening.name = Ident::new_no_ctxt(DESERIALIZER_COMPONENT.into(), DUMMY_SP).into(); if let Some(closing) = &mut elem.closing { - closing.name = Ident::new(DESERIALIZER_COMPONENT.into(), DUMMY_SP).into(); + closing.name = Ident::new_no_ctxt(DESERIALIZER_COMPONENT.into(), DUMMY_SP).into(); } self.transformed = true; diff --git a/src/page.rs b/src/page.rs index 74b8337..e2ae1e9 100644 --- a/src/page.rs +++ b/src/page.rs @@ -190,7 +190,7 @@ impl VisitMut for PageTransformer { s.imported = Some(ModuleExportName::Ident(s.local.take())); } - s.local = Ident::new(NEXT_SSG_PROPS_LOCAL.into(), DUMMY_SP); + s.local = Ident::new_no_ctxt(NEXT_SSG_PROPS_LOCAL.into(), DUMMY_SP); new_items.push(item.take()); @@ -261,7 +261,7 @@ impl VisitMut for PageTransformer { ExportNamedSpecifier { exported: s.exported.take(), is_type_only: false, - orig: ModuleExportName::Ident(Ident::new( + orig: ModuleExportName::Ident(Ident::new_no_ctxt( NEXT_SSG_PROPS_ORIG.into(), DUMMY_SP, )), @@ -297,7 +297,7 @@ impl VisitMut for PageTransformer { // const gSSP = () => {} // => gSSP if self.props.ident.spec.is_some() { - s.orig = ModuleExportName::Ident(Ident::new( + s.orig = ModuleExportName::Ident(Ident::new_no_ctxt( NEXT_SSG_PROPS_ORIG.into(), DUMMY_SP, )); @@ -401,7 +401,7 @@ impl VisitMut for PageTransformer { let new_page = ModuleItem::ModuleDecl( ModuleDecl::ExportDefaultExpr(ExportDefaultExpr { - expr: Box::new(Expr::Ident(Ident::new( + expr: Box::new(Expr::Ident(Ident::new_no_ctxt( NEXT_PAGE_LOCAL.into(), DUMMY_SP, ))) diff --git a/src/utils.rs b/src/utils.rs index 07c4362..b05e06c 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -15,18 +15,12 @@ pub fn superjson_import_decl(superjson_import_name: &str) -> ModuleItem { span: DUMMY_SP, type_only: false, specifiers: vec![ImportSpecifier::Named(ImportNamedSpecifier { - local: Ident { - sym: format!("_{superjson_import_name}").into(), - span: DUMMY_SP, - optional: false, - }, + local: Ident::new_no_ctxt(format!("_{superjson_import_name}").into(), DUMMY_SP), span: DUMMY_SP, - imported: Some(ModuleExportName::Ident(Ident { - //sym: superjson_import_name.into(), - sym: superjson_import_name.into(), - span: DUMMY_SP, - optional: false, - })), + imported: Some(ModuleExportName::Ident(Ident::new_no_ctxt( + superjson_import_name.into(), + DUMMY_SP, + ))), is_type_only: false, })], src: Box::new(Str { @@ -43,20 +37,21 @@ pub fn temp_props_item(excluded: ExprOrSpread) -> ModuleItem { decls: vec![VarDeclarator { definite: false, init: Some( - Box::new(Expr::Ident(Ident::new( + Box::new(Expr::Ident(Ident::new_no_ctxt( NEXT_SSG_PROPS_LOCAL.into(), DUMMY_SP, ))) .wrap_props(excluded), ), name: Pat::Ident(BindingIdent { - id: Ident::new(NEXT_SSG_PROPS_ORIG.into(), DUMMY_SP), + id: Ident::new_no_ctxt(NEXT_SSG_PROPS_ORIG.into(), DUMMY_SP), type_ann: None, }), span: DUMMY_SP, }], kind: VarDeclKind::Const, span: DUMMY_SP, + ..Default::default() })))) } @@ -68,7 +63,7 @@ pub fn temp_import_item(imported: ModuleExportName, local: &str, src: &mut Str) specifiers: vec![ImportSpecifier::Named(ImportNamedSpecifier { imported: Some(imported), is_type_only: false, - local: Ident::new(local.into(), DUMMY_SP), + local: Ident::new_no_ctxt(local.into(), DUMMY_SP), span: DUMMY_SP, })], // should clone @@ -87,25 +82,28 @@ impl Wrapper for Box { fn wrap_props(self, excluded: ExprOrSpread) -> Box { Box::new(Expr::Call(CallExpr { args: vec![self.as_arg(), excluded], - callee: Ident::new(SUPERJSON_PROPS_LOCAL.into(), DUMMY_SP).as_callee(), + callee: Ident::new_no_ctxt(SUPERJSON_PROPS_LOCAL.into(), DUMMY_SP).as_callee(), span: DUMMY_SP, type_args: None, + ..Default::default() })) } fn wrap_init_props(self, excluded: ExprOrSpread) -> Box { Box::new(Expr::Call(CallExpr { args: vec![self.as_arg(), excluded], - callee: Ident::new(SUPERJSON_INIT_PROPS_LOCAL.into(), DUMMY_SP).as_callee(), + callee: Ident::new_no_ctxt(SUPERJSON_INIT_PROPS_LOCAL.into(), DUMMY_SP).as_callee(), span: DUMMY_SP, type_args: None, + ..Default::default() })) } fn wrap_page(self) -> Box { Box::new(Expr::Call(CallExpr { args: vec![self.as_arg()], - callee: Ident::new(SUPERJSON_PAGE_LOCAL.into(), DUMMY_SP).as_callee(), + callee: Ident::new_no_ctxt(SUPERJSON_PAGE_LOCAL.into(), DUMMY_SP).as_callee(), span: DUMMY_SP, type_args: None, + ..Default::default() })) } } @@ -135,6 +133,7 @@ impl DeclUtil for FnDecl { }], kind: VarDeclKind::Const, span: DUMMY_SP, + ..Default::default() })) } } From 8f80948f4da4a026cada0c9ef442d88d17309885 Mon Sep 17 00:00:00 2001 From: serg-and Date: Tue, 29 Oct 2024 11:24:19 +0100 Subject: [PATCH 02/10] add temporary extra config option to force page router --- src/lib.rs | 144 +++++++++++++++------------ tests/fixture.rs | 2 + tests/fixture/app/children/output.js | 2 - 3 files changed, 80 insertions(+), 68 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 150a854..174b9c3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,7 @@ -use std::path::{Component, Path}; - use serde::Deserialize; use swc_core::{ ecma::{ast::*, visit::*}, - plugin::{ - metadata::TransformPluginMetadataContextKind, plugin_transform, - proxies::TransformPluginProgramMetadata, - }, + plugin::{plugin_transform, proxies::TransformPluginProgramMetadata}, }; use app::*; @@ -21,70 +16,87 @@ mod utils; pub struct Config { #[serde(default)] pub excluded: Vec, + #[serde(default)] + pub force_page_router: Option, } -pub enum DirType { - Page, - App, -} +// pub enum DirType { +// Page, +// App, +// } #[plugin_transform] pub fn process_transform(program: Program, _metadata: TransformPluginProgramMetadata) -> Program { - let raw_cwd = _metadata - .get_context(&TransformPluginMetadataContextKind::Cwd) - .unwrap(); - - let raw_path = _metadata - .get_context(&TransformPluginMetadataContextKind::Filename) - .unwrap(); - - // Windows path separator -> Unix path separator - let cwd = &raw_cwd.replace('\\', "/"); - let path = &raw_path.replace('\\', "/"); - - // overlapping prefix - let prefix = cwd - .chars() - .zip(path.chars()) - .take_while(|(a, b)| a == b) - .map(|(a, _)| a) - .collect::(); - - if let Some(relative_path) = path.strip_prefix(&prefix) { - let mut is_page = false; - - for component in Path::new(relative_path).components() { - match component { - Component::Normal(str) => match str.to_str().unwrap_or_default() { - // skip non-source stuff - "node_modules" => { - return program; - } - "pages" => { - is_page = true; - break; - } - _ => {} - }, - _ => {} - } - } - - // consider server components outside the app directory - let dir_type = if is_page { DirType::Page } else { DirType::App }; - - let config = serde_json::from_str::( - &_metadata - .get_transform_plugin_config() - .unwrap_or_else(|| "{}".to_string()), - ) - .expect("Failed to parse plugin config"); - - match dir_type { - DirType::Page => program.fold_with(&mut as_folder(transform_page(config))), - DirType::App => program.fold_with(&mut as_folder(transform_app(config))), - } - } else { - program + let config = serde_json::from_str::( + &_metadata + .get_transform_plugin_config() + .unwrap_or_else(|| "{}".to_string()), + ) + .expect("Failed to parse plugin config"); + + match config.force_page_router { + Some(true) => program.fold_with(&mut as_folder(transform_page(config))), + _ => program.fold_with(&mut as_folder(transform_app(config))), } + + // re enable this code once next fixes this issue + // https://github.com/vercel/next.js/issues/72019 + + // let raw_cwd = _metadata + // .get_context(&TransformPluginMetadataContextKind::Cwd) + // .unwrap(); + + // let raw_path = _metadata + // .get_context(&TransformPluginMetadataContextKind::Filename) + // .unwrap(); + + // // Windows path separator -> Unix path separator + // let cwd = &raw_cwd.replace('\\', "/"); + // let path = &raw_path.replace('\\', "/"); + + // // overlapping prefix + // let prefix = cwd + // .chars() + // .zip(path.chars()) + // .take_while(|(a, b)| a == b) + // .map(|(a, _)| a) + // .collect::(); + + // if let Some(relative_path) = path.strip_prefix(&prefix) { + // let mut is_page = false; + + // for component in Path::new(relative_path).components() { + // match component { + // Component::Normal(str) => match str.to_str().unwrap_or_default() { + // // skip non-source stuff + // "node_modules" => { + // return program; + // } + // "pages" => { + // is_page = true; + // break; + // } + // _ => {} + // }, + // _ => {} + // } + // } + + // // consider server components outside the app directory + // let dir_type = if is_page { DirType::Page } else { DirType::App }; + + // let config = serde_json::from_str::( + // &_metadata + // .get_transform_plugin_config() + // .unwrap_or_else(|| "{}".to_string()), + // ) + // .expect("Failed to parse plugin config"); + + // match dir_type { + // DirType::Page => program.fold_with(&mut as_folder(transform_page(config))), + // DirType::App => program.fold_with(&mut as_folder(transform_app(config))), + // } + // } else { + // program + // } } diff --git a/tests/fixture.rs b/tests/fixture.rs index 36f89b8..cd54de2 100644 --- a/tests/fixture.rs +++ b/tests/fixture.rs @@ -20,6 +20,7 @@ fn fixture_page(input: PathBuf) { &|_| { as_folder(transform_page(Config { excluded: vec!["smth".to_string()], + ..Default::default() })) }, &input, @@ -42,6 +43,7 @@ fn fixture_app(input: PathBuf) { &|_| { as_folder(transform_app(Config { excluded: vec!["smth".to_string()], + ..Default::default() })) }, &input, diff --git a/tests/fixture/app/children/output.js b/tests/fixture/app/children/output.js index ce76380..aa6e4dd 100644 --- a/tests/fixture/app/children/output.js +++ b/tests/fixture/app/children/output.js @@ -8,8 +8,6 @@ export default function Page() { date: date, ...rest })} component={ClientComponent}> -

children

- ; } From eaa42876023c833314faed4c7b2ab2274b1f48f7 Mon Sep 17 00:00:00 2001 From: serg-and Date: Tue, 29 Oct 2024 11:30:04 +0100 Subject: [PATCH 03/10] add option to readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index a220165..3946a73 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,15 @@ You can use the `excluded` option to exclude specific properties from serializat ['next-superjson-plugin', { excluded: ["someProp"] }], ``` +#### With pages router + +There is currently an issue in `Next@15`, to use this plugin with pages router add this option: +This will make the plugin only work inside the page router and is thus not compatible with projects using both routers. + +```js +['next-superjson-plugin', { forcePageRouter: true }], +``` + ## How it works ```mermaid From b03708b3ca7ba422360ad6c0a545f017e86f833b Mon Sep 17 00:00:00 2001 From: serg-and Date: Fri, 28 Mar 2025 12:04:48 +0100 Subject: [PATCH 04/10] force router config and use latest version of swc_core --- .cargo/{config => config.toml} | 0 .gitignore | 3 +- .husky/pre-commit | 4 - Cargo.lock | 695 +++++++++++++----- Cargo.toml | 2 +- package.json | 4 +- rust-toolchain | 1 - src/lib.rs | 178 +++-- src/page.rs | 16 +- tests/fixture.rs | 28 +- .../fixture/page/skip/gip-in-app-js/output.js | 8 +- .../transform/export-from/props/output.js | 6 +- .../page/transform/general/arrow/output.js | 6 +- .../page/transform/general/class/output.js | 4 +- .../page/transform/general/function/output.js | 6 +- .../get-initial-props/class/output.js | 25 +- .../function-export-page-first/output.js | 17 +- .../get-initial-props/function/output.js | 19 +- .../get-static-props-with-paths/output.js | 8 +- .../page/transform/import-export/output.js | 6 +- .../fixture/page/transform/mutable/output.js | 4 +- yarn.lock | 162 +--- 22 files changed, 712 insertions(+), 490 deletions(-) rename .cargo/{config => config.toml} (100%) delete mode 100755 .husky/pre-commit delete mode 100644 rust-toolchain diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/.gitignore b/.gitignore index 4b10634..c8ca176 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ target /dist /tools.* *.wasm -.DS_Store \ No newline at end of file +.DS_Store +.vscode \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index d24fdfc..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx lint-staged diff --git a/Cargo.lock b/Cargo.lock index 1c3bfd4..5314eea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -27,17 +27,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -80,6 +69,12 @@ version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +[[package]] +name = "ascii" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" + [[package]] name = "ast_node" version = "0.9.9" @@ -88,19 +83,19 @@ checksum = "f9184f2b369b3e8625712493c89b785881f27eedc6cde480a81883cef78868b2" dependencies = [ "proc-macro2", "quote", - "swc_macros_common", + "swc_macros_common 0.3.14", "syn 2.0.85", ] [[package]] name = "ast_node" -version = "1.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4d23a6d1d5f18bdbc06d9aa908880e5f49205156ba804751af731c51f5cf81a" +checksum = "91fb5864e2f5bf9fd9797b94b2dfd1554d4c3092b535008b27d7e15c86675a2f" dependencies = [ "proc-macro2", "quote", - "swc_macros_common", + "swc_macros_common 1.0.0", "syn 2.0.85", ] @@ -138,9 +133,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-simd" @@ -160,6 +155,15 @@ dependencies = [ "scoped-tls", ] +[[package]] +name = "better_scoped_tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50fd297a11c709be8348aec039c8b91de16075d2b2bdaee1bd562c0875993664" +dependencies = [ + "scoped-tls", +] + [[package]] name = "bitflags" version = "2.6.0" @@ -198,24 +202,25 @@ dependencies = [ [[package]] name = "bytecheck" -version = "0.6.12" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +checksum = "50690fb3370fb9fe3550372746084c46f2ac8c9685c583d2be10eefd89d3d1a3" dependencies = [ "bytecheck_derive", "ptr_meta", + "rancor", "simdutf8", ] [[package]] name = "bytecheck_derive" -version = "0.6.12" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.85", ] [[package]] @@ -276,6 +281,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "castaway" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.1.31" @@ -291,6 +305,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "ryu", + "static_assertions", +] + [[package]] name = "cpufeatures" version = "0.2.14" @@ -414,6 +441,17 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "either" version = "1.13.0" @@ -464,18 +502,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32016f1242eb82af5474752d00fd8ebcd9004bd69b462b1c91de833972d08ed4" dependencies = [ "proc-macro2", - "swc_macros_common", + "swc_macros_common 0.3.14", "syn 2.0.85", ] [[package]] name = "from_variant" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d8947525c49c73130b5a7187b55b027b6b78fe60268d9f4c283ed690698cb1" +checksum = "8d7ccf961415e7aa17ef93dcb6c2441faaa8e768abe09e659b908089546f74c5" dependencies = [ "proc-macro2", - "swc_macros_common", + "swc_macros_common 1.0.0", "syn 2.0.85", ] @@ -518,22 +556,13 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] - [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", ] @@ -566,18 +595,136 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hstr" -version = "0.2.12" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae404c0c5d4e95d4858876ab02eecd6a196bb8caa42050dfa809938833fc412" +checksum = "71399f53a92ef72ee336a4b30201c6e944827e14e0af23204c291aad9c24cc85" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", "once_cell", "phf", - "rustc-hash", + "rustc-hash 2.1.1", "triomphe", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -586,12 +733,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -652,6 +810,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + [[package]] name = "lock_api" version = "0.4.12" @@ -748,6 +912,26 @@ dependencies = [ "adler2", ] +[[package]] +name = "munge" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0091202c98cf06da46c279fdf50cccb6b1c43b4521abdf6a27b4c7e71d5d9d7" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734799cf91479720b2f970c61a22850940dd91e27d4f02b1c6fc792778df2459" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -993,22 +1177,22 @@ dependencies = [ [[package]] name = "ptr_meta" -version = "0.1.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" dependencies = [ "ptr_meta_derive", ] [[package]] name = "ptr_meta_derive" -version = "0.1.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.85", ] [[package]] @@ -1026,6 +1210,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta", +] + [[package]] name = "rand" version = "0.8.5" @@ -1117,40 +1310,41 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "rend" -version = "0.4.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" dependencies = [ "bytecheck", ] [[package]] name = "rkyv" -version = "0.7.45" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ - "bitvec", "bytecheck", "bytes", - "hashbrown 0.12.3", + "hashbrown 0.15.0", + "indexmap", + "munge", "ptr_meta", + "rancor", "rend", "rkyv_derive", - "seahash", "tinyvec", "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.45" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.85", ] [[package]] @@ -1165,6 +1359,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1217,12 +1417,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "semver" version = "0.9.0" @@ -1360,7 +1554,7 @@ dependencies = [ "data-encoding", "debugid", "if_chain", - "rustc-hash", + "rustc-hash 1.1.0", "rustc_version", "serde", "serde_json", @@ -1421,13 +1615,13 @@ dependencies = [ [[package]] name = "string_enum" -version = "0.4.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e383308aebc257e7d7920224fa055c632478d92744eca77f99be8fa1545b90" +checksum = "c9fe66b8ee349846ce2f9557a26b8f1e74843c4a13fb381f9a3d73617a5f956a" dependencies = [ "proc-macro2", "quote", - "swc_macros_common", + "swc_macros_common 1.0.0", "syn 2.0.85", ] @@ -1467,14 +1661,15 @@ dependencies = [ [[package]] name = "swc_allocator" -version = "0.1.10" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76aa0eb65c0f39f9b6d82a7e5192c30f7ac9a78f084a21f270de1d8c600ca388" +checksum = "cc6b926f0d94bbb34031fe5449428cfa1268cdc0b31158d6ad9c97e0fc1e79dd" dependencies = [ + "allocator-api2", "bumpalo", "hashbrown 0.14.5", "ptr_meta", - "rustc-hash", + "rustc-hash 2.1.1", "triomphe", ] @@ -1485,7 +1680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f54563d7dcba626d4acfe14ed12def7ecc28e004debe3ecd2c3ee07cc47e449" dependencies = [ "once_cell", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "string_cache", "string_cache_codegen", @@ -1494,15 +1689,16 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "1.0.2" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25ff0f3fd48ab1a95d86fd0505fdd1ac904f84d0350dc8222bbc824e9d4fdf6" +checksum = "9d7077ba879f95406459bc0c81f3141c529b34580bc64d7ab7bd15e7118a0391" dependencies = [ "bytecheck", "hstr", "once_cell", + "rancor", "rkyv", - "rustc-hash", + "rustc-hash 2.1.1", "serde", ] @@ -1514,7 +1710,7 @@ checksum = "88d00f960c667c59c133f30492f4d07f26242fcf988a066d3871e6d3d838d528" dependencies = [ "ast_node 0.9.9", "atty", - "better_scoped_tls", + "better_scoped_tls 0.1.2", "cfg-if", "either", "from_variant 0.1.9", @@ -1522,12 +1718,12 @@ dependencies = [ "num-bigint", "once_cell", "parking_lot", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "siphasher", "string_cache", "swc_atoms 0.5.9", - "swc_eq_ignore_macros", + "swc_eq_ignore_macros 0.1.4", "swc_visit 0.5.14", "termcolor", "tracing", @@ -1537,30 +1733,31 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.40.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca32839a37f3b12213b18623b1bd58d37641cab750c50c3c287876cb98b12ab4" +checksum = "9e4a932c152e7142de2d5dba1c393e5523c47cd8fe656e5b0d411954bbaf1810" dependencies = [ "anyhow", - "ast_node 1.0.0", - "better_scoped_tls", + "ast_node 3.0.0", + "better_scoped_tls 1.0.0", "bytecheck", "cfg-if", "either", - "from_variant 1.0.0", + "from_variant 2.0.0", "new_debug_unreachable", "num-bigint", "once_cell", "parking_lot", + "rancor", "rkyv", - "rustc-hash", + "rustc-hash 2.1.1", "serde", "siphasher", "sourcemap", "swc_allocator", - "swc_atoms 1.0.2", - "swc_eq_ignore_macros", - "swc_visit 0.6.2", + "swc_atoms 5.0.0", + "swc_eq_ignore_macros 1.0.0", + "swc_visit 2.0.0", "termcolor", "tracing", "unicode-width", @@ -1569,14 +1766,14 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.106.4" +version = "16.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4d1040f3e4289cdae3e53965b9100b1af09a0422382e8f5161f7a438705c14" +checksum = "f7453b2e6771d55f483903ed12fa9cf949ff7a3fefdfe4a63a5ea13b542e9eca" dependencies = [ "once_cell", "swc_allocator", - "swc_atoms 1.0.2", - "swc_common 0.40.2", + "swc_atoms 5.0.0", + "swc_common 8.0.1", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_transforms_base", @@ -1591,38 +1788,43 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.121.2" +version = "8.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d568834a727fc06c608db119dcea52c2d58e9426e92e72f358e2f7dc847063" +checksum = "01f80679b1afc52ae0663eed0a2539cc3c108d48c287b5601712f9850d9fa9c2" dependencies = [ "bitflags", "bytecheck", "is-macro", "num-bigint", "phf", + "rancor", "rkyv", "scoped-tls", "string_enum", - "swc_atoms 1.0.2", - "swc_common 0.40.2", + "swc_atoms 5.0.0", + "swc_common 8.0.1", + "swc_visit 2.0.0", "unicode-id-start", ] [[package]] name = "swc_ecma_codegen" -version = "0.158.4" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2549dd7b0f4db0b127fe286958f749b4e2d5467cb6739a78ac887df4f33dcef" +checksum = "92103aa982740f265d6850bb3ffffbf6c3c1dee30ab0ed25117ca553f0d7467d" dependencies = [ + "ascii", + "compact_str", "memchr", "num-bigint", "once_cell", "regex", + "rustc-hash 2.1.1", "serde", "sourcemap", "swc_allocator", - "swc_atoms 1.0.2", - "swc_common 0.40.2", + "swc_atoms 5.0.0", + "swc_common 8.0.1", "swc_ecma_ast", "swc_ecma_codegen_macros", "tracing", @@ -1630,33 +1832,34 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "0.7.7" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859fabde36db38634f3fad548dd5e3410c1aebba1b67a3c63e67018fa57a0bca" +checksum = "4ac2ff0957329e0dfcde86a1ac465382e189bf42a5989720d3476bea78eaa31a" dependencies = [ "proc-macro2", "quote", - "swc_macros_common", + "swc_macros_common 1.0.0", "syn 2.0.85", ] [[package]] name = "swc_ecma_parser" -version = "0.152.2" +version = "10.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b888663998ef49da15d1dd3377e6b62bab4f994588e4f405628cb058d11ce8b3" +checksum = "edfbfa5baabd14901a310f9d55d991625787d27d94de5c38a1a2ef85ebc19c97" dependencies = [ "either", "new_debug_unreachable", "num-bigint", "num-traits", "phf", + "rustc-hash 2.1.1", "serde", "smallvec", "smartstring", "stacker", - "swc_atoms 1.0.2", - "swc_common 0.40.2", + "swc_atoms 5.0.0", + "swc_common 8.0.1", "swc_ecma_ast", "tracing", "typed-arena", @@ -1664,45 +1867,46 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "0.29.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d88a64496b73a0e9c9d8333d14d39904e8d87dbcefe7baaa161803a7f5bae110" +checksum = "5e72a43b7acd904fa0c6d244a72aeda66febbc5a9720975481cb836d6804b604" dependencies = [ "anyhow", "hex", "sha2", - "testing 0.42.1", + "testing 8.0.0", "tracing", ] [[package]] name = "swc_ecma_transforms_base" -version = "0.149.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2194d20416a03ae02058934f8387691809f86466a2f2e7a65c56dcb001bd46b" +checksum = "39889063ff4819eae414dfe6426aa5cd72ebb0f9f48739a1fa1e7eb82d0adc78" dependencies = [ - "better_scoped_tls", + "better_scoped_tls 1.0.0", "bitflags", "indexmap", "once_cell", "phf", - "rustc-hash", + "rustc-hash 2.1.1", "serde", "smallvec", - "swc_atoms 1.0.2", - "swc_common 0.40.2", + "swc_atoms 5.0.0", + "swc_common 8.0.1", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_utils", "swc_ecma_visit", + "swc_parallel", "tracing", ] [[package]] name = "swc_ecma_transforms_testing" -version = "0.152.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0cd337a171f362abb45841429b75c8fa78750fefa4896c8b1900ba16e4a2e71" +checksum = "13c4d8c48a36ad5d02626f853edcf52ae82b65d238389e7e76270ddf564b69ab" dependencies = [ "ansi_term", "anyhow", @@ -1712,7 +1916,8 @@ dependencies = [ "serde_json", "sha2", "sourcemap", - "swc_common 0.40.2", + "swc_allocator", + "swc_common 8.0.1", "swc_ecma_ast", "swc_ecma_codegen", "swc_ecma_parser", @@ -1721,40 +1926,41 @@ dependencies = [ "swc_ecma_utils", "swc_ecma_visit", "tempfile", - "testing 0.42.1", + "testing 8.0.0", ] [[package]] name = "swc_ecma_utils" -version = "0.137.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "939f21c75eff61ad3e485fc54d38988f2f9744ceda24a3feb8228dd072171d94" +checksum = "721dc779e7de200da96ac4002c710bc32c988e3e1ebf62b39d32bf99f14d9765" dependencies = [ "indexmap", "num_cpus", "once_cell", - "rustc-hash", + "rustc-hash 2.1.1", "ryu-js", - "swc_atoms 1.0.2", - "swc_common 0.40.2", + "swc_atoms 5.0.0", + "swc_common 8.0.1", "swc_ecma_ast", "swc_ecma_visit", + "swc_parallel", "tracing", "unicode-id", ] [[package]] name = "swc_ecma_visit" -version = "0.107.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5983d63df36fdefec8b4bdb88d1fdcd06c9acb815d987c871409a5a64d58f63" +checksum = "2f7a65fa06d0c0f709f1df4e820ccdc4eca7b3db7f9d131545e20c2ac2f1cd23" dependencies = [ "new_debug_unreachable", "num-bigint", - "swc_atoms 1.0.2", - "swc_common 0.40.2", + "swc_atoms 5.0.0", + "swc_common 8.0.1", "swc_ecma_ast", - "swc_visit 0.6.2", + "swc_visit 2.0.0", "tracing", ] @@ -1769,6 +1975,17 @@ dependencies = [ "syn 2.0.85", ] +[[package]] +name = "swc_eq_ignore_macros" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96e15288bf385ab85eb83cff7f9e2d834348da58d0a31b33bdb572e66ee413e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "swc_error_reporters" version = "0.15.22" @@ -1784,15 +2001,18 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "1.0.0" +version = "9.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f9286183c9be40aafcbbe8c397403fb32af812a3dffe93eee9067aee4fbedb" +checksum = "7938665a5561d6c3e2b796b5b2d0bc9a961d461db960cb5139f12e82b45bb471" dependencies = [ "anyhow", "miette 7.2.0", "once_cell", "parking_lot", - "swc_common 0.40.2", + "serde", + "serde_derive", + "serde_json", + "swc_common 8.0.1", ] [[package]] @@ -1806,20 +2026,40 @@ dependencies = [ "syn 2.0.85", ] +[[package]] +name = "swc_macros_common" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a509f56fca05b39ba6c15f3e58636c3924c78347d63853632ed2ffcb6f5a0ac7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + +[[package]] +name = "swc_parallel" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f16052d5123ec45c1c49100781363f3f4e4a6be2da6d82f473b79db1e3abeb8" +dependencies = [ + "once_cell", +] + [[package]] name = "swc_plugin" -version = "0.90.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b059b8bb5b74cc5fc54559e8de09195fbddd20f4bb363b176b741993ef4894a" +checksum = "6b45099a38ed45528bef939d0eac1a0c1347749d0c67d3dd744d545316c5fd05" dependencies = [ "once_cell", ] [[package]] name = "swc_plugin_macro" -version = "0.9.16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3232db481484070637b20a155c064096c0ea1ba04fa2247b89b618661b3574f4" +checksum = "0917ccfdcd3fa6cf41bdacef2388702a3b274f9ea708d930e1e8db37c7c3e1c6" dependencies = [ "proc-macro2", "quote", @@ -1828,13 +2068,16 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "0.50.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62a0c7f6098cb0ea5d0191bc02c5b3705000f2dd94c6da31f3ac47adf77ae419" +checksum = "a18c199683d9f946db8dfca444212a3551e74a7c563196b154d5ac30f3bf9de6" dependencies = [ - "better_scoped_tls", + "better_scoped_tls 1.0.0", + "bytecheck", + "rancor", "rkyv", - "swc_common 0.40.2", + "rustc-hash 2.1.1", + "swc_common 8.0.1", "swc_ecma_ast", "swc_trace_macro", "tracing", @@ -1842,9 +2085,9 @@ dependencies = [ [[package]] name = "swc_trace_macro" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69aa25f667e4d74ab10a17a266edeb8b354273817b20b91e60471f1c860a221b" +checksum = "4c78717a841565df57f811376a3d19c9156091c55175e12d378f3a522de70cef" dependencies = [ "proc-macro2", "quote", @@ -1863,9 +2106,9 @@ dependencies = [ [[package]] name = "swc_visit" -version = "0.6.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ceb044142ba2719ef9eb3b6b454fce61ab849eb696c34d190f04651955c613d" +checksum = "9138b6a36bbe76dd6753c4c0794f7e26480ea757bee499738bedbbb3ae3ec5f3" dependencies = [ "either", "new_debug_unreachable", @@ -1880,7 +2123,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "swc_macros_common", + "swc_macros_common 0.3.14", "syn 2.0.85", ] @@ -1906,6 +2149,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "tap" version = "1.0.1" @@ -1959,16 +2213,16 @@ dependencies = [ "serde_json", "swc_common 0.31.22", "swc_error_reporters 0.15.22", - "testing_macros", + "testing_macros 0.2.14", "tracing", "tracing-subscriber", ] [[package]] name = "testing" -version = "0.42.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9217860da21fabe9c65981ba42f6dad2bd8f463b670448afe79aa9d50f0bc137" +checksum = "8d32ddc0e2ebd072cbffe7424087267da990708a5bc3ae29e075904468450275" dependencies = [ "ansi_term", "cargo_metadata 0.18.1", @@ -1976,11 +2230,12 @@ dependencies = [ "once_cell", "pretty_assertions", "regex", + "rustc-hash 2.1.1", "serde", "serde_json", - "swc_common 0.40.2", - "swc_error_reporters 1.0.0", - "testing_macros", + "swc_common 8.0.1", + "swc_error_reporters 9.1.1", + "testing_macros 1.0.0", "tracing", "tracing-subscriber", ] @@ -2001,6 +2256,22 @@ dependencies = [ "syn 2.0.85", ] +[[package]] +name = "testing_macros" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2d27bf245b90a80d5aa231133418ae7db98f032855ce5292e12071ab29c4b26" +dependencies = [ + "anyhow", + "glob", + "once_cell", + "proc-macro2", + "quote", + "regex", + "relative-path", + "syn 2.0.85", +] + [[package]] name = "textwrap" version = "0.15.2" @@ -2053,6 +2324,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -2151,12 +2432,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-id" version = "0.3.5" @@ -2181,15 +2456,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.14" @@ -2198,15 +2464,27 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "uuid" version = "1.11.0" @@ -2369,6 +2647,18 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -2384,6 +2674,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -2404,3 +2718,46 @@ dependencies = [ "quote", "syn 2.0.85", ] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] diff --git a/Cargo.toml b/Cargo.toml index 1061206..9951385 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] serde = "1.0.144" serde_json = "1.0.85" -swc_core = { version = "0.106.*", features = ["ecma_plugin_transform", "ecma_ast", "ecma_utils", "ecma_visit", "ecma_transforms", "ecma_parser", "common"] } +swc_core = { version = "16.10.*", features = ["ecma_plugin_transform", "ecma_ast", "ecma_utils", "ecma_visit", "ecma_transforms", "ecma_parser", "common"] } [dev-dependencies] testing = "0.33.11" diff --git a/package.json b/package.json index c1ada62..8ed81ae 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "dist" ], "peerDependencies": { - "next": "^13.0 || ^14.0", + "next": "^15.2", "superjson": "^1 || ^2" }, "dependencies": { @@ -40,9 +40,9 @@ }, "devDependencies": { "@types/hoist-non-react-statics": "^3.3.1", + "@types/react": "18.3.1", "husky": "^8.0.2", "lint-staged": "^13.0.3", - "next": "^13", "prettier": "^2.7.1", "superjson": "^2", "typescript": "^5.3.3" diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 06d1588..0000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2024-04-24 \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 174b9c3..40c98af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,13 +11,42 @@ pub mod app; pub mod page; mod utils; -#[derive(Debug, Default, Clone, Deserialize)] +static MISSING_CONFIG: &str = "next-superjson-plugin: Missing config, +Provide a plugin config in your next.config.(js|ts) like: + +experimental: { + swcPlugins: [ + ['next-superjson-plugin', { router: 'APP' | 'PAGE' }] + ], +}, +"; + +static BAD_CONFIG: &str = "next-superjson-plugin: Failed to parse config, +Provide a plugin config in your next.config.(js|ts) like: + +experimental: { + swcPlugins: [ + ['next-superjson-plugin', { router: 'APP' | 'PAGE' }] + ], +}, +"; + +#[derive(Debug, Clone, Deserialize)] +#[serde(rename_all = "UPPERCASE")] +pub enum Router { + #[serde(alias = "app", alias = "App")] + App, + #[serde(alias = "page", alias = "Page")] + Page, +} + +#[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Config { - #[serde(default)] - pub excluded: Vec, - #[serde(default)] - pub force_page_router: Option, + pub router: Router, + // disabled because of Next.js bug, see below + // #[serde(default)] + // pub excluded: Vec, } // pub enum DirType { @@ -26,77 +55,78 @@ pub struct Config { // } #[plugin_transform] -pub fn process_transform(program: Program, _metadata: TransformPluginProgramMetadata) -> Program { - let config = serde_json::from_str::( - &_metadata - .get_transform_plugin_config() - .unwrap_or_else(|| "{}".to_string()), - ) - .expect("Failed to parse plugin config"); - - match config.force_page_router { - Some(true) => program.fold_with(&mut as_folder(transform_page(config))), - _ => program.fold_with(&mut as_folder(transform_app(config))), +pub fn process_transform(program: Program, metadata: TransformPluginProgramMetadata) -> Program { + let plugin_config_str = &metadata + .get_transform_plugin_config() + .expect(MISSING_CONFIG); + let config = serde_json::from_str::(&plugin_config_str).expect(BAD_CONFIG); + + match config.router { + Router::App => program.apply(&mut visit_mut_pass(transform_app(config))), + Router::Page => program.apply(&mut visit_mut_pass(transform_page(config))), } - // re enable this code once next fixes this issue + /* + // Automatic detection of router type is disabled because of a bug in Next.js + // Re enable this code once Next.js fixes this issue // https://github.com/vercel/next.js/issues/72019 - // let raw_cwd = _metadata - // .get_context(&TransformPluginMetadataContextKind::Cwd) - // .unwrap(); - - // let raw_path = _metadata - // .get_context(&TransformPluginMetadataContextKind::Filename) - // .unwrap(); - - // // Windows path separator -> Unix path separator - // let cwd = &raw_cwd.replace('\\', "/"); - // let path = &raw_path.replace('\\', "/"); - - // // overlapping prefix - // let prefix = cwd - // .chars() - // .zip(path.chars()) - // .take_while(|(a, b)| a == b) - // .map(|(a, _)| a) - // .collect::(); - - // if let Some(relative_path) = path.strip_prefix(&prefix) { - // let mut is_page = false; - - // for component in Path::new(relative_path).components() { - // match component { - // Component::Normal(str) => match str.to_str().unwrap_or_default() { - // // skip non-source stuff - // "node_modules" => { - // return program; - // } - // "pages" => { - // is_page = true; - // break; - // } - // _ => {} - // }, - // _ => {} - // } - // } - - // // consider server components outside the app directory - // let dir_type = if is_page { DirType::Page } else { DirType::App }; - - // let config = serde_json::from_str::( - // &_metadata - // .get_transform_plugin_config() - // .unwrap_or_else(|| "{}".to_string()), - // ) - // .expect("Failed to parse plugin config"); - - // match dir_type { - // DirType::Page => program.fold_with(&mut as_folder(transform_page(config))), - // DirType::App => program.fold_with(&mut as_folder(transform_app(config))), - // } - // } else { - // program - // } + let raw_cwd = _metadata + .get_context(&TransformPluginMetadataContextKind::Cwd) + .unwrap(); + + let raw_path = _metadata + .get_context(&TransformPluginMetadataContextKind::Filename) + .unwrap(); + + // Windows path separator -> Unix path separator + let cwd = &raw_cwd.replace('\\', "/"); + let path = &raw_path.replace('\\', "/"); + + // overlapping prefix + let prefix = cwd + .chars() + .zip(path.chars()) + .take_while(|(a, b)| a == b) + .map(|(a, _)| a) + .collect::(); + + if let Some(relative_path) = path.strip_prefix(&prefix) { + let mut is_page = false; + + for component in Path::new(relative_path).components() { + match component { + Component::Normal(str) => match str.to_str().unwrap_or_default() { + // skip non-source stuff + "node_modules" => { + return program; + } + "pages" => { + is_page = true; + break; + } + _ => {} + }, + _ => {} + } + } + + // consider server components outside the app directory + let dir_type = if is_page { DirType::Page } else { DirType::App }; + + let config = serde_json::from_str::( + &_metadata + .get_transform_plugin_config() + .unwrap_or_else(|| "{}".to_string()), + ) + .expect("Failed to parse plugin config"); + + match dir_type { + DirType::Page => program.fold_with(&mut as_folder(transform_page(config))), + DirType::App => program.fold_with(&mut as_folder(transform_app(config))), + } + } else { + program + } + */ } diff --git a/src/page.rs b/src/page.rs index e2ae1e9..ed2d1f0 100644 --- a/src/page.rs +++ b/src/page.rs @@ -63,9 +63,10 @@ struct PageTransformer { has_multiple_props: bool, } -pub fn transform_page(config: Config) -> impl VisitMut { +pub fn transform_page(_: Config) -> impl VisitMut { PageTransformer { - excluded: config.excluded, + // excluded: config.excluded, + excluded: Default::default(), props: Default::default(), page: Default::default(), @@ -601,9 +602,14 @@ impl PageTransformer { match decl { Decl::Fn(fn_decl) => SSG_EXPORTS.contains(&&*fn_decl.ident.sym), Decl::Var(var_decl) => { - let pos = var_decl.decls.iter().position(|decl| { - SSG_EXPORTS.contains(&&*decl.name.as_ident().unwrap().sym) - }); + let pos = + var_decl + .decls + .iter() + .position(|decl| match decl.name.as_ident() { + Some(idn) => SSG_EXPORTS.contains(&&*idn.sym), + None => false, + }); if self.props.export.decl.is_none() { self.props.export.decl = pos; diff --git a/tests/fixture.rs b/tests/fixture.rs index cd54de2..6675edb 100644 --- a/tests/fixture.rs +++ b/tests/fixture.rs @@ -1,33 +1,30 @@ use std::path::PathBuf; use swc_core::ecma::{ - parser::{EsConfig, Syntax}, + parser::{EsSyntax, Syntax}, transforms::testing::{test_fixture, FixtureTestConfig}, - visit::as_folder, + visit::visit_mut_pass, }; use testing::fixture; -use next_superjson::{app::transform_app, page::transform_page, Config}; +use next_superjson::{app::transform_app, page::transform_page, Config, Router}; #[fixture("tests/fixture/page/**/code.js")] fn fixture_page(input: PathBuf) { let output = input.with_file_name("output.js"); test_fixture( - Syntax::Es(EsConfig { + Syntax::Es(EsSyntax { jsx: true, ..Default::default() }), &|_| { - as_folder(transform_page(Config { - excluded: vec!["smth".to_string()], - ..Default::default() + visit_mut_pass(transform_page(Config { + router: Router::Page, })) }, &input, &output, - FixtureTestConfig { - ..Default::default() - }, + FixtureTestConfig::default(), ); } @@ -36,20 +33,17 @@ fn fixture_app(input: PathBuf) { let output = input.with_file_name("output.js"); test_fixture( - Syntax::Es(EsConfig { + Syntax::Es(EsSyntax { jsx: true, ..Default::default() }), &|_| { - as_folder(transform_app(Config { - excluded: vec!["smth".to_string()], - ..Default::default() + visit_mut_pass(transform_app(Config { + router: Router::App, })) }, &input, &output, - FixtureTestConfig { - ..Default::default() - }, + FixtureTestConfig::default(), ); } diff --git a/tests/fixture/page/skip/gip-in-app-js/output.js b/tests/fixture/page/skip/gip-in-app-js/output.js index 7e86bd2..c13d937 100644 --- a/tests/fixture/page/skip/gip-in-app-js/output.js +++ b/tests/fixture/page/skip/gip-in-app-js/output.js @@ -26,7 +26,7 @@ function _appGetInitialProps() { _appGetInitialProps = /** * `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization. * This allows for keeping state between navigation, custom error handling, injecting additional data. - */ _async_to_generator(function*({ Component , ctx }) { + */ _async_to_generator(function*({ Component, ctx }) { const pageProps = yield (0, _utils).loadGetInitialProps(Component, ctx); return { pageProps @@ -37,10 +37,10 @@ function _appGetInitialProps() { var _Component; class App extends (_Component = _react.default.Component) { render() { - const { Component , pageProps } = this.props; + const { Component, pageProps } = this.props; return /*#__PURE__*/ _react.default.createElement(Component, Object.assign({}, pageProps)); } } App.origGetInitialProps = appGetInitialProps; -App.getInitialProps = appGetInitialProps; -exports.default = App; \ No newline at end of file +App.getInitialProps = _withSuperJSONInitProps(appGetInitialProps, []); +exports.default = App; diff --git a/tests/fixture/page/transform/export-from/props/output.js b/tests/fixture/page/transform/export-from/props/output.js index d132196..ba52f4d 100644 --- a/tests/fixture/page/transform/export-from/props/output.js +++ b/tests/fixture/page/transform/export-from/props/output.js @@ -1,7 +1,5 @@ import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; import { foo as _NEXT_SUPERJSON_IMPORTED_PROPS } from 'source'; -const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, [ - "smth" -]); +const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, []); export { _NEXT_SUPERJSON_SSG_PROPS as getServerSideProps }; -export { default } from 'source'; \ No newline at end of file +export { default } from 'source'; diff --git a/tests/fixture/page/transform/general/arrow/output.js b/tests/fixture/page/transform/general/arrow/output.js index 60fc619..2af6dbe 100644 --- a/tests/fixture/page/transform/general/arrow/output.js +++ b/tests/fixture/page/transform/general/arrow/output.js @@ -1,8 +1,6 @@ import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; -export const getServerSideProps = _withSuperJSONProps(async () => {}, [ - "smth" -]); -export default _withSuperJSONPage(() => { +export const getServerSideProps = _withSuperJSONProps(async ()=>{}, []); +export default _withSuperJSONPage(()=>{ return <>; }); diff --git a/tests/fixture/page/transform/general/class/output.js b/tests/fixture/page/transform/general/class/output.js index 22fc24c..0f71f9e 100644 --- a/tests/fixture/page/transform/general/class/output.js +++ b/tests/fixture/page/transform/general/class/output.js @@ -1,8 +1,6 @@ import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; -export const getServerSideProps = _withSuperJSONProps(async function() {}, [ - "smth" -]); +export const getServerSideProps = _withSuperJSONProps(async function() {}, []); class Page { render() { return <>; diff --git a/tests/fixture/page/transform/general/function/output.js b/tests/fixture/page/transform/general/function/output.js index 83bc4d1..7454290 100644 --- a/tests/fixture/page/transform/general/function/output.js +++ b/tests/fixture/page/transform/general/function/output.js @@ -1,9 +1,7 @@ import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; -export const getServerSideProps = _withSuperJSONProps(async function () {}, [ - "smth", -]); +export const getServerSideProps = _withSuperJSONProps(async function() {}, []); function Page() { - return <>; + return <>; } export default _withSuperJSONPage(Page); diff --git a/tests/fixture/page/transform/get-initial-props/class/output.js b/tests/fixture/page/transform/get-initial-props/class/output.js index 9897640..7f9f192 100644 --- a/tests/fixture/page/transform/get-initial-props/class/output.js +++ b/tests/fixture/page/transform/get-initial-props/class/output.js @@ -1,17 +1,16 @@ import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; import { withSuperJSONInitProps as _withSuperJSONInitProps } from "next-superjson-plugin/tools"; -import React from 'react' - +import React from 'react'; class Page extends React.Component { - static getInitialProps = _withSuperJSONInitProps(async function(ctx) { - const res = await fetch('https://api.github.com/repos/vercel/next.js') - const json = await res.json() - return { stars: json.stargazers_count } - }, ["smth"]) - - render() { - return
Next stars: {this.props.stars}
- } + static getInitialProps = _withSuperJSONInitProps(async function(ctx) { + const res = await fetch('https://api.github.com/repos/vercel/next.js'); + const json = await res.json(); + return { + stars: json.stargazers_count + }; + }, []); + render() { + return
Next stars: {this.props.stars}
; + } } - -export default _withSuperJSONPage(Page) \ No newline at end of file +export default _withSuperJSONPage(Page); diff --git a/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js b/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js index a9dec44..e2572bf 100644 --- a/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js +++ b/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js @@ -1,14 +1,11 @@ import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; import { withSuperJSONInitProps as _withSuperJSONInitProps } from "next-superjson-plugin/tools"; - function Page({ date }) { - return
{date.getDate()}
+ return
{date.getDate()}
; } - -Page.getInitialProps = _withSuperJSONInitProps(() => { - return { - date: new Date() - } -}, ["smth"]); - -export default _withSuperJSONPage(Page); \ No newline at end of file +Page.getInitialProps = _withSuperJSONInitProps(()=>{ + return { + date: new Date() + }; +}, []); +export default _withSuperJSONPage(Page); diff --git a/tests/fixture/page/transform/get-initial-props/function/output.js b/tests/fixture/page/transform/get-initial-props/function/output.js index f7b0987..5f9b61b 100644 --- a/tests/fixture/page/transform/get-initial-props/function/output.js +++ b/tests/fixture/page/transform/get-initial-props/function/output.js @@ -1,14 +1,13 @@ import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; import { withSuperJSONInitProps as _withSuperJSONInitProps } from "next-superjson-plugin/tools"; - function Page({ stars }) { - return
Next stars: {stars}
+ return
Next stars: {stars}
; } - -Page.getInitialProps = _withSuperJSONInitProps(async (ctx) => { - const res = await fetch('https://api.github.com/repos/vercel/next.js') - const json = await res.json() - return { stars: json.stargazers_count } -}, ["smth"]) - -export default _withSuperJSONPage(Page) \ No newline at end of file +Page.getInitialProps = _withSuperJSONInitProps(async (ctx)=>{ + const res = await fetch('https://api.github.com/repos/vercel/next.js'); + const json = await res.json(); + return { + stars: json.stargazers_count + }; +}, []); +export default _withSuperJSONPage(Page); diff --git a/tests/fixture/page/transform/get-static-props-with-paths/output.js b/tests/fixture/page/transform/get-static-props-with-paths/output.js index 1cbbfe3..19da928 100644 --- a/tests/fixture/page/transform/get-static-props-with-paths/output.js +++ b/tests/fixture/page/transform/get-static-props-with-paths/output.js @@ -1,7 +1,7 @@ import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; -export const getStaticProps = _withSuperJSONProps(() => {}, ["smth"]); -export const getStaticPaths = () => {}; -export default _withSuperJSONPage(() => { - return <>; +export const getStaticProps = _withSuperJSONProps(()=>{}, []); +export const getStaticPaths = ()=>{}; +export default _withSuperJSONPage(()=>{ + return <>; }); diff --git a/tests/fixture/page/transform/import-export/output.js b/tests/fixture/page/transform/import-export/output.js index 8c92b94..add7012 100644 --- a/tests/fixture/page/transform/import-export/output.js +++ b/tests/fixture/page/transform/import-export/output.js @@ -1,8 +1,6 @@ import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; import { foo as _NEXT_SUPERJSON_IMPORTED_PROPS, default as Page } from 'source'; -const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, [ - "smth" -]); +const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, []); export { _NEXT_SUPERJSON_SSG_PROPS as getServerSideProps }; -export default _withSuperJSONPage(Page); \ No newline at end of file +export default _withSuperJSONPage(Page); diff --git a/tests/fixture/page/transform/mutable/output.js b/tests/fixture/page/transform/mutable/output.js index 759e5c8..f5d3dd7 100644 --- a/tests/fixture/page/transform/mutable/output.js +++ b/tests/fixture/page/transform/mutable/output.js @@ -3,5 +3,5 @@ import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin let foo = 1; foo = 2; export { foo as getServerSideProps }; -foo = _withSuperJSONProps(() => {}, ["smth"]); -export default _withSuperJSONPage(() => {}); +foo = _withSuperJSONProps(()=>{}, []); +export default _withSuperJSONPage(()=>{}); diff --git a/yarn.lock b/yarn.lock index d71b8cc..5882505 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,83 +2,6 @@ # yarn lockfile v1 -"@next/env@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/env/-/env-13.0.3.tgz#f2ecec9a6634aed28dca9e7b79bd65d9c516a1b4" - integrity sha512-/4WzeG61Ot/PxsghXkSqQJ6UohFfwXoZ3dtsypmR9EBP+OIax9JRq0trq8Z/LCT9Aq4JbihVkaazRWguORjTAw== - -"@next/swc-android-arm-eabi@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.3.tgz#87ce3b7d81ec198f5360f4393e5e03f112758696" - integrity sha512-uxfUoj65CdFc1gX2q7GtBX3DhKv9Kn343LMqGNvXyuTpYTGMmIiVY7b9yF8oLWRV0gVKqhZBZifUmoPE8SJU6Q== - -"@next/swc-android-arm64@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-13.0.3.tgz#2029f759cb3e85082da15ced94704a68e390a0e9" - integrity sha512-t2k+WDfg7Cq2z/EnalKGsd/9E5F4Hdo1xu+UzZXYDpKUI9zgE6Bz8ajQb8m8txv3qOaWdKuDa5j5ziq9Acd1Xw== - -"@next/swc-darwin-arm64@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.3.tgz#f5deafd3feccf7c24b81df9a6a06d4d13bec254f" - integrity sha512-wV6j6SZ1bc/YHOLCLk9JVqaZTCCey6HBV7inl2DriHsHqIcO6F3+QiYf0KXwRP9BE0GSZZrYd5mZQm2JPTHdJA== - -"@next/swc-darwin-x64@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.3.tgz#4d4321c02b88fdd052e7a0cc8b3719ac16f8ad4b" - integrity sha512-jaI2CMuYWvUtRixV3AIjUhnxUDU1FKOR+8hADMhYt3Yz+pCKuj4RZ0n0nY5qUf3qT1AtvnJXEgyatSFJhSp/wQ== - -"@next/swc-freebsd-x64@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.3.tgz#f2cbac9dc03172ef94275a6380cdd4d08024fcd4" - integrity sha512-nbyT0toBTJrcj5TCB9pVnQpGJ3utGyQj4CWegZs1ulaeUQ5Z7CS/qt8nRyYyOKYHtOdSCJ9Nw5F/RgKNkdpOdw== - -"@next/swc-linux-arm-gnueabihf@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.3.tgz#1b12006a25518ddc6ee9c58852149f82639876cf" - integrity sha512-1naLxYvRUQCoFCU1nMkcQueRc0Iux9xBv1L5pzH2ejtIWFg8BrSgyuluJG4nyAhFCx4WG863IEIkAaefOowVdA== - -"@next/swc-linux-arm64-gnu@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.3.tgz#f44a34fc073b91ad2ab7dd757c063e764e642ddc" - integrity sha512-3Z4A8JkuGWpMVbUhUPQInK/SLY+kijTT78Q/NZCrhLlyvwrVxaQALJNlXzxDLraUgv4oVH0Wz/FIw1W9PUUhxA== - -"@next/swc-linux-arm64-musl@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.3.tgz#5fd31e1149f151393b98239b5a6a96316459d19a" - integrity sha512-MoYe9SM40UaunTjC+01c9OILLH3uSoeri58kDMu3KF/EFEvn1LZ6ODeDj+SLGlAc95wn46hrRJS2BPmDDE+jFQ== - -"@next/swc-linux-x64-gnu@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.3.tgz#a9b414123f26912fc830e5a65dd02e1ca56e2ead" - integrity sha512-z22T5WGnRanjLMXdF0NaNjSpBlEzzY43t5Ysp3nW1oI6gOkub6WdQNZeHIY7A2JwkgSWZmtjLtf+Fzzz38LHeQ== - -"@next/swc-linux-x64-musl@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.3.tgz#113f896de5e818ab40e6ec046538203cdd07dab0" - integrity sha512-ZOMT7zjBFmkusAtr47k8xs/oTLsNlTH6xvYb+iux7yly2hZGwhfBLzPGBsbeMZukZ96IphJTagT+C033s6LNVA== - -"@next/swc-win32-arm64-msvc@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.3.tgz#2ae5abe61f982a10f7742e97ac57f166751734aa" - integrity sha512-Q4BM16Djl+Oah9UdGrvjFYgoftYB2jNd+rtRGPX5Mmxo09Ry/KiLbOZnoUyoIxKc1xPyfqMXuaVsAFQLYs0KEQ== - -"@next/swc-win32-ia32-msvc@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.3.tgz#1a9c0d36c7dab1620257e85ada702c5acd9875d6" - integrity sha512-Sa8yGkNeRUsic8Qjf7MLIAfP0p0+einK/wIqJ8UO1y76j+8rRQu42AMs5H4Ax1fm9GEYq6I8njHtY59TVpTtGQ== - -"@next/swc-win32-x64-msvc@13.0.3": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.3.tgz#7db0adbea7b4aafdbe2a7745d2c7c048903876ad" - integrity sha512-IAptmSqA7k4tQzaw2NAkoEjj3+Dz9ceuvlEHwYh770MMDL4V0ku2m+UHrmn5HUCEDHhgwwjg2nyf6728q2jr1w== - -"@swc/helpers@0.4.11": - version "0.4.11" - resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.11.tgz#db23a376761b3d31c26502122f349a21b592c8de" - integrity sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw== - dependencies: - tslib "^2.4.0" - "@types/hoist-non-react-statics@^3.3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" @@ -101,6 +24,14 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@18.3.1": + version "18.3.1" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.1.tgz#fed43985caa834a2084d002e4771e15dfcbdbe8e" + integrity sha512-V0kuGBX3+prX+DQ/7r2qsv1NsdfnCLnTgnRJ1pYnxykBhGMz+qj+box5lq7XsO5mtZsBqpjwwTu/7wszPfMBcw== + dependencies: + "@types/prop-types" "*" + csstype "^3.0.2" + "@types/scheduler@*": version "0.16.2" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" @@ -155,11 +86,6 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" -caniuse-lite@^1.0.30001406: - version "1.0.30001431" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz#e7c59bd1bc518fae03a4656be442ce6c4887a795" - integrity sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ== - clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -188,11 +114,6 @@ cli-truncate@^3.1.0: slice-ansi "^5.0.0" string-width "^5.0.0" -client-only@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" - integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -413,37 +334,6 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nanoid@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" - integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== - -next@^13: - version "13.0.3" - resolved "https://registry.yarnpkg.com/next/-/next-13.0.3.tgz#577e2f7cdd9c9dba79353cd57fd854fe7e506a44" - integrity sha512-rFQeepcenRxKzeKlh1CsmEnxsJwhIERtbUjmYnKZyDInZsU06lvaGw5DT44rlNp1Rv2MT/e9vffZ8vK+ytwXHA== - dependencies: - "@next/env" "13.0.3" - "@swc/helpers" "0.4.11" - caniuse-lite "^1.0.30001406" - postcss "8.4.14" - styled-jsx "5.1.0" - use-sync-external-store "1.2.0" - optionalDependencies: - "@next/swc-android-arm-eabi" "13.0.3" - "@next/swc-android-arm64" "13.0.3" - "@next/swc-darwin-arm64" "13.0.3" - "@next/swc-darwin-x64" "13.0.3" - "@next/swc-freebsd-x64" "13.0.3" - "@next/swc-linux-arm-gnueabihf" "13.0.3" - "@next/swc-linux-arm64-gnu" "13.0.3" - "@next/swc-linux-arm64-musl" "13.0.3" - "@next/swc-linux-x64-gnu" "13.0.3" - "@next/swc-linux-x64-musl" "13.0.3" - "@next/swc-win32-arm64-msvc" "13.0.3" - "@next/swc-win32-ia32-msvc" "13.0.3" - "@next/swc-win32-x64-msvc" "13.0.3" - normalize-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -492,11 +382,6 @@ path-key@^4.0.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -507,15 +392,6 @@ pidtree@^0.6.0: resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== -postcss@8.4.14: - version "8.4.14" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" - integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - prettier@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" @@ -589,11 +465,6 @@ slice-ansi@^5.0.0: ansi-styles "^6.0.0" is-fullwidth-code-point "^4.0.0" -source-map-js@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - string-argv@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" @@ -636,13 +507,6 @@ strip-final-newline@^3.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== -styled-jsx@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.0.tgz#4a5622ab9714bd3fcfaeec292aa555871f057563" - integrity sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ== - dependencies: - client-only "0.0.1" - superjson@^2: version "2.2.1" resolved "https://registry.yarnpkg.com/superjson/-/superjson-2.2.1.tgz#9377a7fa80fedb10c851c9dbffd942d4bcf79733" @@ -667,11 +531,6 @@ tslib@^2.1.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== -tslib@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" @@ -682,11 +541,6 @@ typescript@^5.3.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== -use-sync-external-store@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" - integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== - which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" From 3021153cf0b4d0a14000b86e49aaf244411e37a3 Mon Sep 17 00:00:00 2001 From: serg-and Date: Fri, 28 Mar 2025 13:11:51 +0100 Subject: [PATCH 05/10] change package and repository name --- Cargo.lock | 2 +- Cargo.toml | 6 +- README.md | 12 +- package.json | 18 +- src/app.rs | 4 +- src/lib.rs | 8 +- src/page.rs | 6 +- src/utils.rs | 2 +- tests/fixture/app/children/output.js | 4 +- tests/fixture/app/general/output.js | 4 +- tests/fixture/app/member/output.js | 4 +- .../page/transform/export-from/page/output.js | 2 +- .../transform/export-from/props/output.js | 2 +- .../page/transform/general/arrow/output.js | 4 +- .../page/transform/general/class/output.js | 4 +- .../page/transform/general/function/output.js | 4 +- .../get-initial-props/class/output.js | 4 +- .../function-export-page-first/output.js | 4 +- .../get-initial-props/function/output.js | 4 +- .../get-static-props-with-paths/output.js | 4 +- .../page/transform/import-export/output.js | 4 +- .../fixture/page/transform/mutable/output.js | 4 +- yarn.lock | 335 +++++++++++++++++- 23 files changed, 385 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5314eea..47dc688 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -940,7 +940,7 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "next_superjson" -version = "0.6.3" +version = "0.7.0" dependencies = [ "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 9951385..b93476c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "next_superjson" -version = "0.6.3" +version = "0.7.0" edition = "2021" -authors = ["JH.Lee "] +authors = ["https://github.com/serg-and"] description = "SWC Plugin of SuperJSON for Next.js" license = "MIT/Apache-2.0" -repository = "https://github.com/orionmiz/next-superjson-plugin" +repository = "https://github.com/serg-and/superjson-next" [lib] crate-type = ["cdylib", "rlib"] diff --git a/README.md b/README.md index 3946a73..adff3d7 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ export default function ServerComponent() { Install packages first: ```sh -npm install superjson next-superjson-plugin +npm install superjson superjson-next # or Yarn -yarn add superjson next-superjson-plugin +yarn add superjson superjson-next ``` Add the plugin into `next.config.js` @@ -50,7 +50,7 @@ Add the plugin into `next.config.js` // next.config.js module.exports = { experimental: { - swcPlugins: [["next-superjson-plugin", {}]], + swcPlugins: [["superjson-next", {}]], }, }; ``` @@ -60,7 +60,7 @@ module.exports = { You can use the `excluded` option to exclude specific properties from serialization. ```js -['next-superjson-plugin', { excluded: ["someProp"] }], +['superjson-next', { excluded: ["someProp"] }], ``` #### With pages router @@ -69,7 +69,7 @@ There is currently an issue in `Next@15`, to use this plugin with pages router a This will make the plugin only work inside the page router and is thus not compatible with projects using both routers. ```js -['next-superjson-plugin', { forcePageRouter: true }], +['superjson-next', { forcePageRouter: true }], ``` ## How it works @@ -96,7 +96,7 @@ sequenceDiagram Plugin always ensures compatibility with [Next.js Canary version](https://nextjs.org/docs/messages/opening-an-issue) only. -[Leave an Issue](https://github.com/orionmiz/next-superjson-plugin/issues) +[Leave an Issue](https://github.com/serg-and/superjson-next.git/issues) ## Special Thanks diff --git a/package.json b/package.json index 8ed81ae..a0292af 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,15 @@ { - "name": "next-superjson-plugin", - "version": "0.6.3", + "name": "superjson-next", + "version": "0.7.0", "description": "Automatically transform your Next.js Pages to use SuperJSON with SWC", - "author": "JH.Lee ", - "homepage": "https://github.com/blitz-js/next-superjson-plugin#readme", + "author": "https://github.com/serg-and", + "homepage": "https://github.com/serg-and/superjson-next#readme", "repository": { "type": "git", - "url": "https://github.com/blitz-js/next-superjson-plugin.git" + "url": "https://github.com/serg-and/superjson-next.git" }, "bugs": { - "url": "https://github.com/blitz-js/next-superjson-plugin/issues", - "email": "contact@jins.dev" + "url": "https://github.com/serg-and/superjson-next/issues" }, "license": "MIT", "keywords": [ @@ -39,7 +38,8 @@ "hoist-non-react-statics": "^3.3.2" }, "devDependencies": { - "@types/hoist-non-react-statics": "^3.3.1", + "next": "^15.2", + "@types/hoist-non-react-statics": "^3.3.2", "@types/react": "18.3.1", "husky": "^8.0.2", "lint-staged": "^13.0.3", @@ -55,4 +55,4 @@ "prettier --write" ] } -} +} \ No newline at end of file diff --git a/src/app.rs b/src/app.rs index 519b284..ef0b175 100644 --- a/src/app.rs +++ b/src/app.rs @@ -16,8 +16,8 @@ static SERIALIZER_FUNCTION: &str = "serialize"; static DESERIALIZER_COMPONENT: &str = "SuperJSONComponent"; static DESERIALIZER_PROPS_ATTR: &str = "props"; static DESERIALIZER_PROPS_COMPONENT: &str = "component"; -static TOOLS_SRC: &str = "next-superjson-plugin/tools"; -static CLIENT_SRC: &str = "next-superjson-plugin/client"; +static TOOLS_SRC: &str = "superjson-next/tools"; +static CLIENT_SRC: &str = "superjson-next/client"; struct AppTransformer { transformed: bool, diff --git a/src/lib.rs b/src/lib.rs index 40c98af..ea0b6dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,22 +11,22 @@ pub mod app; pub mod page; mod utils; -static MISSING_CONFIG: &str = "next-superjson-plugin: Missing config, +static MISSING_CONFIG: &str = "superjson-next: Missing config, Provide a plugin config in your next.config.(js|ts) like: experimental: { swcPlugins: [ - ['next-superjson-plugin', { router: 'APP' | 'PAGE' }] + ['superjson-next', { router: 'APP' | 'PAGE' }] ], }, "; -static BAD_CONFIG: &str = "next-superjson-plugin: Failed to parse config, +static BAD_CONFIG: &str = "superjson-next: Failed to parse config, Provide a plugin config in your next.config.(js|ts) like: experimental: { swcPlugins: [ - ['next-superjson-plugin', { router: 'APP' | 'PAGE' }] + ['superjson-next', { router: 'APP' | 'PAGE' }] ], }, "; diff --git a/src/page.rs b/src/page.rs index ed2d1f0..00a234f 100644 --- a/src/page.rs +++ b/src/page.rs @@ -14,15 +14,15 @@ use crate::{utils::*, Config}; static SSG_EXPORTS: &[&str; 2] = &["getStaticProps", "getServerSideProps"]; static INITIAL_PROPS: &str = "getInitialProps"; -// import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; +// import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; static SUPERJSON_PROPS_IMPORTED: &str = "withSuperJSONProps"; pub static SUPERJSON_PROPS_LOCAL: &str = "_withSuperJSONProps"; -// import { withSuperJSONInitProps as _withSuperJSONInitProps } from "next-superjson-plugin/tools"; +// import { withSuperJSONInitProps as _withSuperJSONInitProps } from "superjson-next/tools"; static SUPERJSON_INIT_PROPS_IMPORTED: &str = "withSuperJSONInitProps"; pub static SUPERJSON_INIT_PROPS_LOCAL: &str = "_withSuperJSONInitProps"; -// import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; +// import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; static SUPERJSON_PAGE_IMPORTED: &str = "withSuperJSONPage"; pub static SUPERJSON_PAGE_LOCAL: &str = "_withSuperJSONPage"; diff --git a/src/utils.rs b/src/utils.rs index b05e06c..096020b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -25,7 +25,7 @@ pub fn superjson_import_decl(superjson_import_name: &str) -> ModuleItem { })], src: Box::new(Str { span: DUMMY_SP, - value: "next-superjson-plugin/tools".into(), + value: "superjson-next/tools".into(), raw: None, }), })) diff --git a/tests/fixture/app/children/output.js b/tests/fixture/app/children/output.js index aa6e4dd..3a27f07 100644 --- a/tests/fixture/app/children/output.js +++ b/tests/fixture/app/children/output.js @@ -1,5 +1,5 @@ -import { serialize } from "next-superjson-plugin/tools"; -import SuperJSONComponent from "next-superjson-plugin/client"; +import { serialize } from "superjson-next/tools"; +import SuperJSONComponent from "superjson-next/client"; import ClientComponent from "./ClientComponent"; export default function Page() { const rest = {}; diff --git a/tests/fixture/app/general/output.js b/tests/fixture/app/general/output.js index 16e046c..99093b4 100644 --- a/tests/fixture/app/general/output.js +++ b/tests/fixture/app/general/output.js @@ -1,5 +1,5 @@ -import { serialize } from "next-superjson-plugin/tools"; -import SuperJSONComponent from "next-superjson-plugin/client"; +import { serialize } from "superjson-next/tools"; +import SuperJSONComponent from "superjson-next/client"; import ServerComponent from "./ServerComponent"; import ClientComponent from "./ClientComponent"; diff --git a/tests/fixture/app/member/output.js b/tests/fixture/app/member/output.js index 8f36f1b..52a4058 100644 --- a/tests/fixture/app/member/output.js +++ b/tests/fixture/app/member/output.js @@ -1,5 +1,5 @@ -import { serialize } from "next-superjson-plugin/tools"; -import SuperJSONComponent from "next-superjson-plugin/client"; +import { serialize } from "superjson-next/tools"; +import SuperJSONComponent from "superjson-next/client"; import ServerComponent from "./ServerComponent"; import Client from "./Client"; diff --git a/tests/fixture/page/transform/export-from/page/output.js b/tests/fixture/page/transform/export-from/page/output.js index c57284f..cf67a70 100644 --- a/tests/fixture/page/transform/export-from/page/output.js +++ b/tests/fixture/page/transform/export-from/page/output.js @@ -1,4 +1,4 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; import { foo as _NEXT_SUPERJSON_IMPORTED_PAGE } from 'source'; export { getServerSideProps } from 'source'; export default _withSuperJSONPage(_NEXT_SUPERJSON_IMPORTED_PAGE); \ No newline at end of file diff --git a/tests/fixture/page/transform/export-from/props/output.js b/tests/fixture/page/transform/export-from/props/output.js index ba52f4d..dc0444f 100644 --- a/tests/fixture/page/transform/export-from/props/output.js +++ b/tests/fixture/page/transform/export-from/props/output.js @@ -1,4 +1,4 @@ -import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; +import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; import { foo as _NEXT_SUPERJSON_IMPORTED_PROPS } from 'source'; const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, []); export { _NEXT_SUPERJSON_SSG_PROPS as getServerSideProps }; diff --git a/tests/fixture/page/transform/general/arrow/output.js b/tests/fixture/page/transform/general/arrow/output.js index 2af6dbe..0234433 100644 --- a/tests/fixture/page/transform/general/arrow/output.js +++ b/tests/fixture/page/transform/general/arrow/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; +import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; export const getServerSideProps = _withSuperJSONProps(async ()=>{}, []); export default _withSuperJSONPage(()=>{ return <>; diff --git a/tests/fixture/page/transform/general/class/output.js b/tests/fixture/page/transform/general/class/output.js index 0f71f9e..0c7b8d2 100644 --- a/tests/fixture/page/transform/general/class/output.js +++ b/tests/fixture/page/transform/general/class/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; +import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; export const getServerSideProps = _withSuperJSONProps(async function() {}, []); class Page { render() { diff --git a/tests/fixture/page/transform/general/function/output.js b/tests/fixture/page/transform/general/function/output.js index 7454290..297b274 100644 --- a/tests/fixture/page/transform/general/function/output.js +++ b/tests/fixture/page/transform/general/function/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; +import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next; export const getServerSideProps = _withSuperJSONProps(async function() {}, []); function Page() { return <>; diff --git a/tests/fixture/page/transform/get-initial-props/class/output.js b/tests/fixture/page/transform/get-initial-props/class/output.js index 7f9f192..b9ee53a 100644 --- a/tests/fixture/page/transform/get-initial-props/class/output.js +++ b/tests/fixture/page/transform/get-initial-props/class/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONInitProps as _withSuperJSONInitProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next"; +import { withSuperJSONInitProps as _withSuperJSONInitProps } from "superjson-next/tools"; import React from 'react'; class Page extends React.Component { static getInitialProps = _withSuperJSONInitProps(async function(ctx) { diff --git a/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js b/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js index e2572bf..e5b3bf9 100644 --- a/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js +++ b/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONInitProps as _withSuperJSONInitProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; +import { withSuperJSONInitProps as _withSuperJSONInitProps } from "superjson-next/tools"; function Page({ date }) { return
{date.getDate()}
; } diff --git a/tests/fixture/page/transform/get-initial-props/function/output.js b/tests/fixture/page/transform/get-initial-props/function/output.js index 5f9b61b..6ef0a59 100644 --- a/tests/fixture/page/transform/get-initial-props/function/output.js +++ b/tests/fixture/page/transform/get-initial-props/function/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONInitProps as _withSuperJSONInitProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; +import { withSuperJSONInitProps as _withSuperJSONInitProps } from "superjson-next/tools"; function Page({ stars }) { return
Next stars: {stars}
; } diff --git a/tests/fixture/page/transform/get-static-props-with-paths/output.js b/tests/fixture/page/transform/get-static-props-with-paths/output.js index 19da928..8212e79 100644 --- a/tests/fixture/page/transform/get-static-props-with-paths/output.js +++ b/tests/fixture/page/transform/get-static-props-with-paths/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; +import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; export const getStaticProps = _withSuperJSONProps(()=>{}, []); export const getStaticPaths = ()=>{}; export default _withSuperJSONPage(()=>{ diff --git a/tests/fixture/page/transform/import-export/output.js b/tests/fixture/page/transform/import-export/output.js index add7012..8e27b62 100644 --- a/tests/fixture/page/transform/import-export/output.js +++ b/tests/fixture/page/transform/import-export/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; +import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; import { foo as _NEXT_SUPERJSON_IMPORTED_PROPS, default as Page } from 'source'; const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, []); export { _NEXT_SUPERJSON_SSG_PROPS as getServerSideProps }; diff --git a/tests/fixture/page/transform/mutable/output.js b/tests/fixture/page/transform/mutable/output.js index f5d3dd7..13904ff 100644 --- a/tests/fixture/page/transform/mutable/output.js +++ b/tests/fixture/page/transform/mutable/output.js @@ -1,5 +1,5 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "next-superjson-plugin/tools"; -import { withSuperJSONProps as _withSuperJSONProps } from "next-superjson-plugin/tools"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; +import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; let foo = 1; foo = 2; export { foo as getServerSideProps }; diff --git a/yarn.lock b/yarn.lock index 5882505..b155a71 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,187 @@ # yarn lockfile v1 -"@types/hoist-non-react-statics@^3.3.1": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" - integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA== +"@emnapi/runtime@^1.2.0": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.3.1.tgz#0fcaa575afc31f455fd33534c19381cfce6c6f60" + integrity sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw== + dependencies: + tslib "^2.4.0" + +"@img/sharp-darwin-arm64@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz#ef5b5a07862805f1e8145a377c8ba6e98813ca08" + integrity sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ== + optionalDependencies: + "@img/sharp-libvips-darwin-arm64" "1.0.4" + +"@img/sharp-darwin-x64@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz#e03d3451cd9e664faa72948cc70a403ea4063d61" + integrity sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q== + optionalDependencies: + "@img/sharp-libvips-darwin-x64" "1.0.4" + +"@img/sharp-libvips-darwin-arm64@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz#447c5026700c01a993c7804eb8af5f6e9868c07f" + integrity sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg== + +"@img/sharp-libvips-darwin-x64@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz#e0456f8f7c623f9dbfbdc77383caa72281d86062" + integrity sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ== + +"@img/sharp-libvips-linux-arm64@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz#979b1c66c9a91f7ff2893556ef267f90ebe51704" + integrity sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA== + +"@img/sharp-libvips-linux-arm@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz#99f922d4e15216ec205dcb6891b721bfd2884197" + integrity sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g== + +"@img/sharp-libvips-linux-s390x@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz#f8a5eb1f374a082f72b3f45e2fb25b8118a8a5ce" + integrity sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA== + +"@img/sharp-libvips-linux-x64@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz#d4c4619cdd157774906e15770ee119931c7ef5e0" + integrity sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw== + +"@img/sharp-libvips-linuxmusl-arm64@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz#166778da0f48dd2bded1fa3033cee6b588f0d5d5" + integrity sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA== + +"@img/sharp-libvips-linuxmusl-x64@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz#93794e4d7720b077fcad3e02982f2f1c246751ff" + integrity sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw== + +"@img/sharp-linux-arm64@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz#edb0697e7a8279c9fc829a60fc35644c4839bb22" + integrity sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA== + optionalDependencies: + "@img/sharp-libvips-linux-arm64" "1.0.4" + +"@img/sharp-linux-arm@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz#422c1a352e7b5832842577dc51602bcd5b6f5eff" + integrity sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ== + optionalDependencies: + "@img/sharp-libvips-linux-arm" "1.0.5" + +"@img/sharp-linux-s390x@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz#f5c077926b48e97e4a04d004dfaf175972059667" + integrity sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q== + optionalDependencies: + "@img/sharp-libvips-linux-s390x" "1.0.4" + +"@img/sharp-linux-x64@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz#d806e0afd71ae6775cc87f0da8f2d03a7c2209cb" + integrity sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA== + optionalDependencies: + "@img/sharp-libvips-linux-x64" "1.0.4" + +"@img/sharp-linuxmusl-arm64@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz#252975b915894fb315af5deea174651e208d3d6b" + integrity sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g== + optionalDependencies: + "@img/sharp-libvips-linuxmusl-arm64" "1.0.4" + +"@img/sharp-linuxmusl-x64@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz#3f4609ac5d8ef8ec7dadee80b560961a60fd4f48" + integrity sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw== + optionalDependencies: + "@img/sharp-libvips-linuxmusl-x64" "1.0.4" + +"@img/sharp-wasm32@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz#6f44f3283069d935bb5ca5813153572f3e6f61a1" + integrity sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg== + dependencies: + "@emnapi/runtime" "^1.2.0" + +"@img/sharp-win32-ia32@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz#1a0c839a40c5351e9885628c85f2e5dfd02b52a9" + integrity sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ== + +"@img/sharp-win32-x64@0.33.5": + version "0.33.5" + resolved "https://registry.yarnpkg.com/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz#56f00962ff0c4e0eb93d34a047d29fa995e3e342" + integrity sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg== + +"@next/env@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/env/-/env-15.2.4.tgz#060f8d8ddb02be5c825eab4ccd9ab619001efffb" + integrity sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g== + +"@next/swc-darwin-arm64@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz#3a54f67aa2e0096a9147bd24dff1492e151819ae" + integrity sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw== + +"@next/swc-darwin-x64@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz#9b540f24afde1b7878623fdba9695344d26b7d67" + integrity sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew== + +"@next/swc-linux-arm64-gnu@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz#417a234c9f4dc5495094a8979859ac528c0f1f58" + integrity sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ== + +"@next/swc-linux-arm64-musl@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz#9bca76375508a175956f2d51f8547d0d6f9ffa64" + integrity sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA== + +"@next/swc-linux-x64-gnu@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz#c3d5041d53a5b228bf521ed49649e0f2a7aff947" + integrity sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw== + +"@next/swc-linux-x64-musl@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz#b2a51a108b1c412c69a504556cde0517631768c7" + integrity sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw== + +"@next/swc-win32-arm64-msvc@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz#7d687b42512abd36f44c2c787d58a1590f174b69" + integrity sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg== + +"@next/swc-win32-x64-msvc@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz#779a0ea272fa4f509387f3b320e2d70803943a95" + integrity sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ== + +"@swc/counter@0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9" + integrity sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ== + +"@swc/helpers@0.5.15": + version "0.5.15" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.15.tgz#79efab344c5819ecf83a43f3f9f811fc84b516d7" + integrity sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g== + dependencies: + tslib "^2.8.0" + +"@types/hoist-non-react-statics@^3.3.2": + version "3.3.6" + resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.6.tgz#6bba74383cdab98e8db4e20ce5b4a6b98caed010" + integrity sha512-lPByRJUer/iN/xa4qpyL0qmL11DqNW81iU/IG1S3uvRUq4oKagz8VCxZjiWkumgt66YT3vOdDgZ0o32sGKtCEw== dependencies: "@types/react" "*" hoist-non-react-statics "^3.3.0" @@ -86,6 +263,18 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" +busboy@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + +caniuse-lite@^1.0.30001579: + version "1.0.30001707" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001707.tgz#c5e104d199e6f4355a898fcd995a066c7eb9bf41" + integrity sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw== + clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -114,6 +303,11 @@ cli-truncate@^3.1.0: slice-ansi "^5.0.0" string-width "^5.0.0" +client-only@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" + integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== + color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -121,11 +315,27 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@~1.1.4: +color-name@^1.0.0, color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-string@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" + integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== + dependencies: + color-name "^1.0.0" + simple-swizzle "^0.2.2" + +color@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/color/-/color-4.2.3.tgz#d781ecb5e57224ee43ea9627560107c0e0c6463a" + integrity sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A== + dependencies: + color-convert "^2.0.1" + color-string "^1.9.0" + colorette@^2.0.16, colorette@^2.0.17: version "2.0.19" resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" @@ -164,6 +374,11 @@ debug@^4.3.4: dependencies: ms "2.1.2" +detect-libc@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700" + integrity sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw== + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" @@ -228,6 +443,11 @@ indent-string@^4.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== +is-arrayish@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" + integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== + is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -334,6 +554,34 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +nanoid@^3.3.6: + version "3.3.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b" + integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== + +next@^15.2: + version "15.2.4" + resolved "https://registry.yarnpkg.com/next/-/next-15.2.4.tgz#e05225e9511df98e3b2edc713e17f4c970bff961" + integrity sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ== + dependencies: + "@next/env" "15.2.4" + "@swc/counter" "0.1.3" + "@swc/helpers" "0.5.15" + busboy "1.6.0" + caniuse-lite "^1.0.30001579" + postcss "8.4.31" + styled-jsx "5.1.6" + optionalDependencies: + "@next/swc-darwin-arm64" "15.2.4" + "@next/swc-darwin-x64" "15.2.4" + "@next/swc-linux-arm64-gnu" "15.2.4" + "@next/swc-linux-arm64-musl" "15.2.4" + "@next/swc-linux-x64-gnu" "15.2.4" + "@next/swc-linux-x64-musl" "15.2.4" + "@next/swc-win32-arm64-msvc" "15.2.4" + "@next/swc-win32-x64-msvc" "15.2.4" + sharp "^0.33.5" + normalize-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -382,6 +630,11 @@ path-key@^4.0.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== +picocolors@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -392,6 +645,15 @@ pidtree@^0.6.0: resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== +postcss@8.4.31: + version "8.4.31" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d" + integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== + dependencies: + nanoid "^3.3.6" + picocolors "^1.0.0" + source-map-js "^1.0.2" + prettier@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" @@ -422,6 +684,40 @@ rxjs@^7.5.5: dependencies: tslib "^2.1.0" +semver@^7.6.3: + version "7.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" + integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== + +sharp@^0.33.5: + version "0.33.5" + resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.33.5.tgz#13e0e4130cc309d6a9497596715240b2ec0c594e" + integrity sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw== + dependencies: + color "^4.2.3" + detect-libc "^2.0.3" + semver "^7.6.3" + optionalDependencies: + "@img/sharp-darwin-arm64" "0.33.5" + "@img/sharp-darwin-x64" "0.33.5" + "@img/sharp-libvips-darwin-arm64" "1.0.4" + "@img/sharp-libvips-darwin-x64" "1.0.4" + "@img/sharp-libvips-linux-arm" "1.0.5" + "@img/sharp-libvips-linux-arm64" "1.0.4" + "@img/sharp-libvips-linux-s390x" "1.0.4" + "@img/sharp-libvips-linux-x64" "1.0.4" + "@img/sharp-libvips-linuxmusl-arm64" "1.0.4" + "@img/sharp-libvips-linuxmusl-x64" "1.0.4" + "@img/sharp-linux-arm" "0.33.5" + "@img/sharp-linux-arm64" "0.33.5" + "@img/sharp-linux-s390x" "0.33.5" + "@img/sharp-linux-x64" "0.33.5" + "@img/sharp-linuxmusl-arm64" "0.33.5" + "@img/sharp-linuxmusl-x64" "0.33.5" + "@img/sharp-wasm32" "0.33.5" + "@img/sharp-win32-ia32" "0.33.5" + "@img/sharp-win32-x64" "0.33.5" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -439,6 +735,13 @@ signal-exit@^3.0.2, signal-exit@^3.0.7: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +simple-swizzle@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" + integrity sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg== + dependencies: + is-arrayish "^0.3.1" + slice-ansi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" @@ -465,6 +768,16 @@ slice-ansi@^5.0.0: ansi-styles "^6.0.0" is-fullwidth-code-point "^4.0.0" +source-map-js@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + string-argv@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" @@ -507,6 +820,13 @@ strip-final-newline@^3.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== +styled-jsx@5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.6.tgz#83b90c077e6c6a80f7f5e8781d0f311b2fe41499" + integrity sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA== + dependencies: + client-only "0.0.1" + superjson@^2: version "2.2.1" resolved "https://registry.yarnpkg.com/superjson/-/superjson-2.2.1.tgz#9377a7fa80fedb10c851c9dbffd942d4bcf79733" @@ -531,6 +851,11 @@ tslib@^2.1.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== +tslib@^2.4.0, tslib@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" From 76fa5d31843f0143d4241edfe588c4e3d46a65ce Mon Sep 17 00:00:00 2001 From: serg-and Date: Fri, 28 Mar 2025 13:46:51 +0100 Subject: [PATCH 06/10] re enable exclude config option --- README.md | 63 ++++++++++--------- src/lib.rs | 43 +++++++++---- src/page.rs | 5 +- tests/fixture.rs | 2 + .../fixture/page/skip/gip-in-app-js/output.js | 4 +- .../transform/export-from/props/output.js | 4 +- .../page/transform/general/arrow/output.js | 4 +- .../page/transform/general/class/output.js | 4 +- .../page/transform/general/function/output.js | 6 +- .../get-initial-props/class/output.js | 6 +- .../function-export-page-first/output.js | 4 +- .../get-initial-props/function/output.js | 4 +- .../get-static-props-with-paths/output.js | 4 +- .../page/transform/import-export/output.js | 4 +- .../fixture/page/transform/mutable/output.js | 4 +- 15 files changed, 101 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index adff3d7..ac782d9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,40 @@ +> [!NOTE] +> This is a fork of [next-superjson-plugin](https://github.com/blitz-js/next-superjson-plugin) that adds support for the latest versions of [Next.js](https://github.com/vercel/next.js). + +
+

Next SuperJSON Plugin

🔌 SuperJSON Plugin for Next.js (SWC)

+## Usage + +Install packages first: + +```sh +npm install superjson superjson-next +# or Yarn +yarn add superjson superjson-next +``` + +> [!IMPORTANT] +> Because of a bug in Next.js (see [#72019](https://github.com/vercel/next.js/issues/72019)), this plugin can only run in either app router or page router mode. + +Add the plugin into `next.config.js`. And select the type of [Router](https://nextjs.org/docs#app-router-vs-pages-router) you are using. + +```js +// next.config.js +module.exports = { + experimental: { + swcPlugins: [["superjson-next", { router: "APP" | "PAGE" }]], + }, +}; +``` + ### /pages (Pages Directory) ```jsx +// For pages router no further configuration is required. + export default function Page({ date }) { return
Today is {date.toDateString()}
; } @@ -34,42 +65,12 @@ export default function ServerComponent() { - Provides `data-superjson` attribute for [Server Component > Client Component Serialization](https://beta.nextjs.org/docs/rendering/server-and-client-components#passing-props-from-server-to-client-components-serialization). -## Usage - -Install packages first: - -```sh -npm install superjson superjson-next -# or Yarn -yarn add superjson superjson-next -``` - -Add the plugin into `next.config.js` - -```js -// next.config.js -module.exports = { - experimental: { - swcPlugins: [["superjson-next", {}]], - }, -}; -``` - ### Options You can use the `excluded` option to exclude specific properties from serialization. ```js -['superjson-next', { excluded: ["someProp"] }], -``` - -#### With pages router - -There is currently an issue in `Next@15`, to use this plugin with pages router add this option: -This will make the plugin only work inside the page router and is thus not compatible with projects using both routers. - -```js -['superjson-next', { forcePageRouter: true }], +["superjson-next", { router: "APP" | "PAGE", excluded: ["someProp"] }], ``` ## How it works diff --git a/src/lib.rs b/src/lib.rs index ea0b6dc..da425f2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,23 +12,41 @@ pub mod page; mod utils; static MISSING_CONFIG: &str = "superjson-next: Missing config, + Provide a plugin config in your next.config.(js|ts) like: -experimental: { - swcPlugins: [ - ['superjson-next', { router: 'APP' | 'PAGE' }] - ], -}, +module.exports = { + experimental: { + swcPlugins: [ + [ + 'superjson-next', + { + router: 'APP' | 'PAGE', + excluded: ['someProps'], (optional) + } + ] + ], + } +} "; static BAD_CONFIG: &str = "superjson-next: Failed to parse config, + Provide a plugin config in your next.config.(js|ts) like: -experimental: { - swcPlugins: [ - ['superjson-next', { router: 'APP' | 'PAGE' }] - ], -}, +module.exports = { + experimental: { + swcPlugins: [ + [ + 'superjson-next', + { + router: 'APP' | 'PAGE', + excluded: ['someProps'], (optional) + } + ] + ], + } +} "; #[derive(Debug, Clone, Deserialize)] @@ -44,9 +62,8 @@ pub enum Router { #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Config { pub router: Router, - // disabled because of Next.js bug, see below - // #[serde(default)] - // pub excluded: Vec, + #[serde(default)] + pub excluded: Vec, } // pub enum DirType { diff --git a/src/page.rs b/src/page.rs index 00a234f..214e0cd 100644 --- a/src/page.rs +++ b/src/page.rs @@ -63,10 +63,9 @@ struct PageTransformer { has_multiple_props: bool, } -pub fn transform_page(_: Config) -> impl VisitMut { +pub fn transform_page(config: Config) -> impl VisitMut { PageTransformer { - // excluded: config.excluded, - excluded: Default::default(), + excluded: config.excluded, props: Default::default(), page: Default::default(), diff --git a/tests/fixture.rs b/tests/fixture.rs index 6675edb..a0dd804 100644 --- a/tests/fixture.rs +++ b/tests/fixture.rs @@ -20,6 +20,7 @@ fn fixture_page(input: PathBuf) { &|_| { visit_mut_pass(transform_page(Config { router: Router::Page, + excluded: vec!["smth".to_string()], })) }, &input, @@ -40,6 +41,7 @@ fn fixture_app(input: PathBuf) { &|_| { visit_mut_pass(transform_app(Config { router: Router::App, + excluded: vec!["smth".to_string()], })) }, &input, diff --git a/tests/fixture/page/skip/gip-in-app-js/output.js b/tests/fixture/page/skip/gip-in-app-js/output.js index c13d937..8d81ef1 100644 --- a/tests/fixture/page/skip/gip-in-app-js/output.js +++ b/tests/fixture/page/skip/gip-in-app-js/output.js @@ -42,5 +42,7 @@ class App extends (_Component = _react.default.Component) { } } App.origGetInitialProps = appGetInitialProps; -App.getInitialProps = _withSuperJSONInitProps(appGetInitialProps, []); +App.getInitialProps = _withSuperJSONInitProps(appGetInitialProps, [ + "smth" +]); exports.default = App; diff --git a/tests/fixture/page/transform/export-from/props/output.js b/tests/fixture/page/transform/export-from/props/output.js index dc0444f..314cd0c 100644 --- a/tests/fixture/page/transform/export-from/props/output.js +++ b/tests/fixture/page/transform/export-from/props/output.js @@ -1,5 +1,7 @@ import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; import { foo as _NEXT_SUPERJSON_IMPORTED_PROPS } from 'source'; -const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, []); +const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, [ + "smth" +]); export { _NEXT_SUPERJSON_SSG_PROPS as getServerSideProps }; export { default } from 'source'; diff --git a/tests/fixture/page/transform/general/arrow/output.js b/tests/fixture/page/transform/general/arrow/output.js index 0234433..9bc585f 100644 --- a/tests/fixture/page/transform/general/arrow/output.js +++ b/tests/fixture/page/transform/general/arrow/output.js @@ -1,6 +1,8 @@ import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; -export const getServerSideProps = _withSuperJSONProps(async ()=>{}, []); +export const getServerSideProps = _withSuperJSONProps(async ()=>{}, [ + "smth" +]); export default _withSuperJSONPage(()=>{ return <>; }); diff --git a/tests/fixture/page/transform/general/class/output.js b/tests/fixture/page/transform/general/class/output.js index 0c7b8d2..ebf536e 100644 --- a/tests/fixture/page/transform/general/class/output.js +++ b/tests/fixture/page/transform/general/class/output.js @@ -1,6 +1,8 @@ import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; -export const getServerSideProps = _withSuperJSONProps(async function() {}, []); +export const getServerSideProps = _withSuperJSONProps(async function() {}, [ + "smth" +]); class Page { render() { return <>; diff --git a/tests/fixture/page/transform/general/function/output.js b/tests/fixture/page/transform/general/function/output.js index 297b274..d520a2e 100644 --- a/tests/fixture/page/transform/general/function/output.js +++ b/tests/fixture/page/transform/general/function/output.js @@ -1,6 +1,8 @@ import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; -import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next; -export const getServerSideProps = _withSuperJSONProps(async function() {}, []); +import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; +export const getServerSideProps = _withSuperJSONProps(async function() {}, [ + "smth" +]); function Page() { return <>; } diff --git a/tests/fixture/page/transform/get-initial-props/class/output.js b/tests/fixture/page/transform/get-initial-props/class/output.js index b9ee53a..a529f0b 100644 --- a/tests/fixture/page/transform/get-initial-props/class/output.js +++ b/tests/fixture/page/transform/get-initial-props/class/output.js @@ -1,4 +1,4 @@ -import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next"; +import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; import { withSuperJSONInitProps as _withSuperJSONInitProps } from "superjson-next/tools"; import React from 'react'; class Page extends React.Component { @@ -8,7 +8,9 @@ class Page extends React.Component { return { stars: json.stargazers_count }; - }, []); + }, [ + "smth" + ]); render() { return
Next stars: {this.props.stars}
; } diff --git a/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js b/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js index e5b3bf9..cd4a523 100644 --- a/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js +++ b/tests/fixture/page/transform/get-initial-props/function-export-page-first/output.js @@ -7,5 +7,7 @@ Page.getInitialProps = _withSuperJSONInitProps(()=>{ return { date: new Date() }; -}, []); +}, [ + "smth" +]); export default _withSuperJSONPage(Page); diff --git a/tests/fixture/page/transform/get-initial-props/function/output.js b/tests/fixture/page/transform/get-initial-props/function/output.js index 6ef0a59..017820e 100644 --- a/tests/fixture/page/transform/get-initial-props/function/output.js +++ b/tests/fixture/page/transform/get-initial-props/function/output.js @@ -9,5 +9,7 @@ Page.getInitialProps = _withSuperJSONInitProps(async (ctx)=>{ return { stars: json.stargazers_count }; -}, []); +}, [ + "smth" +]); export default _withSuperJSONPage(Page); diff --git a/tests/fixture/page/transform/get-static-props-with-paths/output.js b/tests/fixture/page/transform/get-static-props-with-paths/output.js index 8212e79..77d1b0f 100644 --- a/tests/fixture/page/transform/get-static-props-with-paths/output.js +++ b/tests/fixture/page/transform/get-static-props-with-paths/output.js @@ -1,6 +1,8 @@ import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; -export const getStaticProps = _withSuperJSONProps(()=>{}, []); +export const getStaticProps = _withSuperJSONProps(()=>{}, [ + "smth" +]); export const getStaticPaths = ()=>{}; export default _withSuperJSONPage(()=>{ return <>; diff --git a/tests/fixture/page/transform/import-export/output.js b/tests/fixture/page/transform/import-export/output.js index 8e27b62..7ab6e8f 100644 --- a/tests/fixture/page/transform/import-export/output.js +++ b/tests/fixture/page/transform/import-export/output.js @@ -1,6 +1,8 @@ import { withSuperJSONPage as _withSuperJSONPage } from "superjson-next/tools"; import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools"; import { foo as _NEXT_SUPERJSON_IMPORTED_PROPS, default as Page } from 'source'; -const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, []); +const _NEXT_SUPERJSON_SSG_PROPS = _withSuperJSONProps(_NEXT_SUPERJSON_IMPORTED_PROPS, [ + "smth" +]); export { _NEXT_SUPERJSON_SSG_PROPS as getServerSideProps }; export default _withSuperJSONPage(Page); diff --git a/tests/fixture/page/transform/mutable/output.js b/tests/fixture/page/transform/mutable/output.js index 13904ff..c52024c 100644 --- a/tests/fixture/page/transform/mutable/output.js +++ b/tests/fixture/page/transform/mutable/output.js @@ -3,5 +3,7 @@ import { withSuperJSONProps as _withSuperJSONProps } from "superjson-next/tools" let foo = 1; foo = 2; export { foo as getServerSideProps }; -foo = _withSuperJSONProps(()=>{}, []); +foo = _withSuperJSONProps(()=>{}, [ + "smth" +]); export default _withSuperJSONPage(()=>{}); From f74f0249048225e6e4fecd00b7488be2f4f0714c Mon Sep 17 00:00:00 2001 From: serg-and Date: Fri, 28 Mar 2025 13:51:34 +0100 Subject: [PATCH 07/10] 0.7.1 --- Cargo.lock | 2 +- Cargo.toml | 12 ++++++++++-- package.json | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 47dc688..99c5a02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -940,7 +940,7 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "next_superjson" -version = "0.7.0" +version = "0.7.1" dependencies = [ "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index b93476c..8463f9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "next_superjson" -version = "0.7.0" +version = "0.7.1" edition = "2021" authors = ["https://github.com/serg-and"] description = "SWC Plugin of SuperJSON for Next.js" @@ -13,7 +13,15 @@ crate-type = ["cdylib", "rlib"] [dependencies] serde = "1.0.144" serde_json = "1.0.85" -swc_core = { version = "16.10.*", features = ["ecma_plugin_transform", "ecma_ast", "ecma_utils", "ecma_visit", "ecma_transforms", "ecma_parser", "common"] } +swc_core = { version = "16.10.*", features = [ + "ecma_plugin_transform", + "ecma_ast", + "ecma_utils", + "ecma_visit", + "ecma_transforms", + "ecma_parser", + "common", +] } [dev-dependencies] testing = "0.33.11" diff --git a/package.json b/package.json index a0292af..580734d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superjson-next", - "version": "0.7.0", + "version": "0.7.1", "description": "Automatically transform your Next.js Pages to use SuperJSON with SWC", "author": "https://github.com/serg-and", "homepage": "https://github.com/serg-and/superjson-next#readme", From a51010793de3d0dfd0048786f349ef8715f3e4cc Mon Sep 17 00:00:00 2001 From: serg-and Date: Fri, 28 Mar 2025 13:57:02 +0100 Subject: [PATCH 08/10] update actions/cache@v4 --- .github/workflows/cargo.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 9f97d89..542c5f2 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -4,18 +4,18 @@ on: push: branches: [canary] paths: - - 'src/**' - - 'tests/**' - - '.cargo/**' - - 'Cargo.*' - - '.github/workflows/**' + - "src/**" + - "tests/**" + - ".cargo/**" + - "Cargo.*" + - ".github/workflows/**" pull_request: paths: - - 'src/**' - - 'tests/**' - - '.cargo/**' - - 'Cargo.*' - - '.github/workflows/**' + - "src/**" + - "tests/**" + - ".cargo/**" + - "Cargo.*" + - ".github/workflows/**" env: RUST_LOG: debug @@ -59,7 +59,7 @@ jobs: run: | echo 'C:\\npm\\prefix' >> $GITHUB_PATH - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.cargo/ From a7c28f6f175d12ab73381f967d91ca69a53b8015 Mon Sep 17 00:00:00 2001 From: Serge Andriessen <97445311+serg-and@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:57:44 +0200 Subject: [PATCH 09/10] activate github issues --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac782d9..1688253 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ sequenceDiagram Plugin always ensures compatibility with [Next.js Canary version](https://nextjs.org/docs/messages/opening-an-issue) only. -[Leave an Issue](https://github.com/serg-and/superjson-next.git/issues) +[Leave an Issue](https://github.com/serg-and/superjson-next/issues) ## Special Thanks From 8a8cedf5a1cefee6a2a92a768c922234eb2ab225 Mon Sep 17 00:00:00 2001 From: serg-and Date: Tue, 29 Jul 2025 01:21:29 +0200 Subject: [PATCH 10/10] next@15.4, add back auto router detection --- .cargo/config.toml | 2 +- Cargo.lock | 245 ++++++++++++++++++++++++++------------------- Cargo.toml | 5 +- README.md | 24 +++-- package.json | 4 +- src/lib.rs | 79 ++++----------- tests/fixture.rs | 4 +- 7 files changed, 180 insertions(+), 183 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 9f4c9cf..586348b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,4 @@ # These command aliases are not final, may change [alias] # Alias to build actual plugin binary for the specified target. -prepublish = "build --target wasm32-wasi" \ No newline at end of file +prepublish = "build --target wasm32-wasip1" \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 99c5a02..70e106a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,6 +69,12 @@ version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "ascii" version = "1.1.0" @@ -139,11 +145,12 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-simd" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" dependencies = [ - "simd-abstraction", + "outref", + "vsimd", ] [[package]] @@ -261,7 +268,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver", "serde", "serde_json", "thiserror", @@ -275,7 +282,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver", "serde", "serde_json", "thiserror", @@ -940,7 +947,7 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "next_superjson" -version = "0.7.1" +version = "0.8.0" dependencies = [ "serde", "serde_json", @@ -1008,15 +1015,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "outref" -version = "0.1.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" [[package]] name = "overload" @@ -1036,6 +1043,25 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +[[package]] +name = "par-core" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "757892557993c69e82f9de0f9051e87144278aa342f03bf53617bbf044554484" +dependencies = [ + "once_cell", +] + +[[package]] +name = "par-iter" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5b20f31e9ba82bfcbbb54a67aa40be6cebec9f668ba5753be138f9523c531a" +dependencies = [ + "either", + "par-core", +] + [[package]] name = "parking_lot" version = "0.12.3" @@ -1365,15 +1391,6 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustix" version = "0.38.37" @@ -1417,15 +1434,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.23" @@ -1435,12 +1443,6 @@ dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.213" @@ -1499,15 +1501,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[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.5" @@ -1545,17 +1538,16 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "sourcemap" -version = "9.0.0" +version = "9.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab08a862c70980b8e23698b507e272317ae52a608a164a844111f5372374f1f" +checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" dependencies = [ "base64-simd", "bitvec", "data-encoding", "debugid", "if_chain", - "rustc-hash 1.1.0", - "rustc_version", + "rustc-hash 2.1.1", "serde", "serde_json", "unicode-id-start", @@ -1733,9 +1725,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "8.0.1" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e4a932c152e7142de2d5dba1c393e5523c47cd8fe656e5b0d411954bbaf1810" +checksum = "44c332906667b0fa98622f19a19e43afa5aa63b652813f80645dd0f33eca1fbb" dependencies = [ "anyhow", "ast_node 3.0.0", @@ -1766,14 +1758,14 @@ dependencies = [ [[package]] name = "swc_core" -version = "16.10.0" +version = "26.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7453b2e6771d55f483903ed12fa9cf949ff7a3fefdfe4a63a5ea13b542e9eca" +checksum = "083af217e9715a7c1b020f7c9e71e4961285adb0333ee3f0e5e92962a0494a11" dependencies = [ "once_cell", "swc_allocator", "swc_atoms 5.0.0", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_transforms_base", @@ -1783,35 +1775,38 @@ dependencies = [ "swc_plugin", "swc_plugin_macro", "swc_plugin_proxy", + "swc_transform_common", "vergen", ] [[package]] name = "swc_ecma_ast" -version = "8.1.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01f80679b1afc52ae0663eed0a2539cc3c108d48c287b5601712f9850d9fa9c2" +checksum = "d2313360a518a37c4b9ee50030d189222927a3af902903cc70c50f6929e402dc" dependencies = [ "bitflags", "bytecheck", "is-macro", "num-bigint", + "once_cell", "phf", "rancor", "rkyv", + "rustc-hash 2.1.1", "scoped-tls", "string_enum", "swc_atoms 5.0.0", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_visit 2.0.0", "unicode-id-start", ] [[package]] name = "swc_ecma_codegen" -version = "8.0.2" +version = "13.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92103aa982740f265d6850bb3ffffbf6c3c1dee30ab0ed25117ca553f0d7467d" +checksum = "005b9e6e4cdd15c4c437d6662e4fc6dc93f60bd1c5159a1afcf6cd9eea6fb24f" dependencies = [ "ascii", "compact_str", @@ -1820,11 +1815,12 @@ dependencies = [ "once_cell", "regex", "rustc-hash 2.1.1", + "ryu-js", "serde", "sourcemap", "swc_allocator", "swc_atoms 5.0.0", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_ecma_ast", "swc_ecma_codegen_macros", "tracing", @@ -1832,9 +1828,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac2ff0957329e0dfcde86a1ac465382e189bf42a5989720d3476bea78eaa31a" +checksum = "e99e1931669a67c83e2c2b4375674f6901d1480994a76aa75b23f1389e6c5076" dependencies = [ "proc-macro2", "quote", @@ -1842,12 +1838,39 @@ dependencies = [ "syn 2.0.85", ] +[[package]] +name = "swc_ecma_lexer" +version = "14.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb339d30ba6ee93da5d5638982faaa79586cd429fe331648abf42afa0eb0a7b5" +dependencies = [ + "arrayvec", + "bitflags", + "either", + "new_debug_unreachable", + "num-bigint", + "num-traits", + "phf", + "rustc-hash 2.1.1", + "serde", + "smallvec", + "smartstring", + "stacker", + "swc_atoms 5.0.0", + "swc_common 11.1.3", + "swc_ecma_ast", + "tracing", + "typed-arena", +] + [[package]] name = "swc_ecma_parser" -version = "10.0.2" +version = "14.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfbfa5baabd14901a310f9d55d991625787d27d94de5c38a1a2ef85ebc19c97" +checksum = "60e07e6ecd47f748988902976d09c4022b1147772f88ad8a95852a20722ac7dc" dependencies = [ + "arrayvec", + "bitflags", "either", "new_debug_unreachable", "num-bigint", @@ -1859,54 +1882,55 @@ dependencies = [ "smartstring", "stacker", "swc_atoms 5.0.0", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_ecma_ast", + "swc_ecma_lexer", "tracing", "typed-arena", ] [[package]] name = "swc_ecma_testing" -version = "8.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e72a43b7acd904fa0c6d244a72aeda66febbc5a9720975481cb836d6804b604" +checksum = "bfca232a0a2e743c963185665bc6fb6f92b1422449aba17ccd836ff4aa02858d" dependencies = [ "anyhow", "hex", "sha2", - "testing 8.0.0", + "testing 12.0.0", "tracing", ] [[package]] name = "swc_ecma_transforms_base" -version = "11.2.0" +version = "15.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39889063ff4819eae414dfe6426aa5cd72ebb0f9f48739a1fa1e7eb82d0adc78" +checksum = "49c0a76bff24b9fa13d5451e7a664d18158849c45434d863e0553e29fb31170b" dependencies = [ "better_scoped_tls 1.0.0", "bitflags", "indexmap", "once_cell", + "par-core", "phf", "rustc-hash 2.1.1", "serde", "smallvec", "swc_atoms 5.0.0", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_utils", "swc_ecma_visit", - "swc_parallel", "tracing", ] [[package]] name = "swc_ecma_transforms_testing" -version = "11.0.1" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c4d8c48a36ad5d02626f853edcf52ae82b65d238389e7e76270ddf564b69ab" +checksum = "297e4f7638cfc0d6088ad637ec717b9ffbf7555a913963344cd1f3ce2864a660" dependencies = [ "ansi_term", "anyhow", @@ -1917,7 +1941,7 @@ dependencies = [ "sha2", "sourcemap", "swc_allocator", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_ecma_ast", "swc_ecma_codegen", "swc_ecma_parser", @@ -1926,39 +1950,40 @@ dependencies = [ "swc_ecma_utils", "swc_ecma_visit", "tempfile", - "testing 8.0.0", + "testing 12.0.0", ] [[package]] name = "swc_ecma_utils" -version = "11.0.0" +version = "15.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721dc779e7de200da96ac4002c710bc32c988e3e1ebf62b39d32bf99f14d9765" +checksum = "7d2c29dbfc54e02c14975aff9d2c75ae6fff0808d860d9971a493d37870e282f" dependencies = [ "indexmap", "num_cpus", "once_cell", + "par-core", + "par-iter", "rustc-hash 2.1.1", "ryu-js", "swc_atoms 5.0.0", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_ecma_ast", "swc_ecma_visit", - "swc_parallel", "tracing", "unicode-id", ] [[package]] name = "swc_ecma_visit" -version = "8.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7a65fa06d0c0f709f1df4e820ccdc4eca7b3db7f9d131545e20c2ac2f1cd23" +checksum = "8227d1d2d76a9ccfd190ec06bb4a4720bf3edb9f954c69816b2bca5f5aa43887" dependencies = [ "new_debug_unreachable", "num-bigint", "swc_atoms 5.0.0", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_ecma_ast", "swc_visit 2.0.0", "tracing", @@ -2001,9 +2026,9 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "9.1.1" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7938665a5561d6c3e2b796b5b2d0bc9a961d461db960cb5139f12e82b45bb471" +checksum = "572075b92eef780f9a13b99abcb4fbf8e6272abeed27b361632b5e3a2e8de70d" dependencies = [ "anyhow", "miette 7.2.0", @@ -2012,7 +2037,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "swc_common 8.0.1", + "swc_common 11.1.3", ] [[package]] @@ -2037,15 +2062,6 @@ dependencies = [ "syn 2.0.85", ] -[[package]] -name = "swc_parallel" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f16052d5123ec45c1c49100781363f3f4e4a6be2da6d82f473b79db1e3abeb8" -dependencies = [ - "once_cell", -] - [[package]] name = "swc_plugin" version = "1.0.0" @@ -2057,9 +2073,9 @@ dependencies = [ [[package]] name = "swc_plugin_macro" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0917ccfdcd3fa6cf41bdacef2388702a3b274f9ea708d930e1e8db37c7c3e1c6" +checksum = "ace467dfafbbdf3aecff786b8605b35db57d945e92fd88800569aa2cba0cdf61" dependencies = [ "proc-macro2", "quote", @@ -2068,16 +2084,16 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "8.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18c199683d9f946db8dfca444212a3551e74a7c563196b154d5ac30f3bf9de6" +checksum = "ab1281343dca1fe02aa027e2dfdf77067e62506e77b651e3e9c1a4e3fa8bccf6" dependencies = [ "better_scoped_tls 1.0.0", "bytecheck", "rancor", "rkyv", "rustc-hash 2.1.1", - "swc_common 8.0.1", + "swc_common 11.1.3", "swc_ecma_ast", "swc_trace_macro", "tracing", @@ -2085,15 +2101,28 @@ dependencies = [ [[package]] name = "swc_trace_macro" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c78717a841565df57f811376a3d19c9156091c55175e12d378f3a522de70cef" +checksum = "dfd2b4b0adb82e36f2ac688d00a6a67132c7f4170c772617516793a701be89e8" dependencies = [ - "proc-macro2", "quote", "syn 2.0.85", ] +[[package]] +name = "swc_transform_common" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be97f7341c59045d8ecbd5579acad8063e545d10304db086846b9dcf985c56e" +dependencies = [ + "better_scoped_tls 1.0.0", + "once_cell", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "swc_common 11.1.3", +] + [[package]] name = "swc_visit" version = "0.5.14" @@ -2220,9 +2249,9 @@ dependencies = [ [[package]] name = "testing" -version = "8.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d32ddc0e2ebd072cbffe7424087267da990708a5bc3ae29e075904468450275" +checksum = "4afa5efbee09e27d4fa6f7d3278e351ab1feaf8d253eea84bc69975fb6da418e" dependencies = [ "ansi_term", "cargo_metadata 0.18.1", @@ -2233,8 +2262,8 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_common 8.0.1", - "swc_error_reporters 9.1.1", + "swc_common 11.1.3", + "swc_error_reporters 13.0.0", "testing_macros 1.0.0", "tracing", "tracing-subscriber", @@ -2528,6 +2557,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index 8463f9d..3f43226 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "next_superjson" -version = "0.7.1" +version = "0.8.0" edition = "2021" authors = ["https://github.com/serg-and"] description = "SWC Plugin of SuperJSON for Next.js" @@ -13,7 +13,8 @@ crate-type = ["cdylib", "rlib"] [dependencies] serde = "1.0.144" serde_json = "1.0.85" -swc_core = { version = "16.10.*", features = [ +# match next@15.4.0 +swc_core = { version = "26.4.*", features = [ "ecma_plugin_transform", "ecma_ast", "ecma_utils", diff --git a/README.md b/README.md index ac782d9..149db44 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

Next SuperJSON Plugin

🔌 SuperJSON Plugin for Next.js (SWC)

-## Usage +## Installation Install packages first: @@ -16,20 +16,26 @@ npm install superjson superjson-next yarn add superjson superjson-next ``` -> [!IMPORTANT] -> Because of a bug in Next.js (see [#72019](https://github.com/vercel/next.js/issues/72019)), this plugin can only run in either app router or page router mode. - -Add the plugin into `next.config.js`. And select the type of [Router](https://nextjs.org/docs#app-router-vs-pages-router) you are using. +Add the plugin into `next.config.js` ```js // next.config.js module.exports = { experimental: { - swcPlugins: [["superjson-next", { router: "APP" | "PAGE" }]], + swcPlugins: [["superjson-next", {}]], }, }; ``` +### Versions + +| package version | Next.js versions | notes | +| :-------------- | :--------------- | :------------------------------------------ | +| `0.8.0` | `15.4.*` | | +| `0.7.1` | `15.0.*` | requires choosing router type (see release) | + +## Usage + ### /pages (Pages Directory) ```jsx @@ -63,16 +69,16 @@ export default function ServerComponent() { } ``` -- Provides `data-superjson` attribute for [Server Component > Client Component Serialization](https://beta.nextjs.org/docs/rendering/server-and-client-components#passing-props-from-server-to-client-components-serialization). - ### Options You can use the `excluded` option to exclude specific properties from serialization. ```js -["superjson-next", { router: "APP" | "PAGE", excluded: ["someProp"] }], +['superjson-next', { excluded: ["someProp"] }], ``` +- Provides `data-superjson` attribute for [Server Component > Client Component Serialization](https://beta.nextjs.org/docs/rendering/server-and-client-components#passing-props-from-server-to-client-components-serialization). + ## How it works ```mermaid diff --git a/package.json b/package.json index 580734d..11ea054 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superjson-next", - "version": "0.7.1", + "version": "0.8.0", "description": "Automatically transform your Next.js Pages to use SuperJSON with SWC", "author": "https://github.com/serg-and", "homepage": "https://github.com/serg-and/superjson-next#readme", @@ -31,7 +31,7 @@ "dist" ], "peerDependencies": { - "next": "^15.2", + "next": "^15.4", "superjson": "^1 || ^2" }, "dependencies": { diff --git a/src/lib.rs b/src/lib.rs index da425f2..92cf0f9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,8 @@ +use std::path::{Component, Path}; + use serde::Deserialize; use swc_core::{ + common::plugin::metadata::TransformPluginMetadataContextKind, ecma::{ast::*, visit::*}, plugin::{plugin_transform, proxies::TransformPluginProgramMetadata}, }; @@ -11,25 +14,6 @@ pub mod app; pub mod page; mod utils; -static MISSING_CONFIG: &str = "superjson-next: Missing config, - -Provide a plugin config in your next.config.(js|ts) like: - -module.exports = { - experimental: { - swcPlugins: [ - [ - 'superjson-next', - { - router: 'APP' | 'PAGE', - excluded: ['someProps'], (optional) - } - ] - ], - } -} -"; - static BAD_CONFIG: &str = "superjson-next: Failed to parse config, Provide a plugin config in your next.config.(js|ts) like: @@ -40,7 +24,6 @@ module.exports = { [ 'superjson-next', { - router: 'APP' | 'PAGE', excluded: ['someProps'], (optional) } ] @@ -49,50 +32,32 @@ module.exports = { } "; -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "UPPERCASE")] -pub enum Router { - #[serde(alias = "app", alias = "App")] - App, - #[serde(alias = "page", alias = "Page")] - Page, -} - -#[derive(Debug, Clone, Deserialize)] +#[derive(Debug, Clone, Deserialize, Default)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Config { - pub router: Router, #[serde(default)] pub excluded: Vec, } -// pub enum DirType { -// Page, -// App, -// } +pub enum DirType { + Page, + App, +} #[plugin_transform] pub fn process_transform(program: Program, metadata: TransformPluginProgramMetadata) -> Program { - let plugin_config_str = &metadata - .get_transform_plugin_config() - .expect(MISSING_CONFIG); - let config = serde_json::from_str::(&plugin_config_str).expect(BAD_CONFIG); - - match config.router { - Router::App => program.apply(&mut visit_mut_pass(transform_app(config))), - Router::Page => program.apply(&mut visit_mut_pass(transform_page(config))), - } - - /* - // Automatic detection of router type is disabled because of a bug in Next.js - // Re enable this code once Next.js fixes this issue - // https://github.com/vercel/next.js/issues/72019 + let config = match metadata.get_transform_plugin_config() { + Some(plugin_config_str) => { + serde_json::from_str::(&plugin_config_str).expect(BAD_CONFIG) + } + None => Config::default(), + }; - let raw_cwd = _metadata + let raw_cwd = metadata .get_context(&TransformPluginMetadataContextKind::Cwd) .unwrap(); - let raw_path = _metadata + let raw_path = metadata .get_context(&TransformPluginMetadataContextKind::Filename) .unwrap(); @@ -131,19 +96,11 @@ pub fn process_transform(program: Program, metadata: TransformPluginProgramMetad // consider server components outside the app directory let dir_type = if is_page { DirType::Page } else { DirType::App }; - let config = serde_json::from_str::( - &_metadata - .get_transform_plugin_config() - .unwrap_or_else(|| "{}".to_string()), - ) - .expect("Failed to parse plugin config"); - match dir_type { - DirType::Page => program.fold_with(&mut as_folder(transform_page(config))), - DirType::App => program.fold_with(&mut as_folder(transform_app(config))), + DirType::Page => program.apply(&mut visit_mut_pass(transform_page(config))), + DirType::App => program.apply(&mut visit_mut_pass(transform_app(config))), } } else { program } - */ } diff --git a/tests/fixture.rs b/tests/fixture.rs index a0dd804..c90157a 100644 --- a/tests/fixture.rs +++ b/tests/fixture.rs @@ -6,7 +6,7 @@ use swc_core::ecma::{ }; use testing::fixture; -use next_superjson::{app::transform_app, page::transform_page, Config, Router}; +use next_superjson::{app::transform_app, page::transform_page, Config}; #[fixture("tests/fixture/page/**/code.js")] fn fixture_page(input: PathBuf) { @@ -19,7 +19,6 @@ fn fixture_page(input: PathBuf) { }), &|_| { visit_mut_pass(transform_page(Config { - router: Router::Page, excluded: vec!["smth".to_string()], })) }, @@ -40,7 +39,6 @@ fn fixture_app(input: PathBuf) { }), &|_| { visit_mut_pass(transform_app(Config { - router: Router::App, excluded: vec!["smth".to_string()], })) },