diff --git a/.dprint.json b/.dprint.json index a5fd4486453167..90e0f40620f342 100644 --- a/.dprint.json +++ b/.dprint.json @@ -78,7 +78,7 @@ "tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs" ], "plugins": [ - "https://plugins.dprint.dev/typescript-0.95.9.wasm", + "https://plugins.dprint.dev/typescript-0.95.11.wasm", "https://plugins.dprint.dev/json-0.20.0.wasm", "https://plugins.dprint.dev/markdown-0.19.0.wasm", "https://plugins.dprint.dev/toml-0.7.0.wasm", diff --git a/Cargo.lock b/Cargo.lock index 1a2c855b21a82c..a1383c888b47d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,10 +7,6 @@ name = "Inflector" version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] [[package]] name = "addr2line" @@ -277,13 +273,12 @@ dependencies = [ [[package]] name = "ast_node" -version = "3.0.0" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fb5864e2f5bf9fd9797b94b2dfd1554d4c3092b535008b27d7e15c86675a2f" +checksum = "a1e2cddd48eafd883890770673b1971faceaf80a185445671abc3ea0c00593ee" dependencies = [ - "proc-macro2", "quote", - "swc_macros_common 1.0.0", + "swc_macros_common", "syn 2.0.87", ] @@ -529,9 +524,9 @@ checksum = "7dfdb4953a096c551ce9ace855a604d702e6e62d77fac690575ae347571717f5" [[package]] name = "better_scoped_tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50fd297a11c709be8348aec039c8b91de16075d2b2bdaee1bd562c0875993664" +checksum = "7cd228125315b132eed175bf47619ac79b945b26e56b848ba203ae4ea8603609" dependencies = [ "scoped-tls", ] @@ -726,9 +721,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" dependencies = [ "allocator-api2", ] @@ -767,9 +762,19 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytes-str" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "7c60b5ce37e0b883c37eb89f79a1e26fbe9c1081945d024eee93e8d91a7e18b3" +dependencies = [ + "bytes", + "serde", +] [[package]] name = "cache_control" @@ -1559,7 +1564,7 @@ dependencies = [ "deno_lint", "deno_lockfile", "deno_media_type", - "deno_npm 0.38.0", + "deno_npm", "deno_npm_cache", "deno_npm_installer", "deno_package_json", @@ -1675,9 +1680,9 @@ dependencies = [ [[package]] name = "deno_ast" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24158ccf7def38c00fd253fd1b48c8c6207214078fe499f47168763fa2445bf2" +checksum = "b80d223f51fb001a4100116ec14588d3798caca62e0c42cde7f91ef7c14c5925" dependencies = [ "base64 0.22.1", "capacity_builder", @@ -1687,7 +1692,6 @@ dependencies = [ "dprint-swc-ext", "percent-encoding", "serde", - "sourcemap", "swc_atoms", "swc_bundler", "swc_common", @@ -1696,6 +1700,7 @@ dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", "swc_ecma_codegen_macros", + "swc_ecma_lexer", "swc_ecma_loader", "swc_ecma_parser", "swc_ecma_transforms_base", @@ -1709,9 +1714,9 @@ dependencies = [ "swc_ecma_visit", "swc_eq_ignore_macros", "swc_graph_analyzer", - "swc_macros_common 1.0.0", + "swc_macros_common", + "swc_sourcemap", "swc_visit", - "swc_visit_macros", "text_lines", "thiserror 2.0.12", "unicode-width 0.2.0", @@ -1948,9 +1953,9 @@ dependencies = [ [[package]] name = "deno_doc" -version = "0.182.0" +version = "0.183.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40524290bb12aa652d84f452cede9d7fb186bf17d36704cb3b34cce8a99ecfa" +checksum = "02837b4ab5233d1ef04f2c6e328006999a368f2d0398c8ecad4f2a39c0cff918" dependencies = [ "anyhow", "cfg-if", @@ -2101,9 +2106,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.99.0" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956d3dbcbb44d1322ad1f0e862ef36bc46350c127347d8f528589d959fefd70d" +checksum = "158e28e9dea84cf648762e4a6892f15124bae85ef4e7934058587ec85bcc0e70" dependencies = [ "async-trait", "boxed_error", @@ -2246,7 +2251,7 @@ dependencies = [ "deno_fs", "deno_media_type", "deno_node", - "deno_npm 0.38.0", + "deno_npm", "deno_npm_installer", "deno_path_util", "deno_resolver", @@ -2270,9 +2275,9 @@ dependencies = [ [[package]] name = "deno_lint" -version = "0.77.0" +version = "0.78.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c163dfbcb2013b4666130bce517e49489110daf655d344e3219aeb09810868" +checksum = "1d1e154f4e9593637d1f340d35b6597e13cfe5cd10eb293ec1168d75a3007955" dependencies = [ "anyhow", "deno_ast", @@ -2467,27 +2472,6 @@ dependencies = [ "yoke", ] -[[package]] -name = "deno_npm" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01f393e78bf6a8d6c47663931f08d59a589620944c6a6a0d7e3862e883884ad" -dependencies = [ - "async-trait", - "capacity_builder", - "deno_error", - "deno_lockfile", - "deno_semver", - "futures", - "indexmap 2.9.0", - "log", - "monch", - "serde", - "serde_json", - "thiserror 2.0.12", - "url", -] - [[package]] name = "deno_npm" version = "0.38.0" @@ -2518,7 +2502,7 @@ dependencies = [ "boxed_error", "deno_cache_dir", "deno_error", - "deno_npm 0.38.0", + "deno_npm", "deno_path_util", "deno_semver", "deno_unsync", @@ -2553,7 +2537,7 @@ dependencies = [ "deno_error", "deno_graph", "deno_lockfile", - "deno_npm 0.38.0", + "deno_npm", "deno_npm_cache", "deno_package_json", "deno_path_util", @@ -2730,7 +2714,7 @@ dependencies = [ "deno_lockfile", "deno_maybe_sync", "deno_media_type", - "deno_npm 0.38.0", + "deno_npm", "deno_package_json", "deno_path_util", "deno_permissions", @@ -3188,7 +3172,7 @@ dependencies = [ "deno_error", "deno_lib", "deno_media_type", - "deno_npm 0.38.0", + "deno_npm", "deno_package_json", "deno_path_util", "deno_resolver", @@ -3530,9 +3514,9 @@ dependencies = [ [[package]] name = "dprint-plugin-typescript" -version = "0.95.10" +version = "0.95.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cbb60779bfcb1f133387838bfa06dc5362576270d67857de225e453b587ae2" +checksum = "74aa5df06eb156f7df91bf17a0ca65fd349dfa22463c3eab0a019bab20df12df" dependencies = [ "anyhow", "capacity_builder", @@ -3546,9 +3530,9 @@ dependencies = [ [[package]] name = "dprint-swc-ext" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a09827d6db1a3af25e105553d674ee9019be58fa3d6745c2a2803f8ce8e3eb8" +checksum = "48928f46665a21bca006dc9a02d1329143ef161f7347f2b9430b55519275db8a" dependencies = [ "allocator-api2", "bumpalo", @@ -3557,6 +3541,7 @@ dependencies = [ "swc_atoms", "swc_common", "swc_ecma_ast", + "swc_ecma_lexer", "swc_ecma_parser", "text_lines", ] @@ -3806,9 +3791,9 @@ dependencies = [ [[package]] name = "eszip" -version = "0.97.0" +version = "0.99.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4453f4b01d68a0c725157dc7ee8e9d01a8d602c8024334ea033075a0b2e0586" +checksum = "0805eb66d4e61a9c815ebcae3332c3cce47ad45e3797dd71695f724f02797d74" dependencies = [ "anyhow", "async-trait", @@ -3816,7 +3801,7 @@ dependencies = [ "deno_ast", "deno_error", "deno_graph", - "deno_npm 0.37.0", + "deno_npm", "deno_semver", "futures", "hashlink 0.8.4", @@ -4114,12 +4099,11 @@ checksum = "1bf664d6b0598fea5600b85cddc79e60d4c1f262f42faf75c2d77dc2164c9a8b" [[package]] name = "from_variant" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d7ccf961415e7aa17ef93dcb6c2441faaa8e768abe09e659b908089546f74c5" +checksum = "308530a56b099da144ebc5d8e179f343ad928fa2b3558d1eb3db9af18d6eff43" dependencies = [ - "proc-macro2", - "swc_macros_common 1.0.0", + "swc_macros_common", "syn 2.0.87", ] @@ -4741,14 +4725,13 @@ dependencies = [ [[package]] name = "hstr" -version = "1.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71399f53a92ef72ee336a4b30201c6e944827e14e0af23204c291aad9c24cc85" +checksum = "ced1416104790052518d199e753d49a7d8130d476c664bc9e53f40cfecb8e615" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", "once_cell", - "phf", "rustc-hash 2.1.1", "triomphe", ] @@ -6491,23 +6474,13 @@ dependencies = [ [[package]] name = "par-core" -version = "1.0.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b506ab63a8bd3cd38858c7bfc2d078a189dc3210c7f8c9be1bbaf50c082a0ae" +checksum = "e96cbd21255b7fb29a5d51ef38a779b517a91abd59e2756c039583f43ef4c90f" dependencies = [ "once_cell", ] -[[package]] -name = "par-iter" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a5b20f31e9ba82bfcbbb54a67aa40be6cebec9f668ba5753be138f9523c531a" -dependencies = [ - "either", - "par-core", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -6985,26 +6958,6 @@ dependencies = [ "cc", ] -[[package]] -name = "ptr_meta" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "pulldown-cmark" version = "0.11.2" @@ -7873,6 +7826,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "seq-macro" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" + [[package]] name = "serde" version = "1.0.219" @@ -8280,13 +8239,12 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "string_enum" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fe66b8ee349846ce2f9557a26b8f1e74843c4a13fb381f9a3d73617a5f956a" +checksum = "ae36a4951ca7bd1cfd991c241584a9824a70f6aff1e7d4f693fb3f2465e4030e" dependencies = [ - "proc-macro2", "quote", - "swc_macros_common 1.0.0", + "swc_macros_common", "syn 2.0.87", ] @@ -8363,42 +8321,38 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "swc_allocator" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b926f0d94bbb34031fe5449428cfa1268cdc0b31158d6ad9c97e0fc1e79dd" +checksum = "9d7eefd2c8b228a8c73056482b2ae4b3a1071fbe07638e3b55ceca8570cc48bb" dependencies = [ "allocator-api2", "bumpalo", "hashbrown 0.14.5", - "ptr_meta", "rustc-hash 2.1.1", - "triomphe", ] [[package]] name = "swc_atoms" -version = "5.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7077ba879f95406459bc0c81f3141c529b34580bc64d7ab7bd15e7118a0391" +checksum = "3500dcf04c84606b38464561edc5e46f5132201cb3e23cf9613ed4033d6b1bb2" dependencies = [ "hstr", "once_cell", - "rustc-hash 2.1.1", "serde", ] [[package]] name = "swc_bundler" -version = "17.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb953a99152e2a62f6b84d6c144fc4adf9c406093b093046e90a681a76d93dd" +checksum = "cfa7da378d583b2013549ad5596cde336d7a9bdba3ab6543b618e61efa3de174" dependencies = [ "anyhow", "crc", "indexmap 2.9.0", "is-macro", "once_cell", - "parking_lot", "petgraph 0.7.1", "radix_fmt", "relative-path", @@ -8419,14 +8373,14 @@ dependencies = [ [[package]] name = "swc_common" -version = "9.2.0" +version = "14.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56b6f5a8e5affa271b56757a93badee6f44defcd28f3ba106bb2603afe40d3d" +checksum = "63fdb58d278e7cd625f671e5371b3e6c0eab56c6e2a995a6f70dd0f7725255d4" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", - "cfg-if", + "bytes-str", "either", "from_variant", "new_debug_unreachable", @@ -8435,10 +8389,9 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "siphasher 0.3.11", - "sourcemap", - "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "tracing", "unicode-width 0.1.13", @@ -8447,11 +8400,12 @@ dependencies = [ [[package]] name = "swc_config" -version = "3.0.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01bfcbbdea182bdda93713aeecd997749ae324686bf7944f54d128e56be4ea9" +checksum = "d94f41e0f3c4c119a06af5e164674b63ae7eb6d7c1c60e46036c4a548f9fbe44" dependencies = [ "anyhow", + "bytes-str", "indexmap 2.9.0", "serde", "serde_json", @@ -8460,21 +8414,21 @@ dependencies = [ [[package]] name = "swc_config_macro" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2ebd37ef52a8555c8c9be78b694d64adcb5e3bc16c928f030d82f1d65fac57" +checksum = "7b416e8ce6de17dc5ea496e10c7012b35bbc0e3fef38d2e065eed936490db0b3" dependencies = [ "proc-macro2", "quote", - "swc_macros_common 1.0.0", + "swc_macros_common", "syn 2.0.87", ] [[package]] name = "swc_ecma_ast" -version = "9.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0613d84468a6bb6d45d13c5a3368b37bd21f3067a089f69adac630dcb462a018" +checksum = "65c25af97d53cf8aab66a6c68f3418663313fc969ad267fc2a4d19402c329be1" dependencies = [ "bitflags 2.8.0", "is-macro", @@ -8482,7 +8436,6 @@ dependencies = [ "once_cell", "phf", "rustc-hash 2.1.1", - "scoped-tls", "serde", "string_enum", "swc_atoms", @@ -8493,9 +8446,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "11.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01b3de365a86b8f982cc162f257c82f84bda31d61084174a3be37e8ab15c0f4" +checksum = "b91da8222bd2e868a6977ef402b3ca5c29a41d18cd84772441d9e06ec95ded1f" dependencies = [ "ascii", "compact_str", @@ -8504,42 +8457,41 @@ dependencies = [ "once_cell", "regex", "rustc-hash 2.1.1", + "ryu-js", "serde", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_codegen_macros", + "swc_sourcemap", "tracing", ] [[package]] name = "swc_ecma_codegen_macros" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99e1931669a67c83e2c2b4375674f6901d1480994a76aa75b23f1389e6c5076" +checksum = "e276dc62c0a2625a560397827989c82a93fd545fcf6f7faec0935a82cc4ddbb8" dependencies = [ "proc-macro2", - "quote", - "swc_macros_common 1.0.0", + "swc_macros_common", "syn 2.0.87", ] [[package]] name = "swc_ecma_lexer" -version = "12.0.0" +version = "23.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d11c8e71901401b9aae2ece4946eeb7674b14b8301a53768afbbeeb0e48b599" +checksum = "67c3bd958a5a67e2cc3f74abdd41fda688e54e7a25b866569260ef7018b67972" dependencies = [ "arrayvec", "bitflags 2.8.0", "either", - "new_debug_unreachable", "num-bigint", - "num-traits", "phf", "rustc-hash 2.1.1", + "seq-macro", "serde", "smallvec", "smartstring", @@ -8548,14 +8500,13 @@ dependencies = [ "swc_common", "swc_ecma_ast", "tracing", - "typed-arena", ] [[package]] name = "swc_ecma_loader" -version = "9.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb574d660c05f3483c984107452b386e45b95531bdb1253794077edc986f413" +checksum = "c675d14700c92f12585049b22b02356f1e142f4b0c32a4d0eb4b7a968a4c0c1e" dependencies = [ "anyhow", "pathdiff", @@ -8568,45 +8519,33 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "12.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250786944fbc05f6484eda9213df129ccfe17226ae9ad51b62fce2f72135dbee" +checksum = "9166873bb660bed50b5f422233537d3e946336398570a4a13e57d8c63d6a01c5" dependencies = [ - "arrayvec", - "bitflags 2.8.0", "either", - "new_debug_unreachable", "num-bigint", - "num-traits", - "phf", - "rustc-hash 2.1.1", "serde", - "smallvec", - "smartstring", - "stacker", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_lexer", "tracing", - "typed-arena", ] [[package]] name = "swc_ecma_transforms_base" -version = "13.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6856da3da598f4da001b7e4ce225ee8970bc9d5cbaafcaf580190cf0a6031ec5" +checksum = "9cc6454e1cf587b1d50509116350b503e7d647dbcc41bb5be9bf9a40fd792037" dependencies = [ "better_scoped_tls", - "bitflags 2.8.0", "indexmap 2.9.0", "once_cell", "par-core", "phf", "rustc-hash 2.1.1", "serde", - "smallvec", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -8618,11 +8557,10 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "13.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f84248f82bad599d250bbcd52cb4db6ff6409f48267fd6f001302a2e9716f80" +checksum = "c48790332195e4163f1f49713a14f91a5614048ca6638c664050fe577c3fad5a" dependencies = [ - "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_transforms_base", @@ -8632,22 +8570,23 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_macros" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6845dfb88569f3e8cd05901505916a8ebe98be3922f94769ca49f84e8ccec8f7" +checksum = "bc777288799bf6786e5200325a56e4fbabba590264a4a48a0c70b16ad0cf5cd8" dependencies = [ "proc-macro2", "quote", - "swc_macros_common 1.0.0", + "swc_macros_common", "syn 2.0.87", ] [[package]] name = "swc_ecma_transforms_optimization" -version = "14.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b14c8f6c1c82b7556d7534de44714401901fcb9b618f817172015565ce7d47" +checksum = "03594f8ddc69865b0835e2a8ff017bdc0becf6ef22e120f22eff7f52ddb849a0" dependencies = [ + "bytes-str", "dashmap", "indexmap 2.9.0", "once_cell", @@ -8660,7 +8599,6 @@ dependencies = [ "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", "swc_ecma_utils", "swc_ecma_visit", "tracing", @@ -8668,59 +8606,54 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "13.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193237e318421ef621c2b3958b4db174770c5280ef999f1878f2df93a2837ca6" +checksum = "3a1d5b2190c134d9b5c9b4d8c0d4b23b4fb5c433a7ae470f1c2103b8ff99160c" dependencies = [ "either", "rustc-hash 2.1.1", "serde", - "smallvec", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_transforms_base", "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", "swc_ecma_utils", "swc_ecma_visit", ] [[package]] name = "swc_ecma_transforms_react" -version = "15.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baae39c70229103a72090119887922fc5e32f934f5ca45c0423a5e65dac7e549" +checksum = "fc9a3fe915e9b4e289edc78f060b8edda8633bc44234c5cf167e359befa18267" dependencies = [ "base64 0.22.1", - "dashmap", + "bytes-str", "indexmap 2.9.0", "once_cell", "rustc-hash 2.1.1", "serde", "sha1", "string_enum", - "swc_allocator", "swc_atoms", "swc_common", "swc_config", "swc_ecma_ast", "swc_ecma_parser", "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", "swc_ecma_utils", "swc_ecma_visit", ] [[package]] name = "swc_ecma_transforms_typescript" -version = "15.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c65e0b49f7e2a2bd92f1d89c9a404de27232ce00f6a4053f04bda446d50e5c" +checksum = "2e62c7ec4f9667b9a85270125443fee6a7c2f357272d3d9eafc75a2f6fb0bca9" dependencies = [ - "once_cell", + "bytes-str", "rustc-hash 2.1.1", - "ryu-js", "serde", "swc_atoms", "swc_common", @@ -8733,15 +8666,14 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "13.1.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ed837406d5dbbfbf5792b1dc90964245a0cf659753d4745fe177ffebe8598b9" +checksum = "83259addd99ed4022aa9fc4d39428c008d3d42533769e1a005529da18cde4568" dependencies = [ "indexmap 2.9.0", "num_cpus", "once_cell", "par-core", - "par-iter", "rustc-hash 2.1.1", "ryu-js", "swc_atoms", @@ -8749,14 +8681,13 @@ dependencies = [ "swc_ecma_ast", "swc_ecma_visit", "tracing", - "unicode-id", ] [[package]] name = "swc_ecma_visit" -version = "9.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249dc9eede1a4ad59a038f9cfd61ce67845bd2c1392ade3586d714e7181f3c1a" +checksum = "75a579aa8f9e212af521588df720ccead079c09fe5c8f61007cf724324aed3a0" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -8769,9 +8700,9 @@ dependencies = [ [[package]] name = "swc_eq_ignore_macros" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96e15288bf385ab85eb83cff7f9e2d834348da58d0a31b33bdb572e66ee413e" +checksum = "c16ce73424a6316e95e09065ba6a207eba7765496fed113702278b7711d4b632" dependencies = [ "proc-macro2", "quote", @@ -8780,22 +8711,21 @@ dependencies = [ [[package]] name = "swc_graph_analyzer" -version = "10.0.0" +version = "14.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1920fdb0c0a79404f668fb194cbbffaf76d9fb31abd139bd397353d0cefb9e3c" +checksum = "a42314199595da31f253f6ea4dd3d67e9ed0a5745d0b07dad11de200b4ae9336" dependencies = [ "auto_impl", "petgraph 0.7.1", "rustc-hash 2.1.1", - "swc_common", "tracing", ] [[package]] name = "swc_macros_common" -version = "0.3.13" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f486687bfb7b5c560868f69ed2d458b880cebc9babebcb67e49f31b55c5bf847" +checksum = "aae1efbaa74943dc5ad2a2fb16cbd78b77d7e4d63188f3c5b4df2b4dcd2faaae" dependencies = [ "proc-macro2", "quote", @@ -8803,39 +8733,34 @@ dependencies = [ ] [[package]] -name = "swc_macros_common" -version = "1.0.0" +name = "swc_sourcemap" +version = "9.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a509f56fca05b39ba6c15f3e58636c3924c78347d63853632ed2ffcb6f5a0ac7" +checksum = "de08ef00f816acdd1a58ee8a81c0e1a59eefef2093aefe5611f256fa6b64c4d7" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", + "base64-simd", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "unicode-id-start", + "url", ] [[package]] name = "swc_visit" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9138b6a36bbe76dd6753c4c0794f7e26480ea757bee499738bedbbb3ae3ec5f3" +checksum = "62fb71484b486c185e34d2172f0eabe7f4722742aad700f426a494bb2de232a2" dependencies = [ "either", "new_debug_unreachable", ] -[[package]] -name = "swc_visit_macros" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92807d840959f39c60ce8a774a3f83e8193c658068e6d270dbe0a05e40e90b41" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "swc_macros_common 0.3.13", - "syn 2.0.87", -] - [[package]] name = "syn" version = "1.0.109" @@ -9613,12 +9538,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-id" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" - [[package]] name = "unicode-id-start" version = "1.2.0" diff --git a/Cargo.toml b/Cargo.toml index 2e2193a13ed0d1..5b5a73d1ff8cb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,14 +60,14 @@ license = "MIT" repository = "https://github.com/denoland/deno" [workspace.dependencies] -deno_ast = { version = "=0.49", features = ["transpiling"] } +deno_ast = { version = "=0.50.0", features = ["transpiling"] } deno_core = { version = "0.355.0" } deno_cache_dir = "=0.25.0" -deno_doc = "=0.182.0" +deno_doc = "=0.183.0" deno_error = "=0.7.0" -deno_graph = { version = "=0.99.0", default-features = false } -deno_lint = "=0.77.0" +deno_graph = { version = "=0.100.0", default-features = false } +deno_lint = "=0.78.0" deno_lockfile = "=0.31.2" deno_media_type = { version = "=0.2.9", features = ["module_specifier"] } deno_native_certs = "0.3.0" @@ -78,7 +78,7 @@ deno_task_shell = "=0.26.0" deno_terminal = "=0.2.2" deno_unsync = { version = "0.4.4", default-features = false } deno_whoami = "0.1.0" -eszip = "=0.97.0" +eszip = "=0.99.0" denokv_proto = "0.12.0" denokv_remote = "0.12.0" @@ -309,7 +309,7 @@ dprint-core = "=0.67.4" dprint-plugin-json = "=0.20.0" dprint-plugin-jupyter = "=0.2.0" dprint-plugin-markdown = "=0.19.0" -dprint-plugin-typescript = "=0.95.10" +dprint-plugin-typescript = "=0.95.11" env_logger = "=0.11.6" fancy-regex = "=0.14.0" libsui = "0.10.0" diff --git a/cli/tools/lint/mod.rs b/cli/tools/lint/mod.rs index c26b8e4a98bb63..197bb7c10526fa 100644 --- a/cli/tools/lint/mod.rs +++ b/cli/tools/lint/mod.rs @@ -662,11 +662,15 @@ fn resolve_lint_config( .for_specifier(specifier) .transpile_options()? .transpile; + let jsx_classic_options = + transpile_options.jsx.as_ref().and_then(|jsx| match jsx { + deno_ast::JsxRuntime::Classic(classic) => Some(classic), + _ => None, + }); Ok(deno_lint::linter::LintConfig { - default_jsx_factory: (!transpile_options.jsx_automatic) - .then(|| transpile_options.jsx_factory.clone()), - default_jsx_fragment_factory: (!transpile_options.jsx_automatic) - .then(|| transpile_options.jsx_fragment_factory.clone()), + default_jsx_factory: jsx_classic_options.map(|o| o.factory.clone()), + default_jsx_fragment_factory: jsx_classic_options + .map(|o| o.fragment_factory.clone()), }) } diff --git a/cli/tools/publish/module_content.rs b/cli/tools/publish/module_content.rs index 034d2c92d781a3..037bad99410729 100644 --- a/cli/tools/publish/module_content.rs +++ b/cli/tools/publish/module_content.rs @@ -1,5 +1,6 @@ // Copyright 2018-2025 the Deno authors. MIT license. +use std::borrow::Cow; use std::path::Path; use std::sync::Arc; @@ -26,9 +27,8 @@ use super::unfurl::SpecifierUnfurlerDiagnostic; use crate::sys::CliSys; struct JsxFolderOptions<'a> { - jsx_factory: &'a str, - jsx_fragment_factory: &'a str, jsx_runtime: &'static str, + jsx_classic: Option>, jsx_import_source: Option, jsx_import_source_types: Option, } @@ -206,18 +206,19 @@ impl ModuleContentProvider { import_source )); } - let is_classic = jsx_options.jsx_runtime == "classic"; - if is_classic && !leading_comments_has_re(&JSX_FACTORY_RE) { - add_text_change(format!( - "/** @jsxFactory {} */", - jsx_options.jsx_factory, - )); - } - if is_classic && !leading_comments_has_re(&JSX_FRAGMENT_FACTORY_RE) { - add_text_change(format!( - "/** @jsxFragmentFactory {} */", - jsx_options.jsx_fragment_factory, - )); + if let Some(classic_options) = &jsx_options.jsx_classic { + if !leading_comments_has_re(&JSX_FACTORY_RE) { + add_text_change(format!( + "/** @jsxFactory {} */", + classic_options.factory, + )); + } + if !leading_comments_has_re(&JSX_FRAGMENT_FACTORY_RE) { + add_text_change(format!( + "/** @jsxFragmentFactory {} */", + classic_options.fragment_factory, + )); + } } Ok(()) } @@ -232,12 +233,13 @@ impl ModuleContentProvider { self.compiler_options_resolver.for_specifier(specifier); let jsx_config = compiler_options.jsx_import_source_config()?; let transpile_options = &compiler_options.transpile_options()?.transpile; - let jsx_runtime = - if transpile_options.jsx_automatic || transpile_options.precompile_jsx { - "automatic" - } else { - "classic" - }; + let jsx_runtime = match &transpile_options.jsx { + Some( + deno_ast::JsxRuntime::Automatic(_) + | deno_ast::JsxRuntime::Precompile(_), + ) => "automatic", + None | Some(deno_ast::JsxRuntime::Classic(_)) => "classic", + }; let mut unfurl_import_source = |import_source: &str, referrer: &Url, resolution_kind: ResolutionKind| { let maybe_import_source = self @@ -270,10 +272,19 @@ impl ModuleContentProvider { ResolutionKind::Types, ) }); + let classic_options = match &transpile_options.jsx { + None => Some(Cow::Owned(deno_ast::JsxClassicOptions::default())), + Some(deno_ast::JsxRuntime::Classic(classic_options)) => { + Some(Cow::Borrowed(classic_options)) + } + Some( + deno_ast::JsxRuntime::Precompile(_) + | deno_ast::JsxRuntime::Automatic(_), + ) => None, + }; Ok(JsxFolderOptions { jsx_runtime, - jsx_factory: &transpile_options.jsx_factory, - jsx_fragment_factory: &transpile_options.jsx_fragment_factory, + jsx_classic: classic_options, jsx_import_source, jsx_import_source_types, }) diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs index 93c5975e3cea26..d8ee0288b422ce 100644 --- a/cli/tools/repl/session.rs +++ b/cli/tools/repl/session.rs @@ -3,6 +3,8 @@ use std::sync::Arc; use deno_ast::ImportsNotUsedAsValues; +use deno_ast::JsxAutomaticOptions; +use deno_ast::JsxClassicOptions; use deno_ast::ModuleKind; use deno_ast::ModuleSpecifier; use deno_ast::ParseDiagnosticsError; @@ -167,12 +169,6 @@ pub struct TsEvaluateResponse { pub value: cdp::EvaluateResponse, } -struct ReplJsxState { - factory: String, - frag_factory: String, - import_source: Option, -} - pub struct ReplSession { internal_object_id: Option, npm_installer: Option>, @@ -187,8 +183,8 @@ pub struct ReplSession { test_reporter_factory: Box Box>, /// This is only optional because it's temporarily taken when evaluating. test_event_receiver: Option, - jsx: ReplJsxState, - experimental_decorators: bool, + jsx: deno_ast::JsxRuntime, + decorators: deno_ast::DecoratorsTranspileOption, } impl ReplSession { @@ -255,11 +251,10 @@ impl ReplSession { cli_options.initial_cwd().to_string_lossy(), ) })?; - let experimental_decorators = compiler_options_resolver + let transpile_options = &compiler_options_resolver .for_specifier(&cwd_url) .transpile_options()? - .transpile - .use_ts_decorators; + .transpile; let mut repl_session = ReplSession { internal_object_id: None, npm_installer, @@ -282,12 +277,8 @@ impl ReplSession { }), main_module, test_event_receiver: Some(test_event_receiver), - jsx: ReplJsxState { - factory: "React.createElement".to_string(), - frag_factory: "React.Fragment".to_string(), - import_source: None, - }, - experimental_decorators, + jsx: transpile_options.jsx.clone().unwrap_or_default(), + decorators: transpile_options.decorators.clone(), }; // inject prelude @@ -671,19 +662,9 @@ impl ReplSession { let transpiled_src = parsed_source .transpile( &deno_ast::TranspileOptions { - use_ts_decorators: self.experimental_decorators, - use_decorators_proposal: !self.experimental_decorators, - emit_metadata: false, + decorators: self.decorators.clone(), imports_not_used_as_values: ImportsNotUsedAsValues::Preserve, - transform_jsx: true, - precompile_jsx: false, - precompile_jsx_skip_elements: None, - precompile_jsx_dynamic_props: None, - jsx_automatic: self.jsx.import_source.is_some(), - jsx_development: false, - jsx_factory: self.jsx.factory.clone(), - jsx_fragment_factory: self.jsx.frag_factory.clone(), - jsx_import_source: self.jsx.import_source.clone(), + jsx: Some(self.jsx.clone()), var_decl_imports: true, verbatim_module_syntax: false, }, @@ -721,15 +702,49 @@ impl ReplSession { } if let Some(jsx) = analyzed_pragmas.jsx { - self.jsx.factory = jsx.text; - self.jsx.import_source = None; + match &mut self.jsx { + deno_ast::JsxRuntime::Classic(jsx_classic_options) => { + jsx_classic_options.factory = jsx.text; + } + deno_ast::JsxRuntime::Automatic(_) + | deno_ast::JsxRuntime::Precompile(_) => { + self.jsx = deno_ast::JsxRuntime::Classic(JsxClassicOptions { + factory: jsx.text, + ..Default::default() + }); + } + } } if let Some(jsx_frag) = analyzed_pragmas.jsx_fragment { - self.jsx.frag_factory = jsx_frag.text; - self.jsx.import_source = None; + match &mut self.jsx { + deno_ast::JsxRuntime::Classic(jsx_classic_options) => { + jsx_classic_options.fragment_factory = jsx_frag.text; + } + deno_ast::JsxRuntime::Automatic(_) + | deno_ast::JsxRuntime::Precompile(_) => { + self.jsx = deno_ast::JsxRuntime::Classic(JsxClassicOptions { + fragment_factory: jsx_frag.text, + ..Default::default() + }); + } + } } if let Some(jsx_import_source) = analyzed_pragmas.jsx_import_source { - self.jsx.import_source = Some(jsx_import_source.text); + match &mut self.jsx { + deno_ast::JsxRuntime::Classic(_) => { + self.jsx = deno_ast::JsxRuntime::Automatic(JsxAutomaticOptions { + import_source: Some(jsx_import_source.text), + development: false, + }); + } + deno_ast::JsxRuntime::Automatic(automatic) + | deno_ast::JsxRuntime::Precompile(deno_ast::JsxPrecompileOptions { + automatic, + .. + }) => { + automatic.import_source = Some(jsx_import_source.text); + } + } } } diff --git a/libs/resolver/deno_json.rs b/libs/resolver/deno_json.rs index a10fda8fd0785b..bbca7bb7c52f98 100644 --- a/libs/resolver/deno_json.rs +++ b/libs/resolver/deno_json.rs @@ -1282,17 +1282,40 @@ fn compiler_options_to_transpile_and_emit_options( "error" => deno_ast::ImportsNotUsedAsValues::Error, _ => deno_ast::ImportsNotUsedAsValues::Remove, }; - let (transform_jsx, jsx_automatic, jsx_development, precompile_jsx) = - match overrides.preserve_jsx { - true => (false, false, false, false), - false => match options.jsx.as_str() { - "react" => (true, false, false, false), - "react-jsx" => (true, true, false, false), - "react-jsxdev" => (true, true, true, false), - "precompile" => (false, false, false, true), - _ => (false, false, false, false), - }, - }; + let jsx = match overrides.preserve_jsx { + true => None, + false => match options.jsx.as_str() { + "react" => { + Some(deno_ast::JsxRuntime::Classic(deno_ast::JsxClassicOptions { + factory: options.jsx_factory, + fragment_factory: options.jsx_fragment_factory, + })) + } + "react-jsx" => Some(deno_ast::JsxRuntime::Automatic( + deno_ast::JsxAutomaticOptions { + development: false, + import_source: options.jsx_import_source, + }, + )), + "react-jsxdev" => Some(deno_ast::JsxRuntime::Automatic( + deno_ast::JsxAutomaticOptions { + development: true, + import_source: options.jsx_import_source, + }, + )), + "precompile" => Some(deno_ast::JsxRuntime::Precompile( + deno_ast::JsxPrecompileOptions { + automatic: deno_ast::JsxAutomaticOptions { + development: false, + import_source: options.jsx_import_source, + }, + skip_elements: options.jsx_precompile_skip_elements, + dynamic_props: None, + }, + )), + _ => None, + }, + }; let source_map = if options.inline_source_map { deno_ast::SourceMapOption::Inline } else if options.source_map { @@ -1301,19 +1324,15 @@ fn compiler_options_to_transpile_and_emit_options( deno_ast::SourceMapOption::None }; let transpile = deno_ast::TranspileOptions { - use_ts_decorators: options.experimental_decorators, - use_decorators_proposal: !options.experimental_decorators, - emit_metadata: options.emit_decorator_metadata, + decorators: if options.experimental_decorators { + deno_ast::DecoratorsTranspileOption::LegacyTypeScript { + emit_metadata: options.emit_decorator_metadata, + } + } else { + deno_ast::DecoratorsTranspileOption::Ecma + }, imports_not_used_as_values, - jsx_automatic, - jsx_development, - jsx_factory: options.jsx_factory, - jsx_fragment_factory: options.jsx_fragment_factory, - jsx_import_source: options.jsx_import_source, - precompile_jsx, - precompile_jsx_skip_elements: options.jsx_precompile_skip_elements, - precompile_jsx_dynamic_props: None, - transform_jsx, + jsx, var_decl_imports: false, // todo(dsherret): support verbatim_module_syntax here properly verbatim_module_syntax: false, diff --git a/libs/resolver/emit.rs b/libs/resolver/emit.rs index 8b8c685a625a6f..320dbdb5f1bf4a 100644 --- a/libs/resolver/emit.rs +++ b/libs/resolver/emit.rs @@ -173,8 +173,7 @@ impl } let transpile_options = &transpile_and_emit_options.transpile; if matches!(provider.media_type(), MediaType::Jsx) - && !transpile_options.transform_jsx - && !transpile_options.precompile_jsx + && transpile_options.jsx.is_none() { // jsx disabled, so skip return Ok(provider.into_source()); @@ -237,10 +236,7 @@ impl return Ok(source.clone()); } let transpile_options = &transpile_and_emit_options.transpile; - if matches!(media_type, MediaType::Jsx) - && !transpile_options.transform_jsx - && !transpile_options.precompile_jsx - { + if matches!(media_type, MediaType::Jsx) && transpile_options.jsx.is_none() { // jsx disabled, so skip return Ok(source.clone()); } diff --git a/tests/specs/fmt/parse_error/check_parse_error.out b/tests/specs/fmt/parse_error/check_parse_error.out index 9854b6c9768bb2..9db3663ab34623 100644 --- a/tests/specs/fmt/parse_error/check_parse_error.out +++ b/tests/specs/fmt/parse_error/check_parse_error.out @@ -1,6 +1,6 @@ Error checking: [WILDCARD]parse_error.ts - Expected '{', got '' at [WILDCARD]parse_error.ts:2:7 + Expected '{', got '' at [WILDCARD]parse_error.ts:2:1 class Test - ~~~~ + ~~~~~ error: Found 1 not formatted file in 1 file diff --git a/tests/specs/fmt/parse_error/parse_error.out b/tests/specs/fmt/parse_error/parse_error.out index 0f63709589d70f..917ca2f2a4ea39 100644 --- a/tests/specs/fmt/parse_error/parse_error.out +++ b/tests/specs/fmt/parse_error/parse_error.out @@ -1,6 +1,6 @@ Error formatting: [WILDCARD]parse_error.ts - Expected '{', got '' at [WILDCARD]parse_error.ts:2:7 + Expected '{', got '' at [WILDCARD]parse_error.ts:2:1 class Test - ~~~~ + ~~~~~ error: Failed to format 1 of 1 checked file diff --git a/tests/specs/publish/no_check_surfaces_syntax_error/publish.out b/tests/specs/publish/no_check_surfaces_syntax_error/publish.out index 57969aeb796225..5d207e8042e5c9 100644 --- a/tests/specs/publish/no_check_surfaces_syntax_error/publish.out +++ b/tests/specs/publish/no_check_surfaces_syntax_error/publish.out @@ -1,8 +1,8 @@ Checking for slow types in the public API... error[syntax-error]: Expression expected - --> [WILDLINE]mod.ts:1:1 + --> [WILDLINE]mod.ts:1:2 | 1 | + - | ^ + | error: Found 1 problem diff --git a/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out b/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out index 2c9b97aa415e00..fd0a8cff0e2478 100644 --- a/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out +++ b/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out @@ -1,6 +1,4 @@ -error: The module's source code could not be parsed: Unexpected eof at [WILDCARD]/error_syntax_empty_trailing_line.mjs:3:1 +error: The module's source code could not be parsed: Expression expected at [WILDCARD]/error_syntax_empty_trailing_line.mjs:2:22 setTimeout(() => {}), - ~~~~~~~~~~~~~~~~~~~~~ - - ~ + ~