diff --git a/Cargo.lock b/Cargo.lock index d88e42188db32..d55f55ad9ce73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "serde", "smallvec", @@ -446,9 +446,9 @@ dependencies = [ [[package]] name = "binding_macros" -version = "0.69.0" +version = "0.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e1686de576561c3dfd417fe1de23f60b855f8a1a2ea0f68a0f461e2f2e53e0" +checksum = "e777679fa2aa9a07faccbf118ab98152013f6538cdaf1282392a82d8e0c7dc3c" dependencies = [ "anyhow", "console_error_panic_hook", @@ -539,23 +539,19 @@ dependencies = [ [[package]] name = "browserslist-rs" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "405bbd46590a441abe5db3e5c8af005aa42e640803fecb51912703e93e4ce8d3" +checksum = "fdf0ca73de70c3da94e4194e4a01fe732378f55d47cf4c0588caab22a0dbfa14" dependencies = [ "ahash 0.8.9", - "anyhow", "chrono", "either", "indexmap 2.2.6", - "itertools 0.12.0", + "itertools 0.13.0", "nom", "once_cell", - "quote", "serde", "serde_json", - "string_cache", - "string_cache_codegen", "thiserror", ] @@ -690,9 +686,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -700,7 +696,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.1", + "windows-targets 0.52.5", ] [[package]] @@ -723,7 +719,7 @@ dependencies = [ "anstyle", "clap_lex", "strsim 0.11.0", - "terminal_size 0.3.0", + "terminal_size", ] [[package]] @@ -1408,9 +1404,9 @@ checksum = "04cc9717c61d2908f50d16ebb5677c7e82ea2bdf7cb52f66b30fe079f3212e16" [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encode_unicode" @@ -2271,12 +2267,6 @@ dependencies = [ "syn 2.0.58", ] -[[package]] -name = "is_ci" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" - [[package]] name = "is_debug" version = "1.0.1" @@ -2294,9 +2284,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -2672,9 +2662,9 @@ dependencies = [ [[package]] name = "markdown" -version = "1.0.0-alpha.17" +version = "1.0.0-alpha.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e27d6220ce21f80ce5c4201f23a37c6f1ad037c72c9d1ff215c2919605a5d6" +checksum = "4e61c5c85b392273c4d4ea546e6399ace3e3db172ab01b6de8f3d398d1dbd2ec" dependencies = [ "unicode-id", ] @@ -2715,9 +2705,9 @@ dependencies = [ [[package]] name = "mdxjs" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce40dd4643deb0adb6ab3eda8374bd23da81a87e982ff9493e07bf9356f3248f" +checksum = "6996bd9591dc92f29740adca2e1290fa17919dab0b0337918ee05f257cff284e" dependencies = [ "markdown", "serde", @@ -2759,19 +2749,13 @@ dependencies = [ [[package]] name = "miette" -version = "4.7.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" +checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" dependencies = [ - "atty", - "backtrace", + "cfg-if", "miette-derive", - "once_cell", - "owo-colors", - "supports-color", - "supports-hyperlinks", - "supports-unicode", - "terminal_size 0.1.17", + "owo-colors 4.0.0", "textwrap", "thiserror", "unicode-width", @@ -2779,13 +2763,13 @@ dependencies = [ [[package]] name = "miette-derive" -version = "4.7.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" +checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.58", ] [[package]] @@ -2853,9 +2837,9 @@ dependencies = [ [[package]] name = "modularize_imports" -version = "0.68.16" +version = "0.68.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d691538a2cc5dfe1ebc8a26d8cf381d904929d8b699613aef6ad848090dcfd0e" +checksum = "493b54c142f3044decf1dae3d511d0a2bbf1386269083bd62c7d4786582a6c69" dependencies = [ "convert_case", "handlebars", @@ -2971,9 +2955,9 @@ dependencies = [ [[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-api" @@ -3094,6 +3078,7 @@ dependencies = [ "next-build", "next-core", "next-custom-transforms", + "once_cell", "rand", "serde", "serde_json", @@ -3111,7 +3096,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "serde", @@ -3408,6 +3393,12 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "owo-colors" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" + [[package]] name = "parcel_selectors" version = "0.26.5" @@ -3748,9 +3739,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "preset_env_base" -version = "0.4.13" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ccd15679953ae0d5fa716af78b58c0bfdc69a0534bfe9ea423abd1eaaf527b" +checksum = "1b30eab18be480c194938e433e269d5298a279f6410f02fbc73f3576a325c110" dependencies = [ "ahash 0.8.9", "anyhow", @@ -4021,9 +4012,9 @@ dependencies = [ [[package]] name = "react_remove_properties" -version = "0.24.14" +version = "0.24.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b084379ac0eac290f37b1183851ce0e00a4bafc2ae5dd4d7b3409d49e5f619" +checksum = "68f2334d53775d31dd32a52eeb1abbedea355b7334214ab38b092ad817d5500b" dependencies = [ "serde", "swc_atoms", @@ -4138,9 +4129,9 @@ checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" [[package]] name = "remove_console" -version = "0.25.14" +version = "0.25.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65c2675823619086c4136b23f1be2187344878f9645de5abe2cb0adfe96a60b" +checksum = "fd254fd6c8727fd18d10f8d7f6b6292753219446c98b68cf23c62e5549a2cf32" dependencies = [ "serde", "swc_atoms", @@ -4668,22 +4659,11 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "sha-1" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -4961,32 +4941,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared 0.10.0", - "precomputed-hash", - "serde", -] - -[[package]] -name = "string_cache_codegen" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" -dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", - "proc-macro2", - "quote", -] - [[package]] name = "string_enum" version = "0.4.4" @@ -5013,9 +4967,9 @@ checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "styled_components" -version = "0.96.17" +version = "0.96.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10db3c4936218e6eb938962069d935aaf1bec7d7901e767329e4b646d1f9a63b" +checksum = "dd42d48e5ec761a8cea4562a336a74f8606fca5c50ec03cbc1650c3931d19d51" dependencies = [ "Inflector", "once_cell", @@ -5031,9 +4985,9 @@ dependencies = [ [[package]] name = "styled_jsx" -version = "0.73.24" +version = "0.73.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bce718faf2b675889e7d7b00b108348bb6006eed72dbf4ca4134b130f61a3bb6" +checksum = "a2783110a0c406ca89fc844446b1456b8341d991748f8e7a8d396cf952375c9d" dependencies = [ "anyhow", "lightningcss", @@ -5063,39 +5017,11 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[package]] -name = "supports-color" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" -dependencies = [ - "atty", - "is_ci", -] - -[[package]] -name = "supports-hyperlinks" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" -dependencies = [ - "atty", -] - -[[package]] -name = "supports-unicode" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" -dependencies = [ - "atty", -] - [[package]] name = "swc" -version = "0.278.0" +version = "0.279.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd1744254f522db85caadd3e30abc485432f7b0cf498040c855f1d6230df0df" +checksum = "e360f7055c05d58acf732bac714094f46556ee0d271f58fcd9f3683853d05e1a" dependencies = [ "anyhow", "base64 0.21.4", @@ -5139,6 +5065,7 @@ dependencies = [ "swc_plugin_runner", "swc_timer", "swc_transform_common", + "swc_typescript", "swc_visit", "tokio", "tracing", @@ -5161,9 +5088,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.230.0" +version = "0.230.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd503e72a3511f3cd7b553eb9635e42dc6d45ff622aa13e0773c8b2d6473346" +checksum = "9c506ddddebb846f8e68780464e2fe1fdc0add4bc265659f713a71015ffcdb13" dependencies = [ "anyhow", "crc", @@ -5207,9 +5134,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.34.2" +version = "0.34.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add6efe3f1a2fe9108b27fb6ba94998ab5bfd8696d590033003987c82452b8f9" +checksum = "9087befec6b63911f9d2f239e4f91c9b21589c169b86ed2d616944d23cf4a243" dependencies = [ "ahash 0.8.9", "anyhow", @@ -5240,9 +5167,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970284db7590bd2fa8cbb3ff08efc970ad3233b6b06c43b64ff5fea88743cc3f" +checksum = "e37fcb78ee79d792ba97b63f58869b9995b7248b46676503e0d0328d19dba2c5" dependencies = [ "anyhow", "base64 0.21.4", @@ -5294,9 +5221,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.95.4" +version = "0.96.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c87d2488f08d269b91a516b0b726e11569a9713ee148c3015571b415e1c430" +checksum = "de60918c09a10e55b659b4e70029d283da815e3107b22f79ec9fac280d4d8843" dependencies = [ "binding_macros", "swc", @@ -5437,9 +5364,9 @@ dependencies = [ [[package]] name = "swc_css_prefixer" -version = "0.154.0" +version = "0.155.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90be51bf58aaff6d4682ada46bd44506d53b8aec8d1b0cebdc5bfe05b163f853" +checksum = "cc9930655060121c32d829e13fe4fa11294c03e71eb84c22e039703c929dcdf7" dependencies = [ "once_cell", "preset_env_base", @@ -5502,9 +5429,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.151.0" +version = "0.151.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6602bcf4fd78b2ef0c7b2abcdbd3e35dfa564a6bcfb0f256e86b41ff3299d7" +checksum = "f5141a8cb4eb69e090e6aea5d49061b46919be5210f3d084f9d9ad63d30f5cff" dependencies = [ "memchr", "num-bigint", @@ -5533,9 +5460,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f8e8697555cf32b8dd18c62637ce804c8c96343a6752d622e12e84fd0cea336" +checksum = "04182e17ec1343e355c4150b51226627d0160b8c0fb612bfcf3faa3d030a3866" dependencies = [ "swc_atoms", "swc_common", @@ -5563,9 +5490,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0514f6652e4bdb327df10c7a577346fa1f2bea5a416360f12763e4bb15d1794" +checksum = "d23a9a192078d1d074113d77d8ad811f2a81a4447ae967739824da5d391616bf" dependencies = [ "arrayvec", "indexmap 2.2.6", @@ -5589,9 +5516,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a58e0626e1d6f156b6c30a596fcaddf99d7fd2826fed118ee848a6b8339d32" +checksum = "a166a024e6415bb6e6e326ed6ebe2fadcea093408f0de3cf1308b4f971c171b0" dependencies = [ "swc_atoms", "swc_common", @@ -5606,9 +5533,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11928d0da6babf2632d9b1580bb5f476f251c3c5a5ce9ceb9f650e4ee5b38fe" +checksum = "65f84891ddbc61b105222e64f7f33cf8a27d4020cbae2e7381899eacb69c540a" dependencies = [ "serde", "swc_atoms", @@ -5624,9 +5551,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaee1dbdf5d65fe8149c51298c2065bf94e4b32b922c487deeda3f9033e246d6" +checksum = "fe11cda413787f46bef9a66752933fb8f6f2e509cb938758ad67d27710619ee6" dependencies = [ "serde", "swc_atoms", @@ -5643,9 +5570,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2243e1b427495d787fc06966b60ba61e194bcd46646c7ee95a0481674a44f353" +checksum = "ce2888fa110ff41e36bd824fa8636f876f812e64c8b12d721df90a133c28ee86" dependencies = [ "swc_atoms", "swc_common", @@ -5659,9 +5586,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e791d25641ba974d01a1f6f8795244ccb7cb16e916f91b51d72609db6cd94cf3" +checksum = "3baf93ce04ee5a888e41265280dcb12d4e6a7bcf907ef2526b69d2aed9187607" dependencies = [ "serde", "swc_atoms", @@ -5712,9 +5639,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de9acee5e6867cb91460a48a2cc0900db01fdd90112cdd4c74defc7dcd4577" +checksum = "d2d6a9792a2f534232b98a1564e3982d9135d86f6948a55e8f944ab3b960e602" dependencies = [ "swc_common", "swc_ecma_ast", @@ -5741,9 +5668,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.95.0" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221b7fc65afd0104e856960a301b1be861cad04a3b144ecb2dd209874c905a37" +checksum = "b58d31115dae5a96bf15fcae9958711b14e9cf9944d045c91796d039d2879dbc" dependencies = [ "auto_impl", "dashmap", @@ -5761,9 +5688,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.46.0" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de65ea1e3f6fe8d62121eb5889ef98ca41b04425df85cd1a3b81637057a2b035" +checksum = "5a9febebf047d1286e7b723fa2758f3229da2c103834f3eaee69833f46692612" dependencies = [ "anyhow", "dashmap", @@ -5783,9 +5710,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.197.0" +version = "0.197.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d74a46ad5fa5c070d65454d6d20a833948a099082cc8bcf620c2a669eba3b43" +checksum = "adde00302d7ddb37f312ee6d07078c7f3c7ede36c0f81c5050bae1d4c3fe501c" dependencies = [ "arrayvec", "indexmap 2.2.6", @@ -5793,6 +5720,7 @@ dependencies = [ "num_cpus", "once_cell", "parking_lot", + "phf 0.11.2", "radix_fmt", "rayon", "regex", @@ -5817,9 +5745,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.146.2" +version = "0.146.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8953dcf07d90ad14d82c79ef48a2e0c510a043c7e6af3aed4ef59277044ba854" +checksum = "0a4e0c2e85f12c63b85c805e923079b04d1fb3e25edd069d638eed5f2098de74" dependencies = [ "either", "new_debug_unreachable", @@ -5839,9 +5767,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.209.0" +version = "0.210.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9a4cc2b1deb679c15be85f77d0f4bca75404c5964c786761a056e1a4cfe828" +checksum = "9cd4847a3356a01bb9a73ccdd1c462dfdaed66d27d7ea6d6785ee1b54c9556ce" dependencies = [ "anyhow", "dashmap", @@ -5864,9 +5792,9 @@ dependencies = [ [[package]] name = "swc_ecma_quote_macros" -version = "0.57.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79eedaab1225550fac9c364c9b07ce329fc4d67c2b4896d1c054aca0976f8f5f" +checksum = "9537bc1a7daca42be1922137f4e59458bd72dd330cf9c96877e191e632bc2a8a" dependencies = [ "anyhow", "proc-macro2", @@ -5894,9 +5822,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.232.0" +version = "0.232.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8e66bc10715c10219239772abd2f6be99eda573e69e5abb8646b1f3fce83dc" +checksum = "6845e7a7001aa2793225568e0661b55f57352a2103fa28934dd9cbc0d41cd933" dependencies = [ "swc_atoms", "swc_common", @@ -5914,9 +5842,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.140.0" +version = "0.140.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daee7af0abfccc9855656fc36ac472e1e6a61398a3a1a1b3bf05ef7a7e7af6b0" +checksum = "d37dc505c92af56d0f77cf6f31a6ccd37ac40cad1e01ff77277e0b1c70e8f8ff" dependencies = [ "better_scoped_tls", "bitflags 2.5.0", @@ -5952,9 +5880,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.166.0" +version = "0.166.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e03c5afd68b80591a3871ac3692f3adaf281c0c3c686db51a73ed91270d6f4c" +checksum = "626198f214d4c09adc98ab14565c19d72b6df9630f7e806ef9b2ef05a5fd17a5" dependencies = [ "arrayvec", "indexmap 2.2.6", @@ -6001,9 +5929,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.183.0" +version = "0.183.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f814b5dacf9b37d3e2df900cef6f00471e78ad73dc595b427ca34fb74543e1d" +checksum = "d7dc1df5996d98d1a27995e8b8a13f805a801d9286cb9ed29103662c767c747e" dependencies = [ "Inflector", "anyhow", @@ -6028,9 +5956,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.201.0" +version = "0.201.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58577833f2a748ce4f8d934b59e528cc2391c43dc716040b15952ce7a1afae6" +checksum = "724a8306e98c1b1f9640fc44c1acc0c971f6daa17651919e06b64f905d4a4564" dependencies = [ "dashmap", "indexmap 2.2.6", @@ -6053,9 +5981,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.174.1" +version = "0.174.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db0e71b7a87c4fcddec835e6717854849ab8bba9c9f6332858f6c8b66c1ad9f" +checksum = "6df8aa6752cc2fcf3d78ac67827542fb666e52283f2b26802aa058906bb750d3" dependencies = [ "either", "rustc-hash", @@ -6073,9 +6001,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.186.0" +version = "0.186.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5209735a7136c17c08dc6af3031e73157cc5a59c1f176f0e160d799aaece227" +checksum = "446da32cac8299973aaf1d37496562bfd0c1e4f3c3ab5d0af6f07f42e8184102" dependencies = [ "base64 0.21.4", "dashmap", @@ -6083,7 +6011,7 @@ dependencies = [ "once_cell", "rayon", "serde", - "sha-1", + "sha1", "string_enum", "swc_atoms", "swc_common", @@ -6098,9 +6026,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.143.0" +version = "0.143.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2622a94000bb4e04548afe0540150f616c58296d5485c0653d1fae69c23efd98" +checksum = "20932deae5f94d2c2d722ed2ed70a140e1e9f19d105414c02572bd49e83fb29a" dependencies = [ "ansi_term", "anyhow", @@ -6124,9 +6052,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.191.0" +version = "0.191.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd0ed356e5e19a7111ac24773439141bd3941eb420a51bfbce762757fc7adc2" +checksum = "f1ce8af2865449e714ae56dacb6b54b3f6dc4cc25074da4e39b878bd93c5e39c" dependencies = [ "ryu-js", "serde", @@ -6158,9 +6086,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.130.0" +version = "0.130.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831490c6d4a52f06932fa2c3d87fc0d0aa43211a5df6b5e05a1ec2c57a2f2519" +checksum = "13e62b199454a576c5fdbd7e1bef8ab88a395427456d8a713d994b7d469833aa" dependencies = [ "indexmap 2.2.6", "num_cpus", @@ -6193,9 +6121,9 @@ dependencies = [ [[package]] name = "swc_emotion" -version = "0.72.15" +version = "0.72.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "987726fc4d2f08751b00d691cc56e21a90489810504181da00defe236fd7f262" +checksum = "5c77a41e3908561af55baec3d0a7911270822a17f173bab8fb2d3e30ed241128" dependencies = [ "base64 0.22.1", "byteorder", @@ -6228,9 +6156,9 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd8f9a90efb59dc5d918b4470e5d152f34cac2f8733bfba141a96440cab3eff" +checksum = "4689d9bb6092b5e6a0b79c0152336a8bd7f0acaf70dcf4133f86deb01775baa0" dependencies = [ "anyhow", "miette", @@ -6313,9 +6241,9 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "0.44.0" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98740e5a1ac82ad0de823bcf4aea97a76dce77c1ccff167d148e8a114b2932c0" +checksum = "3d5460f8f89905a6d698d8d9a965f6c99888c8ebcbb5a0266556d06ad39f09f7" dependencies = [ "better_scoped_tls", "rkyv", @@ -6327,9 +6255,9 @@ dependencies = [ [[package]] name = "swc_plugin_runner" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d36d7e035c81f623b6fc58755025defc719ef25aea0607214102c1f1616ab41" +checksum = "633742a4ee0d51337b7b29771e94f93badd6944919eaff0515c4a14e7993fc4d" dependencies = [ "anyhow", "enumset", @@ -6352,9 +6280,9 @@ dependencies = [ [[package]] name = "swc_relay" -version = "0.44.16" +version = "0.44.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53f264a2f199c875993ec5cf5444bf9f74ec6a43d5b1fbf1d3eb0fda718d9cac" +checksum = "35d0b3ed1b7dcb73c4e70bc7d64f661af792cbe483f0aef8dd007187e266c144" dependencies = [ "once_cell", "regex", @@ -6401,6 +6329,18 @@ dependencies = [ "serde_json", ] +[[package]] +name = "swc_typescript" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbe6ad7122e2d9070da178c0c752b529a3ad9b9e1c931fce0aed8233eacad9e3" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "thiserror", +] + [[package]] name = "swc_visit" version = "0.5.14" @@ -6524,16 +6464,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "terminal_size" version = "0.3.0" @@ -6592,9 +6522,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ "smawk", "unicode-linebreak", @@ -6978,12 +6908,12 @@ dependencies = [ [[package]] name = "turbo-prehash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "async-trait", @@ -7017,7 +6947,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "cargo-lock", @@ -7030,7 +6960,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "bytes", @@ -7044,7 +6974,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "dotenvs", @@ -7058,7 +6988,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "lazy_static", @@ -7074,7 +7004,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "auto-hash-map", @@ -7106,7 +7036,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "md4", "turbo-tasks-macros", @@ -7116,9 +7046,10 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", + "either", "proc-macro-error", "proc-macro2", "quote", @@ -7130,7 +7061,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "proc-macro2", "quote", @@ -7140,7 +7071,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "mimalloc", ] @@ -7148,7 +7079,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "auto-hash-map", @@ -7176,7 +7107,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "async-recursion", @@ -7206,7 +7137,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "auto-hash-map", "mdxjs", @@ -7247,7 +7178,7 @@ dependencies = [ [[package]] name = "turbopack-browser" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7270,12 +7201,12 @@ dependencies = [ [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "clap", "crossterm", - "owo-colors", + "owo-colors 3.5.0", "serde", "turbo-tasks", "turbo-tasks-build", @@ -7287,7 +7218,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "async-recursion", @@ -7316,7 +7247,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7343,7 +7274,7 @@ dependencies = [ [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "async-compression", @@ -7379,7 +7310,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "async-trait", @@ -7414,7 +7345,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-hmr-protocol" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "serde", "serde_json", @@ -7425,7 +7356,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "async-trait", @@ -7450,7 +7381,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "indoc", @@ -7466,7 +7397,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7482,7 +7413,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "base64 0.21.4", @@ -7501,7 +7432,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "serde", @@ -7516,7 +7447,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "mdxjs", @@ -7531,7 +7462,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "async-stream", @@ -7543,7 +7474,7 @@ dependencies = [ "indoc", "mime", "once_cell", - "owo-colors", + "owo-colors 3.5.0", "parking_lot", "regex", "serde", @@ -7565,7 +7496,7 @@ dependencies = [ [[package]] name = "turbopack-nodejs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7585,7 +7516,7 @@ dependencies = [ [[package]] name = "turbopack-resolve" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7603,7 +7534,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "serde", @@ -7619,7 +7550,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "swc_core", "turbo-tasks", @@ -7630,7 +7561,7 @@ dependencies = [ [[package]] name = "turbopack-trace-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "either", @@ -7650,7 +7581,7 @@ dependencies = [ [[package]] name = "turbopack-trace-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "crossbeam-channel", @@ -7666,7 +7597,7 @@ dependencies = [ [[package]] name = "turbopack-wasm" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240712.1#8a4be2d121b9e166384155becbb258e71da22cc8" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7803,9 +7734,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" diff --git a/Cargo.toml b/Cargo.toml index bc4157c2bd12f..f6e31a4c3d44d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,18 +31,18 @@ next-core = { path = "packages/next-swc/crates/next-core" } next-custom-transforms = { path = "packages/next-swc/crates/next-custom-transforms" } # SWC crates -swc_core = { version = "0.95.4", features = [ +swc_core = { version = "0.96.9", features = [ "ecma_loader_lru", "ecma_loader_parking_lot", ] } testing = { version = "0.36.0" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240704.3" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240712.1" } # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. -turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240704.3" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240712.1" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240704.3" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240712.1" } # General Deps diff --git a/packages/next-swc/crates/napi/Cargo.toml b/packages/next-swc/crates/napi/Cargo.toml index 490ab3e036e69..143fb8037a50f 100644 --- a/packages/next-swc/crates/napi/Cargo.toml +++ b/packages/next-swc/crates/napi/Cargo.toml @@ -72,6 +72,7 @@ tracing-subscriber = { workspace = true } tracing-chrome = "0.5.0" url = { workspace = true } urlencoding = { workspace = true } +once_cell ={workspace= true} # Dependencies for the native, non-wasm32 build. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/packages/next-swc/crates/napi/src/transform.rs b/packages/next-swc/crates/napi/src/transform.rs index 7d3b48f75d19d..35230a0fa20cf 100644 --- a/packages/next-swc/crates/napi/src/transform.rs +++ b/packages/next-swc/crates/napi/src/transform.rs @@ -38,6 +38,7 @@ use anyhow::{anyhow, bail, Context as _}; use fxhash::FxHashSet; use napi::bindgen_prelude::*; use next_custom_transforms::chain_transforms::{custom_before_pass, TransformOptions}; +use once_cell::sync::Lazy; use turbopack_binding::swc::core::{ base::{try_with_handler, Compiler, TransformOutput}, common::{comments::SingleThreadedComments, errors::ColorConfig, FileName, Mark, GLOBALS}, @@ -61,9 +62,22 @@ pub struct TransformTask { pub options: Buffer, } -#[inline] fn skip_filename() -> bool { - cfg!(debug_assertions) + fn check(name: &str) -> bool { + let v = std::env::var(name); + let v = match v { + Ok(v) => v, + Err(_) => return false, + }; + + !v.is_empty() && v != "0" + } + + static SKIP_FILENAME: Lazy = Lazy::new(|| { + check("NEXT_TEST_MODE") || check("__NEXT_TEST_MODE") || check("NEXT_TEST_JOB") + }); + + *SKIP_FILENAME } impl Task for TransformTask { diff --git a/packages/next-swc/crates/next-core/src/next_shared/transforms/modularize_imports.rs b/packages/next-swc/crates/next-core/src/next_shared/transforms/modularize_imports.rs index 5929f4c01cc3a..120461e4384f8 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/transforms/modularize_imports.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/transforms/modularize_imports.rs @@ -85,6 +85,8 @@ impl ModularizeImportsTransformer { }, prevent_full_import: v.prevent_full_import, skip_default_conversion: v.skip_default_conversion, + handle_default_import: false, + handle_namespace_import: false, }, ) }) diff --git a/packages/next-swc/crates/next-custom-transforms/Cargo.toml b/packages/next-swc/crates/next-custom-transforms/Cargo.toml index 568be1a6dd2af..f6512f6f0c17e 100644 --- a/packages/next-swc/crates/next-custom-transforms/Cargo.toml +++ b/packages/next-swc/crates/next-custom-transforms/Cargo.toml @@ -38,9 +38,9 @@ turbopack-binding = { workspace = true, features = [ ] } # To allow quote! macro works swc_core = { workspace = true, features = ["ecma_quote"] } -react_remove_properties = "0.24.14" -remove_console = "0.25.14" -preset_env_base = "0.4.12" +react_remove_properties = "0.24.15" +remove_console = "0.25.15" +preset_env_base = "0.5.1" [dev-dependencies] turbopack-binding = { workspace = true, features = [ diff --git a/packages/next-swc/crates/next-custom-transforms/src/chain_transforms.rs b/packages/next-swc/crates/next-custom-transforms/src/chain_transforms.rs index f7557dd237d32..ebcdb62bd0ff5 100644 --- a/packages/next-swc/crates/next-custom-transforms/src/chain_transforms.rs +++ b/packages/next-swc/crates/next-custom-transforms/src/chain_transforms.rs @@ -129,7 +129,7 @@ where let relay_plugin = { if let Some(config) = &opts.relay { Either::Left(turbopack_binding::swc::custom_transform::relay::relay( - config, + Arc::new(config.clone()), file.name.clone(), std::env::current_dir().unwrap(), opts.pages_dir.clone(), diff --git a/packages/next-swc/crates/next-custom-transforms/src/transforms/page_static_info/mod.rs b/packages/next-swc/crates/next-custom-transforms/src/transforms/page_static_info/mod.rs index 8eae568fb90fd..e6da033aced7f 100644 --- a/packages/next-swc/crates/next-custom-transforms/src/transforms/page_static_info/mod.rs +++ b/packages/next-swc/crates/next-custom-transforms/src/transforms/page_static_info/mod.rs @@ -234,7 +234,7 @@ mod tests { common::{errors::ColorConfig, FilePathMapping, SourceMap, GLOBALS}, ecma::{ ast::Program, - parser::{EsConfig, Syntax, TsConfig}, + parser::{EsSyntax, Syntax, TsSyntax}, }, }; @@ -247,13 +247,13 @@ mod tests { let options = ParseOptions { is_module: IsModule::Unknown, syntax: if file_path.ends_with(".ts") || file_path.ends_with(".tsx") { - Syntax::Typescript(TsConfig { + Syntax::Typescript(TsSyntax { tsx: true, decorators: true, ..Default::default() }) } else { - Syntax::Es(EsConfig { + Syntax::Es(EsSyntax { jsx: true, decorators: true, ..Default::default() diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors.rs b/packages/next-swc/crates/next-custom-transforms/tests/errors.rs index be74f9fc9a6b1..6daf8887cde7e 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors.rs +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors.rs @@ -15,7 +15,7 @@ use turbopack_binding::swc::{ core::{ common::{chain, FileName, Mark}, ecma::{ - parser::{EsConfig, Syntax}, + parser::{EsSyntax, Syntax}, transforms::{ base::resolver, testing::{test_fixture, FixtureTestConfig}, @@ -26,7 +26,7 @@ use turbopack_binding::swc::{ }; fn syntax() -> Syntax { - Syntax::Es(EsConfig { + Syntax::Es(EsSyntax { jsx: true, ..Default::default() }) diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/no-arguments/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/no-arguments/output.stderr index 9ea9e0cdcc57c..5f1634c0d8918 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/no-arguments/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/no-arguments/output.stderr @@ -1,6 +1,5 @@ - x next/dynamic requires at least one argument - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | const DynamicComponent = dynamic() : ^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/options-as-variable/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/options-as-variable/output.stderr index 89d25530ce284..cb5790e7aa182 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/options-as-variable/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/options-as-variable/output.stderr @@ -1,7 +1,6 @@ - x next/dynamic options must be an object literal. | Read more: https://nextjs.org/docs/messages/invalid-dynamic-options-type - ,-[input.js:3:1] + ,-[input.js:4:1] 3 | const options = { loading: () =>

...

, ssr: false } 4 | const DynamicComponentWithCustomLoading = dynamic( : ^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/too-many-arguments/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/too-many-arguments/output.stderr index a57b6f7c86b2e..14d8d64f402e5 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/too-many-arguments/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-dynamic/too-many-arguments/output.stderr @@ -1,6 +1,5 @@ - x next/dynamic only accepts 2 arguments - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | const DynamicComponentWithCustomLoading = dynamic( : ^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/export-let/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/export-let/output.stderr index 45d491115a0e9..18aecac2e1d8d 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/export-let/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/export-let/output.stderr @@ -1,14 +1,12 @@ - x Font loader calls must be assigned to a const - ,-[input.js:3:1] + ,-[input.js:4:1] 3 | 4 | export let firaCode = Abel() : ^^^^^^^^^^^^^^^^^^^^^ 5 | export var inter = Inter() `---- - x Font loader calls must be assigned to a const - ,-[input.js:4:1] + ,-[input.js:5:1] 4 | export let firaCode = Abel() 5 | export var inter = Inter() : ^^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/import-all/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/import-all/output.stderr index c9d0e143c7c65..29f3037013754 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/import-all/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/import-all/output.stderr @@ -1,4 +1,3 @@ - x Font loaders can't have namespace imports ,-[input.js:1:1] 1 | import * as googleFonts from '@next/font/google' diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/not-const/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/not-const/output.stderr index ed5d16a69239d..8f0e1a9873289 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/not-const/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/not-const/output.stderr @@ -1,14 +1,12 @@ - x Font loader calls must be assigned to a const - ,-[input.js:3:1] + ,-[input.js:4:1] 3 | var i = 10 4 | ,-> var inter1 = Inter({ 5 | | variant: '400', 6 | `-> }) `---- - x Font loader calls must be assigned to a const - ,-[input.js:8:1] + ,-[input.js:9:1] 8 | var i2 = 20 9 | ,-> let inter2 = Inter({ 10 | | variant: '400', diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/not-ident/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/not-ident/output.stderr index 340a93fdacd15..62157f0ebde5e 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/not-ident/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/not-ident/output.stderr @@ -1,14 +1,12 @@ - x Font loader calls must be assigned to an identifier - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | const { a } = Inter({ : ^^^^^ 4 | variant: '400', `---- - x Font loader calls must be assigned to an identifier - ,-[input.js:6:1] + ,-[input.js:7:1] 6 | 7 | const [b] = Inter({ : ^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/options-object/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/options-object/output.stderr index c9fee04e88d51..36b09340c1d91 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/options-object/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/options-object/output.stderr @@ -1,27 +1,23 @@ - x Unexpected object key type - ,-[input.js:3:1] + ,-[input.js:4:1] 3 | const a = fn({ 10: 'hello' }) 4 | const a = ABeeZee({ 10: 'hello' }) : ^^ `---- - x Font loader values must be explicitly written literals. - ,-[input.js:6:1] + ,-[input.js:7:1] 6 | const a = fn({ variant: [i1] }) 7 | const a = ABeeZee({ variant: [i1] }) : ^^ `---- - x Font loader values must be explicitly written literals. - ,-[input.js:9:1] + ,-[input.js:10:1] 9 | const a = fn({ variant: () => {} }) 10 | const a = ABeeZee({ variant: () => {} }) : ^^^^^^^^ `---- - x Unexpected spread - ,-[input.js:12:1] + ,-[input.js:13:1] 12 | const a = fn({ ...{} }) 13 | const a = ABeeZee({ ...{} }) : ^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/spread-arg/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/spread-arg/output.stderr index 056b0d732840e..a6b4c9fac7670 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/spread-arg/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/spread-arg/output.stderr @@ -1,13 +1,11 @@ - x Font loaders don't accept spreads - ,-[input.js:3:1] + ,-[input.js:4:1] 3 | const a = fn(...{}, ...[]) 4 | const inter = Inter(...{}, ...[]) : ^^^ `---- - x Font loaders don't accept spreads - ,-[input.js:3:1] + ,-[input.js:4:1] 3 | const a = fn(...{}, ...[]) 4 | const inter = Inter(...{}, ...[]) : ^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/wrong-scope/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/wrong-scope/output.stderr index 90014741c80ac..c7d161cfe8fa1 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/wrong-scope/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-font-loaders/wrong-scope/output.stderr @@ -1,36 +1,31 @@ - x Font loaders must be called and assigned to a const in the module scope - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | Aladin({}) : ^^^^^^ `---- - x Font loaders must be called and assigned to a const in the module scope - ,-[input.js:5:1] + ,-[input.js:6:1] 5 | let b 6 | const a = (b = Aladin({ variant: '400' })) : ^^^^^^ `---- - x Font loaders must be called and assigned to a const in the module scope - ,-[input.js:8:1] + ,-[input.js:9:1] 8 | function Hello() { 9 | const a = Aladin({ : ^^^^^^ 10 | variant: '400', `---- - x Font loaders must be called and assigned to a const in the module scope - ,-[input.js:15:1] + ,-[input.js:16:1] 15 | constructor() { 16 | Aladin({ : ^^^^^^ 17 | variant: '400', `---- - x Font loaders must be called and assigned to a const in the module scope - ,-[input.js:22:1] + ,-[input.js:23:1] 22 | { 23 | Aladin({}) : ^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/server-side-after-static-paths/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/server-side-after-static-paths/output.stderr index b163d5113c19c..50e0823286874 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/server-side-after-static-paths/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/server-side-after-static-paths/output.stderr @@ -1,6 +1,5 @@ - x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps - ,-[input.js:1:1] + ,-[input.js:2:1] 1 | export async function getStaticPaths() {} 2 | export const getServerSideProps = function getServerSideProps() {} : ^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/server-side-after-static-props/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/server-side-after-static-props/output.stderr index d687921cc6333..adb5d663f9199 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/server-side-after-static-props/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/server-side-after-static-props/output.stderr @@ -1,6 +1,5 @@ - x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps - ,-[input.js:1:1] + ,-[input.js:2:1] 1 | const getStaticProps = async () => {} 2 | export { a as getServerSideProps } : ^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/static-paths-after-server-side/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/static-paths-after-server-side/output.stderr index c3f625e1d175d..23225b8529fba 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/static-paths-after-server-side/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/static-paths-after-server-side/output.stderr @@ -1,6 +1,5 @@ - x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps - ,-[input.js:1:1] + ,-[input.js:2:1] 1 | export { a as getServerSideProps } from './input' 2 | export { getStaticPaths } from 'a' : ^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/static-props-after-server-side/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/static-props-after-server-side/output.stderr index 80e4cf6ecb2b6..191af48815b6a 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/static-props-after-server-side/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/next-ssg/static-props-after-server-side/output.stderr @@ -1,4 +1,3 @@ - x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps ,-[input.js:1:1] 1 | export { getStaticProps, getServerSideProps } diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/re-export-all-in-page/re-export-all/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/re-export-all-in-page/re-export-all/output.stderr index d2e7293e20855..adcdc0e97edac 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/re-export-all-in-page/re-export-all/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/re-export-all-in-page/re-export-all/output.stderr @@ -1,4 +1,3 @@ - x Using `export * from '...'` in a page is disallowed. Please use `export { default } from '...'` instead. | Read more: https://nextjs.org/docs/messages/export-all-in-page ,-[input.js:1:1] diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-server-side-props/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-server-side-props/output.stderr index 2a6c6cf938f4e..49cb5668652a9 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-server-side-props/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-server-side-props/output.stderr @@ -1,4 +1,3 @@ - x "getServerSideProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching | | diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-static-props/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-static-props/output.stderr index fff8d6a7aefc1..229a5bd0ad39a 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-static-props/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/get-static-props/output.stderr @@ -1,4 +1,3 @@ - x "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching | | diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/server-only/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/server-only/output.stderr index dd20fed59e9d6..8b5ddb457a90c 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/server-only/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/server-only/output.stderr @@ -1,9 +1,8 @@ - x You're importing a component that needs "server-only". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/ | react-essentials#server-components | | - ,-[input.js:8:1] + ,-[input.js:9:1] 8 | 9 | import 'server-only' : ^^^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/use-client/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/use-client/output.stderr index 016177a3a3ef9..838421b402fbc 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/use-client/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/use-client/output.stderr @@ -1,6 +1,5 @@ - x The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue. - ,-[input.js:3:1] + ,-[input.js:4:1] 3 | // prettier-ignore 4 | 'use client' : ^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/client-only/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/client-only/output.stderr index f9c57a024d9d0..f6e85a30041f9 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/client-only/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/client-only/output.stderr @@ -1,7 +1,6 @@ - x You're importing a component that imports client-only. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.\nLearn | more: https://nextjs.org/docs/getting-started/react-essentials\n\n - ,-[input.js:8:1] + ,-[input.js:9:1] 8 | 9 | import 'client-only' : ^^^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/fake-client-entry/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/fake-client-entry/output.stderr index b350bc863b3c2..e4bdd7d6c899c 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/fake-client-entry/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/fake-client-entry/output.stderr @@ -1,6 +1,5 @@ - x The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue. - ,-[input.js:5:1] + ,-[input.js:6:1] 5 | // prettier-ignore 6 | 'use client' : ^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/get-server-side-props/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/get-server-side-props/output.stderr index 2a6c6cf938f4e..49cb5668652a9 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/get-server-side-props/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/get-server-side-props/output.stderr @@ -1,4 +1,3 @@ - x "getServerSideProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching | | diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/get-static-props/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/get-static-props/output.stderr index fff8d6a7aefc1..229a5bd0ad39a 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/get-static-props/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/get-static-props/output.stderr @@ -1,4 +1,3 @@ - x "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching | | diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-api/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-api/output.stderr index f92341603eb1b..97c2923b80414 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-api/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-api/output.stderr @@ -1,4 +1,3 @@ - x You're importing a component that needs `useState`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components @@ -8,141 +7,129 @@ 1 | import { useState } from 'react' : ^^^^^^^^ `---- - x You're importing a component that needs `createContext`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | import { createContext } from 'react' : ^^^^^^^^^^^^^ `---- - x You're importing a component that needs `useEffect`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:4:1] + ,-[input.js:5:1] 4 | 5 | import { useEffect, useImperativeHandle } from 'react' : ^^^^^^^^^ `---- - x You're importing a component that needs `useImperativeHandle`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:4:1] + ,-[input.js:5:1] 4 | 5 | import { useEffect, useImperativeHandle } from 'react' : ^^^^^^^^^^^^^^^^^^^ `---- - x You’re importing a class component. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default. | Learn more: https://nextjs.org/docs/getting-started/react-essentials#client-components | | - ,-[input.js:7:1] + ,-[input.js:8:1] 7 | import { 8 | Component, : ^^^^^^^^^ 9 | createFactory, `---- - x You're importing a component that needs `createFactory`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:8:1] + ,-[input.js:9:1] 8 | Component, 9 | createFactory, : ^^^^^^^^^^^^^ 10 | PureComponent, `---- - x You're importing a component that needs `PureComponent`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:9:1] + ,-[input.js:10:1] 9 | createFactory, 10 | PureComponent, : ^^^^^^^^^^^^^ 11 | useDeferredValue, `---- - x You're importing a component that needs `useDeferredValue`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:10:1] + ,-[input.js:11:1] 10 | PureComponent, 11 | useDeferredValue, : ^^^^^^^^^^^^^^^^ 12 | useInsertionEffect, `---- - x You're importing a component that needs `useInsertionEffect`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:11:1] + ,-[input.js:12:1] 11 | useDeferredValue, 12 | useInsertionEffect, : ^^^^^^^^^^^^^^^^^^ 13 | useLayoutEffect, `---- - x You're importing a component that needs `useLayoutEffect`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:12:1] + ,-[input.js:13:1] 12 | useInsertionEffect, 13 | useLayoutEffect, : ^^^^^^^^^^^^^^^ 14 | useReducer, `---- - x You're importing a component that needs `useReducer`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:13:1] + ,-[input.js:14:1] 13 | useLayoutEffect, 14 | useReducer, : ^^^^^^^^^^ 15 | useRef, `---- - x You're importing a component that needs `useRef`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:14:1] + ,-[input.js:15:1] 14 | useReducer, 15 | useRef, : ^^^^^^ 16 | useSyncExternalStore, `---- - x You're importing a component that needs `useSyncExternalStore`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:15:1] + ,-[input.js:16:1] 15 | useRef, 16 | useSyncExternalStore, : ^^^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-dom-api/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-dom-api/output.stderr index 0f61e8ce4bb78..ac87b860a19d3 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-dom-api/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-dom-api/output.stderr @@ -1,4 +1,3 @@ - x You're importing a component that needs `flushSync`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components @@ -8,7 +7,6 @@ 1 | import { flushSync, unstable_batchedUpdates } from 'react-dom' : ^^^^^^^^^ `---- - x You're importing a component that needs `unstable_batchedUpdates`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components @@ -18,35 +16,32 @@ 1 | import { flushSync, unstable_batchedUpdates } from 'react-dom' : ^^^^^^^^^^^^^^^^^^^^^^^ `---- - x You're importing a component that needs `useActionState`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | import { useActionState } from 'react' : ^^^^^^^^^^^^^^ `---- - x You're importing a component that needs `useFormStatus`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:4:1] + ,-[input.js:5:1] 4 | 5 | import { useFormStatus, useFormState } from 'react-dom' : ^^^^^^^^^^^^^ `---- - x You're importing a component that needs `useFormState`. This React hook only works in a client component. To fix, mark the file (or its parent) with the `"use client"` directive. | | Learn more: https://nextjs.org/docs/app/building-your-application/rendering/client-components | | - ,-[input.js:4:1] + ,-[input.js:5:1] 4 | 5 | import { useFormStatus, useFormState } from 'react-dom' : ^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-dom-server-client/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-dom-server-client/output.stderr index 78d80e59c9d84..6574bfa66944f 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-dom-server-client/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/react-dom-server-client/output.stderr @@ -1,15 +1,13 @@ - x You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security. | Learn more: https://nextjs.org/docs/getting-started/react-essentials - ,-[input.js:8:1] + ,-[input.js:9:1] 8 | 9 | import 'react-dom/server' : ^^^^^^^^^^^^^^^^^^^^^^^^^ `---- - x You're importing a component that imports react-dom/client. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default. | \nLearn more: https://nextjs.org/docs/getting-started/react-essentials\n\n - ,-[input.js:10:1] + ,-[input.js:11:1] 10 | 11 | import 'react-dom/client' : ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.stderr index 25657d291a76d..d34a66e17e065 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.stderr @@ -1,10 +1,9 @@ - x It is not allowed to define inline "use server" annotated Server Actions in Client Components. | To use Server Actions in a Client Component, you can either export them from a separate file with "use server" at the top, or pass them down through props from a Server Component. | | Read more: https://nextjs.org/docs/app/api-reference/functions/server-actions#with-client-components | - ,-[input.js:4:1] + ,-[input.js:5:1] 4 | async function fn() { 5 | 'use server' : ^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.stderr index 5dd558a0d1b93..4607062ac9bc4 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.stderr @@ -1,6 +1,5 @@ - x Server actions must be async functions - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | export function foo() {} : ^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/10/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/10/output.stderr index b448d006fd91b..e76a4c3d79f13 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/10/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/10/output.stderr @@ -1,4 +1,3 @@ - x Did you mean "use server"? "use sevrer" is not a supported directive name. ,-[input.js:1:1] 1 | 'use sevrer' diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/11/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/11/output.stderr index e89591be0d662..fd5be2f092d5e 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/11/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/11/output.stderr @@ -1,6 +1,5 @@ - x The "use server" directive must be at the top of the file, and cannot be wrapped in parentheses. - ,-[input.js:1:1] + ,-[input.js:2:1] 1 | import 'react' 2 | ;('use sevrer') : ^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.stderr index e9d5040fa635a..4fe518ad86ba4 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.stderr @@ -1,6 +1,5 @@ - x It's not possible to have both `use client` and `use server` directives in the same file. - ,-[input.js:1:1] + ,-[input.js:2:1] 1 | 'use server' 2 | 'use client' : ^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.stderr index f2f0ef6b15393..3f1b4b26e5e75 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.stderr @@ -1,6 +1,5 @@ - x It's not possible to have both `use client` and `use server` directives in the same file. - ,-[input.js:5:1] + ,-[input.js:6:1] 5 | 6 | 'use server' : ^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/2/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/2/output.stderr index 06cf57cef68ae..ae7be1a235273 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/2/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/2/output.stderr @@ -1,6 +1,5 @@ - x Server actions must be async functions - ,-[input.js:6:1] + ,-[input.js:7:1] 6 | 7 | export function bar() {} : ^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/3/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/3/output.stderr index cf5f78ccc1760..e0d5f04f6f5e1 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/3/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/3/output.stderr @@ -1,6 +1,5 @@ - x Only async functions are allowed to be exported in a "use server" file. - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | export const x = 1 : ^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/4/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/4/output.stderr index d7c5c97c7a97f..e634633aff0e4 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/4/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/4/output.stderr @@ -1,6 +1,5 @@ - x Only async functions are allowed to be exported in a "use server" file. - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | ,-> export default class Component { 4 | | render() { diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/5/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/5/output.stderr index 297578f39c0d7..c7b517cf8855f 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/5/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/5/output.stderr @@ -1,6 +1,5 @@ - x Only async functions are allowed to be exported in a "use server" file. - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | export * from 'foo' : ^^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.stderr index 9e3b962193353..cef97723cbc3d 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.stderr @@ -1,6 +1,5 @@ - x Only async functions are allowed to be exported in a "use server" file. - ,-[input.js:2:1] + ,-[input.js:3:1] 2 | 3 | export default () => {} : ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/7/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/7/output.stderr index 29884aa70a6f9..2a8cbef025fc7 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/7/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/7/output.stderr @@ -1,4 +1,3 @@ - x Server actions must be async functions ,-[input.js:1:1] 1 | ,-> const foo = () => { diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/output.stderr index c4f7406218d3f..b140d8101af93 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/output.stderr @@ -1,6 +1,5 @@ - x The "use server" directive must be at the top of the function body. - ,-[input.js:9:1] + ,-[input.js:10:1] 9 | // prettier-ignore 10 | 'use server' : ^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/9/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/9/output.stderr index 2dc39c2900bde..2bac0206dab64 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/9/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/9/output.stderr @@ -1,6 +1,5 @@ - x The "use server" directive must be at the top of the file. - ,-[input.js:3:1] + ,-[input.js:4:1] 3 | // prettier-ignore 4 | 'use server' : ^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/server-side-after-static-paths/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/server-side-after-static-paths/output.stderr index b163d5113c19c..50e0823286874 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/server-side-after-static-paths/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/server-side-after-static-paths/output.stderr @@ -1,6 +1,5 @@ - x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps - ,-[input.js:1:1] + ,-[input.js:2:1] 1 | export async function getStaticPaths() {} 2 | export const getServerSideProps = function getServerSideProps() {} : ^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/server-side-after-static-props/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/server-side-after-static-props/output.stderr index ece6d54e2cd16..491194311e69a 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/server-side-after-static-props/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/server-side-after-static-props/output.stderr @@ -1,6 +1,5 @@ - x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps - ,-[input.js:1:1] + ,-[input.js:2:1] 1 | export const getStaticProps = async () => {} 2 | export { a as getServerSideProps } : ^^^^^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/static-paths-after-server-side/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/static-paths-after-server-side/output.stderr index c3f625e1d175d..23225b8529fba 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/static-paths-after-server-side/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/static-paths-after-server-side/output.stderr @@ -1,6 +1,5 @@ - x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps - ,-[input.js:1:1] + ,-[input.js:2:1] 1 | export { a as getServerSideProps } from './input' 2 | export { getStaticPaths } from 'a' : ^^^^^^^^^^^^^^ diff --git a/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/static-props-after-server-side/output.stderr b/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/static-props-after-server-side/output.stderr index 80e4cf6ecb2b6..191af48815b6a 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/static-props-after-server-side/output.stderr +++ b/packages/next-swc/crates/next-custom-transforms/tests/errors/strip-page-exports/static-props-after-server-side/output.stderr @@ -1,4 +1,3 @@ - x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps ,-[input.js:1:1] 1 | export { getStaticProps, getServerSideProps } diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture.rs b/packages/next-swc/crates/next-custom-transforms/tests/fixture.rs index e14ed2fba985d..72cac88b8563a 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture.rs +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture.rs @@ -27,7 +27,7 @@ use turbopack_binding::swc::{ core::{ common::{chain, comments::SingleThreadedComments, FileName, Mark, SyntaxContext}, ecma::{ - parser::{EsConfig, Syntax}, + parser::{EsSyntax, Syntax}, transforms::{ base::resolver, react::jsx, @@ -40,7 +40,7 @@ use turbopack_binding::swc::{ }; fn syntax() -> Syntax { - Syntax::Es(EsConfig { + Syntax::Es(EsSyntax { jsx: true, ..Default::default() }) @@ -247,16 +247,18 @@ fn page_config_fixture(input: PathBuf) { #[fixture("tests/fixture/relay/**/input.ts*")] fn relay_no_artifact_dir_fixture(input: PathBuf) { let output = input.parent().unwrap().join("output.js"); - let config = turbopack_binding::swc::custom_transform::relay::Config { - language: RelayLanguageConfig::TypeScript, - artifact_directory: Some(PathBuf::from("__generated__")), - ..Default::default() - }; + test_fixture( syntax(), &|_tr| { + let config = turbopack_binding::swc::custom_transform::relay::Config { + language: RelayLanguageConfig::TypeScript, + artifact_directory: Some(PathBuf::from("__generated__")), + ..Default::default() + }; + relay( - &config, + config.into(), FileName::Real(PathBuf::from("input.tsx")), current_dir().unwrap(), Some(PathBuf::from("src/pages")), diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js index af3a9326a47f7..3774f05f643a1 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js @@ -17,8 +17,6 @@ export default function App() { }, []); null; return
-

Hello World

-
; } diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js index 158dd50584b1d..7168bec29c03e 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js @@ -19,24 +19,16 @@ export default function FilterItemDropdown({ list }) { null; null; return
-
{ setOpenSelect(!openSelect); }} className="flex w-full items-center justify-between rounded border border-black/30 px-4 py-2 text-sm dark:border-white/30"> -
{active}
- -
- {openSelect &&
{ setOpenSelect(false); }} className="absolute z-40 w-full rounded-b-md bg-white p-4 shadow-md dark:bg-black"> - {list.map((item, i)=>)} -
} -
; } diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/3/output.js b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/3/output.js index f7bb8662266cb..10a98952dce63 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/3/output.js +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/3/output.js @@ -15,8 +15,6 @@ export default function App({ x }) { ()=>null ]; return
-

Hello World

-
; } diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js index fe84ce61e3181..ff5560e63f3e2 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js @@ -13,8 +13,6 @@ export default function App() { console.log('Hello World'); }); return
-

Hello World

-
; } diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/5/output.js b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/5/output.js index fe2211d46a481..d5f53832c08c1 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/5/output.js +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/5/output.js @@ -1,20 +1,12 @@ import { ClientComponent } from './ClientComponent'; export default async function Page() { return <> -
- This fixture is to assert where the bootstrap scripts and other required - scripts emit during SSR -
-
- -
- ; } diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js index 14fe5d7ef2aa4..d53bae0a0cded 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js @@ -19,8 +19,6 @@ export default function App() { console.log('Hello World'); }); return
-

Hello World

-
; } diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture/server-actions/server/18/output.js b/packages/next-swc/crates/next-custom-transforms/tests/fixture/server-actions/server/18/output.js index 64f30fef36004..739e46e844267 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture/server-actions/server/18/output.js +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture/server-actions/server/18/output.js @@ -5,25 +5,18 @@ const v1 = 'v1'; export function Item({ id1, id2 }) { const v2 = id2; return <> - - - ; } export async function $$ACTION_0($$ACTION_CLOSURE_BOUND) { diff --git a/packages/next-swc/crates/next-custom-transforms/tests/fixture/server-actions/server/19/output.js b/packages/next-swc/crates/next-custom-transforms/tests/fixture/server-actions/server/19/output.js index c4e797584c1ee..782675324993e 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/fixture/server-actions/server/19/output.js +++ b/packages/next-swc/crates/next-custom-transforms/tests/fixture/server-actions/server/19/output.js @@ -2,15 +2,11 @@ import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; export function Item({ value }) { return <> - - ; } export async function $$ACTION_0($$ACTION_CLOSURE_BOUND, value2) { diff --git a/packages/next-swc/crates/next-custom-transforms/tests/full.rs b/packages/next-swc/crates/next-custom-transforms/tests/full.rs index f99323085f173..a0a2bb784b777 100644 --- a/packages/next-swc/crates/next-custom-transforms/tests/full.rs +++ b/packages/next-swc/crates/next-custom-transforms/tests/full.rs @@ -2,14 +2,12 @@ use std::path::{Path, PathBuf}; use next_custom_transforms::chain_transforms::{custom_before_pass, TransformOptions}; use serde::de::DeserializeOwned; +use swc_core::ecma::parser::TsSyntax; use turbopack_binding::swc::{ core::{ base::Compiler, common::{comments::SingleThreadedComments, Mark}, - ecma::{ - parser::{Syntax, TsConfig}, - transforms::base::pass::noop, - }, + ecma::{parser::Syntax, transforms::base::pass::noop}, }, testing::{NormalizedOutput, Tester}, }; @@ -49,7 +47,7 @@ fn test(input: &Path, minify: bool) { } else { None }, - syntax: Some(Syntax::Typescript(TsConfig { + syntax: Some(Syntax::Typescript(TsSyntax { tsx: true, ..Default::default() })), diff --git a/packages/next/package.json b/packages/next/package.json index 4af0a87eeb189..437f544a59c78 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -205,7 +205,7 @@ "@types/ws": "8.2.0", "@vercel/ncc": "0.34.0", "@vercel/nft": "0.27.1", - "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240712.1", "acorn": "8.11.3", "amphtml-validator": "1.0.35", "anser": "1.4.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 029ab3b270967..5e633daa45910 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1114,8 +1114,8 @@ importers: specifier: 0.27.1 version: 0.27.1(encoding@0.1.13) '@vercel/turbopack-ecmascript-runtime': - specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3 - version: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3 + specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240712.1 + version: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240712.1 acorn: specifier: 8.11.3 version: 8.11.3 @@ -5106,8 +5106,8 @@ packages: resolution: {integrity: sha512-OTe0KE37F5Y2eTys6eMnfopC+P4qr2ooXUTFyFPTplYSPwowmFk/HLD1FXtbKLjqsIH0SgekcJWad+C5uX4nkg==} engines: {node: '>=16'} - '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3} + '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240712.1': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240712.1} version: 0.0.0 '@webassemblyjs/ast@1.11.6': @@ -19587,7 +19587,7 @@ snapshots: satori: 0.10.9 yoga-wasm-web: 0.3.3 - '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3': + '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240712.1': dependencies: '@types/node': 20.12.3 diff --git a/test/development/acceptance-app/ReactRefreshLogBox.test.ts b/test/development/acceptance-app/ReactRefreshLogBox.test.ts index c04ca77c4ed51..61d973e742bb2 100644 --- a/test/development/acceptance-app/ReactRefreshLogBox.test.ts +++ b/test/development/acceptance-app/ReactRefreshLogBox.test.ts @@ -234,18 +234,16 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => { } else { expect(source).toEqual(outdent` ./index.js - Error: - x Unexpected token. Did you mean \`{'}'}\` or \`}\`? - ,-[TEST_DIR/index.js:4:1] + Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`? + ,-[7:1] 4 |

lol

5 | div 6 | ) 7 | } : ^ \`---- - x Unexpected eof - ,-[TEST_DIR/index.js:4:1] + ,-[7:1] 4 |

lol

5 | div 6 | ) diff --git a/test/development/acceptance-app/rsc-build-errors.test.ts b/test/development/acceptance-app/rsc-build-errors.test.ts index f16c63315bf8e..cf3d62ecd5a59 100644 --- a/test/development/acceptance-app/rsc-build-errors.test.ts +++ b/test/development/acceptance-app/rsc-build-errors.test.ts @@ -345,23 +345,25 @@ describe('Error overlay - RSC build errors', () => { Learn more: https://nextjs.org/docs/getting-started/react-essentials#client-components" `) } else { - expect(next.normalizeTestDirContent(await session.getRedboxSource())) - .toMatchInlineSnapshot(` - "./app/server-with-errors/error-file/error.js - Error: - x TEST_DIR/app/server-with-errors/error-file/error.js must be a Client Component. Add the "use client" directive the top - | of the file to resolve this issue. - | Learn more: https://nextjs.org/docs/getting-started/react-essentials#client-components - | - | - ,-[TEST_DIR/app/server-with-errors/error-file/error.js:1:1] - 1 | export default function Error() {} - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - \`---- - - Import trace for requested module: - ./app/server-with-errors/error-file/error.js" - `) + await check(() => session.getRedboxSource(), /Add the "use client"/) + + // TODO: investigate flakey snapshot due to spacing below + // expect(next.normalizeTestDirContent(await session.getRedboxSource())) + // .toMatchInlineSnapshot(` + // "./app/server-with-errors/error-file/error.js + // Error: x TEST_DIR/app/server-with-errors/error-file/error.js must be a Client + // | Component. Add the "use client" directive the top of the file to resolve this issue. + // | Learn more: https://nextjs.org/docs/getting-started/react-essentials#client-components + // | + // | + // ,---- + // 1 | export default function Error() {} + // : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // \`---- + + // Import trace for requested module: + // ./app/server-with-errors/error-file/error.js" + // `) } await cleanup() @@ -378,7 +380,7 @@ describe('Error overlay - RSC build errors', () => { await session.patch('app/server-with-errors/error-file/error.js', '') await session.assertHasRedbox() - await check(() => session.getRedboxSource(), /must be a Client Component/) + await check(() => session.getRedboxSource(), /Add the "use client"/) // TODO: investigate flakey snapshot due to spacing below // expect(next.normalizeTestDirContent(await session.getRedboxSource())) diff --git a/test/development/acceptance/ReactRefreshLogBox-app-doc.test.ts b/test/development/acceptance/ReactRefreshLogBox-app-doc.test.ts index 17e656366be53..eec3ab6729ed5 100644 --- a/test/development/acceptance/ReactRefreshLogBox-app-doc.test.ts +++ b/test/development/acceptance/ReactRefreshLogBox-app-doc.test.ts @@ -108,29 +108,27 @@ describe.each(['default', 'turbo'])( `) } else { expect(source).toMatchInlineSnapshot(` - "./pages/_app.js - Error: - x Expression expected - ,-[TEST_DIR/pages/_app.js:1:1] - 1 | function MyApp({ Component, pageProps }) { - 2 | return <; - : ^ - 3 | } - 4 | export default MyApp - \`---- - - x Expression expected - ,-[TEST_DIR/pages/_app.js:1:1] - 1 | function MyApp({ Component, pageProps }) { - 2 | return <; - : ^^^^^^^^^ - 3 | } - 4 | export default MyApp - \`---- - - Caused by: - Syntax Error" - `) + "./pages/_app.js + Error: x Expression expected + ,-[2:1] + 1 | function MyApp({ Component, pageProps }) { + 2 | return <; + : ^ + 3 | } + 4 | export default MyApp + \`---- + x Expression expected + ,-[2:1] + 1 | function MyApp({ Component, pageProps }) { + 2 | return <; + : ^^^^^^^^^ + 3 | } + 4 | export default MyApp + \`---- + + Caused by: + Syntax Error" + `) } await session.patch( @@ -199,22 +197,21 @@ describe.each(['default', 'turbo'])( `) } else { expect(source).toMatchInlineSnapshot(` - "./pages/_document.js - Error: - x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key - ,-[TEST_DIR/pages/_document.js:1:1] - 1 | import Document, { Html, Head, Main, NextScript } from 'next/document' - 2 | - 3 | class MyDocument extends Document {{ - : ^ - 4 | static async getInitialProps(ctx) { - 5 | const initialProps = await Document.getInitialProps(ctx) - 6 | return { ...initialProps } - \`---- - - Caused by: - Syntax Error" - `) + "./pages/_document.js + Error: x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key + ,-[3:1] + 1 | import Document, { Html, Head, Main, NextScript } from 'next/document' + 2 | + 3 | class MyDocument extends Document {{ + : ^ + 4 | static async getInitialProps(ctx) { + 5 | const initialProps = await Document.getInitialProps(ctx) + 6 | return { ...initialProps } + \`---- + + Caused by: + Syntax Error" + `) } await session.patch( diff --git a/test/development/acceptance/ReactRefreshLogBox.test.ts b/test/development/acceptance/ReactRefreshLogBox.test.ts index 947bbcceb29e3..e4c3123679561 100644 --- a/test/development/acceptance/ReactRefreshLogBox.test.ts +++ b/test/development/acceptance/ReactRefreshLogBox.test.ts @@ -223,18 +223,16 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => { } else { expect(source).toMatchInlineSnapshot(` "./index.js - Error: - x Unexpected token. Did you mean \`{'}'}\` or \`}\`? - ,-[TEST_DIR/index.js:4:1] + Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`? + ,-[7:1] 4 |

lol

5 | div 6 | ) 7 | } : ^ \`---- - x Unexpected eof - ,-[TEST_DIR/index.js:4:1] + ,-[7:1] 4 |

lol

5 | div 6 | ) diff --git a/test/development/acceptance/error-recovery.test.ts b/test/development/acceptance/error-recovery.test.ts index 5381d6749f7a8..8ed0f025cbcd1 100644 --- a/test/development/acceptance/error-recovery.test.ts +++ b/test/development/acceptance/error-recovery.test.ts @@ -452,24 +452,23 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => { `) } else { expect(redboxSource).toMatchInlineSnapshot(` - "./index.js - Error: - x Expected '}', got '' - ,-[TEST_DIR/index.js:4:1] - 4 | i++ - 5 | throw Error('no ' + i) - 6 | }, 1000) - 7 | export default function FunctionNamed() { - : ^ - \`---- - - Caused by: - Syntax Error - - Import trace for requested module: - ./index.js - ./pages/index.js" - `) + "./index.js + Error: x Expected '}', got '' + ,-[7:1] + 4 | i++ + 5 | throw Error('no ' + i) + 6 | }, 1000) + 7 | export default function FunctionNamed() { + : ^ + \`---- + + Caused by: + Syntax Error + + Import trace for requested module: + ./index.js + ./pages/index.js" + `) } // Test that runtime error does not take over: @@ -490,24 +489,23 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => { `) } else { expect(redboxSource).toMatchInlineSnapshot(` - "./index.js - Error: - x Expected '}', got '' - ,-[TEST_DIR/index.js:4:1] - 4 | i++ - 5 | throw Error('no ' + i) - 6 | }, 1000) - 7 | export default function FunctionNamed() { - : ^ - \`---- - - Caused by: - Syntax Error - - Import trace for requested module: - ./index.js - ./pages/index.js" - `) + "./index.js + Error: x Expected '}', got '' + ,-[7:1] + 4 | i++ + 5 | throw Error('no ' + i) + 6 | }, 1000) + 7 | export default function FunctionNamed() { + : ^ + \`---- + + Caused by: + Syntax Error + + Import trace for requested module: + ./index.js + ./pages/index.js" + `) } await cleanup() diff --git a/test/development/acceptance/server-component-compiler-errors-in-pages.test.ts b/test/development/acceptance/server-component-compiler-errors-in-pages.test.ts index e567412b167f5..424e87f98bc6e 100644 --- a/test/development/acceptance/server-component-compiler-errors-in-pages.test.ts +++ b/test/development/acceptance/server-component-compiler-errors-in-pages.test.ts @@ -67,12 +67,11 @@ describe('Error Overlay for server components compiler errors in pages', () => { expect(next.normalizeTestDirContent(await session.getRedboxSource())) .toMatchInlineSnapshot(` "./components/Comp.js - Error: - x You're importing a component that needs "next/headers". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/ + Error: x You're importing a component that needs "next/headers". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/ | react-essentials#server-components | | - ,-[TEST_DIR/components/Comp.js:1:1] + ,-[1:1] 1 | import { cookies } from 'next/headers' : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | @@ -126,12 +125,11 @@ describe('Error Overlay for server components compiler errors in pages', () => { expect(next.normalizeTestDirContent(await session.getRedboxSource())) .toMatchInlineSnapshot(` "./components/Comp.js - Error: - x You're importing a component that needs "server-only". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/ + Error: x You're importing a component that needs "server-only". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/ | react-essentials#server-components | | - ,-[TEST_DIR/components/Comp.js:1:1] + ,-[1:1] 1 | import 'server-only' : ^^^^^^^^^^^^^^^^^^^^ 2 | @@ -184,12 +182,11 @@ describe('Error Overlay for server components compiler errors in pages', () => { expect(next.normalizeTestDirContent(await session.getRedboxSource())) .toMatchInlineSnapshot(` "./components/Comp.js - Error: - x You're importing a component that needs "unstable_after". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting- + Error: x You're importing a component that needs "unstable_after". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting- | started/react-essentials#server-components | | - ,-[TEST_DIR/components/Comp.js:1:1] + ,-[1:1] 1 | import { unstable_after } from 'next/server' : ^^^^^^^^^^^^^^ 2 | diff --git a/test/development/basic/hmr.test.ts b/test/development/basic/hmr.test.ts index 349fb1caab914..797f83052ab7c 100644 --- a/test/development/basic/hmr.test.ts +++ b/test/development/basic/hmr.test.ts @@ -17,7 +17,7 @@ import { createNext } from 'e2e-utils' import { NextInstance } from 'e2e-utils' import { outdent } from 'outdent' -describe.each([[''], ['/docs']])( +describe.each([['', '/docs']])( 'basic HMR, basePath: %p', (basePath: string) => { let next: NextInstance @@ -536,30 +536,28 @@ describe.each([[''], ['/docs']])( ) if (basePath === '' && !process.env.TURBOPACK) { expect(source).toMatchInlineSnapshot(` - "./pages/hmr/about2.js - Error: - x Unexpected token. Did you mean \`{'}'}\` or \`}\`? - ,-[TEST_DIR/pages/hmr/about2.js:4:1] - 4 |

This is the about page.

- 5 | div - 6 | ) - 7 | } - : ^ - \`---- - - x Unexpected eof - ,-[TEST_DIR/pages/hmr/about2.js:5:1] - 5 | div - 6 | ) - 7 | } - \`---- - - Caused by: - Syntax Error - - Import trace for requested module: - ./pages/hmr/about2.js" - `) + "./pages/hmr/about2.js + Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`? + ,-[7:1] + 4 |

This is the about page.

+ 5 | div + 6 | ) + 7 | } + : ^ + \`---- + x Unexpected eof + ,-[7:3] + 5 | div + 6 | ) + 7 | } + \`---- + + Caused by: + Syntax Error + + Import trace for requested module: + ./pages/hmr/about2.js" + `) } else if (basePath === '' && process.env.TURBOPACK) { expect(source).toMatchInlineSnapshot(` "./pages/hmr/about2.js:7:1 @@ -574,30 +572,28 @@ describe.each([[''], ['/docs']])( `) } else if (basePath === '/docs' && !process.env.TURBOPACK) { expect(source).toMatchInlineSnapshot(` - "./pages/hmr/about2.js - Error: - x Unexpected token. Did you mean \`{'}'}\` or \`}\`? - ,-[TEST_DIR/pages/hmr/about2.js:4:1] - 4 |

This is the about page.

- 5 | div - 6 | ) - 7 | } - : ^ - \`---- - - x Unexpected eof - ,-[TEST_DIR/pages/hmr/about2.js:5:1] - 5 | div - 6 | ) - 7 | } - \`---- - - Caused by: - Syntax Error - - Import trace for requested module: - ./pages/hmr/about2.js" - `) + "./pages/hmr/about2.js + Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`? + ,-[7:1] + 4 |

This is the about page.

+ 5 | div + 6 | ) + 7 | } + : ^ + \`---- + x Unexpected eof + ,-[7:3] + 5 | div + 6 | ) + 7 | } + \`---- + + Caused by: + Syntax Error + + Import trace for requested module: + ./pages/hmr/about2.js" + `) } else if (basePath === '/docs' && process.env.TURBOPACK) { expect(source).toMatchInlineSnapshot(` "./pages/hmr/about2.js:7:1 @@ -1011,18 +1007,17 @@ describe.each([[''], ['/docs']])( expect(next.normalizeTestDirContent(redboxSource)) .toMatchInlineSnapshot(` - "./components/parse-error.js - Error: - x Expression expected - ,-[./components/parse-error.js:1:1] - 1 | This - 2 | is - 3 | }}} - : ^ - 4 | invalid - 5 | js - " - `) + "./components/parse-error.js + Error: x Expression expected + ,-[3:1] + 1 | This + 2 | is + 3 | }}} + : ^ + 4 | invalid + 5 | js + " + `) } await next.patchFile(aboutPage, aboutContent)