From 7156af01d7f8719c76163ff2cd80eb0987ec169a Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 16 Apr 2024 08:52:23 +0100 Subject: [PATCH] chore: tidy up dependencies (#2480) --- Cargo.lock | 45 ++++++++----------- Cargo.toml | 51 ++++++++++++---------- crates/biome_cli/Cargo.toml | 2 +- crates/biome_deserialize_macros/Cargo.toml | 4 +- crates/biome_diagnostics_macros/Cargo.toml | 6 +-- crates/biome_formatter_test/Cargo.toml | 2 +- crates/biome_markup/Cargo.toml | 2 +- crates/biome_rowan/Cargo.toml | 2 +- crates/biome_rowan/src/green/node_cache.rs | 19 +++++--- crates/biome_test_utils/Cargo.toml | 2 +- crates/biome_text_edit/Cargo.toml | 2 +- crates/tests_macros/Cargo.toml | 4 +- fuzz/Cargo.toml | 2 +- xtask/codegen/Cargo.toml | 2 +- xtask/contributors/Cargo.toml | 2 +- xtask/coverage/Cargo.toml | 6 +-- 16 files changed, 76 insertions(+), 77 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42470feb8c5c..b0e1ab68f973 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -872,7 +872,7 @@ dependencies = [ "biome_text_edit", "biome_text_size", "countme", - "hashbrown 0.12.3", + "hashbrown 0.14.3", "iai", "memoffset", "quickcheck", @@ -1040,7 +1040,7 @@ checksum = "efeab2975f8102de445dcf898856a638332403c50216144653a89aec22fd79e0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -2065,7 +2065,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -2378,9 +2378,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" dependencies = [ "unicode-ident", ] @@ -2770,7 +2770,7 @@ checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -2849,9 +2849,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.2.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" dependencies = [ "bstr 0.2.17", "unicode-segmentation", @@ -2936,9 +2936,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" dependencies = [ "proc-macro2", "quote", @@ -2963,7 +2963,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -2983,7 +2983,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -3095,7 +3095,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -3219,17 +3219,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -3253,9 +3242,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term 0.46.0", @@ -3268,7 +3257,7 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log 0.1.3", + "tracing-log", "tracing-serde", ] @@ -3280,7 +3269,7 @@ checksum = "65139ecd2c3f6484c3b99bc01c77afe21e95473630747c7aca525e78b0666675" dependencies = [ "nu-ansi-term 0.49.0", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", "tracing-subscriber", ] diff --git a/Cargo.toml b/Cargo.toml index cf0145c0ee71..20e362041a9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -152,30 +152,33 @@ biome_ungrammar = { path = "./crates/biome_ungrammar" } tests_macros = { path = "./crates/tests_macros" } # Crates needed in the workspace -bitflags = "2.5.0" -bpaf = { version = "0.9.9", features = ["derive"] } -countme = "3.0.1" -crossbeam = "0.8.4" -dashmap = "5.4.0" -ignore = "0.4.21" -indexmap = "1.9.3" -insta = "1.38.0" -lazy_static = "1.4.0" -oxc_resolver = "1.4.0" -quickcheck = "1.0.3" -quickcheck_macros = "1.0.0" -quote = { version = "1.0.36" } -rayon = "1.8.1" -regex = "1.10.4" -rustc-hash = "1.1.0" -schemars = { version = "0.8.12" } -serde = { version = "1.0.163", features = ["derive"] } -serde_json = "1.0.115" -smallvec = { version = "1.10.0", features = ["union", "const_new"] } -tokio = { version = "1.36.0" } -tracing = { version = "0.1.37", default-features = false, features = ["std"] } -unicode-bom = "2.0.3" - +bitflags = "2.5.0" +bpaf = { version = "0.9.9", features = ["derive"] } +countme = "3.0.1" +crossbeam = "0.8.4" +dashmap = "5.4.0" +ignore = "0.4.21" +indexmap = "1.9.3" +insta = "1.38.0" +lazy_static = "1.4.0" +oxc_resolver = "1.4.0" +proc-macro2 = "1.0.80" +quickcheck = "1.0.3" +quickcheck_macros = "1.0.0" +quote = "1.0.36" +rayon = "1.8.1" +regex = "1.10.4" +rustc-hash = "1.1.0" +schemars = { version = "0.8.12" } +serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.115" +similar = "2.5.0" +smallvec = { version = "1.10.0", features = ["union", "const_new"] } +syn = "1.0.109" +tokio = { version = "1.36.0" } +tracing = { version = "0.1.37", default-features = false, features = ["std"] } +tracing-subscriber = "0.3.18" +unicode-bom = "2.0.3" [profile.dev.package.biome_wasm] debug = true diff --git a/crates/biome_cli/Cargo.toml b/crates/biome_cli/Cargo.toml index ddf75e46c369..96b44dfc6a38 100644 --- a/crates/biome_cli/Cargo.toml +++ b/crates/biome_cli/Cargo.toml @@ -51,7 +51,7 @@ smallvec = { workspace = true } tokio = { workspace = true, features = ["io-std", "io-util", "net", "time", "rt", "sync", "rt-multi-thread", "macros"] } tracing = { workspace = true } tracing-appender = "0.2" -tracing-subscriber = { version = "0.3.16", features = ["env-filter", "json"] } +tracing-subscriber = { workspace = true, features = ["env-filter", "json"] } tracing-tree = "0.3.0" [target.'cfg(unix)'.dependencies] diff --git a/crates/biome_deserialize_macros/Cargo.toml b/crates/biome_deserialize_macros/Cargo.toml index 686bedb5c165..358ae05f8187 100644 --- a/crates/biome_deserialize_macros/Cargo.toml +++ b/crates/biome_deserialize_macros/Cargo.toml @@ -16,9 +16,9 @@ proc-macro = true [dependencies] biome_string_case = { workspace = true } proc-macro-error = { version = "1.0.4", default-features = false } -proc-macro2 = "1.0.63" +proc-macro2 = { workspace = true } quote = "1.0.14" -syn = { version = "1.0.85", features = ["extra-traits"] } +syn = { workspace = true, features = ["extra-traits"] } [lints] workspace = true diff --git a/crates/biome_diagnostics_macros/Cargo.toml b/crates/biome_diagnostics_macros/Cargo.toml index 33d2a5cd7977..a4a56009fddc 100644 --- a/crates/biome_diagnostics_macros/Cargo.toml +++ b/crates/biome_diagnostics_macros/Cargo.toml @@ -15,9 +15,9 @@ proc-macro = true [dependencies] proc-macro-error = { version = "1.0.4", default-features = false } -proc-macro2 = "1.0.63" -quote = "1.0.14" -syn = "1.0.85" +proc-macro2 = { workspace = true } +quote = { workspace = true } +syn = { workspace = true } [lints] workspace = true diff --git a/crates/biome_formatter_test/Cargo.toml b/crates/biome_formatter_test/Cargo.toml index f7f791f8662f..7281e16bced8 100644 --- a/crates/biome_formatter_test/Cargo.toml +++ b/crates/biome_formatter_test/Cargo.toml @@ -26,7 +26,7 @@ biome_service = { workspace = true } insta = { workspace = true, features = ["glob"] } serde = { version = "1", features = ["derive"] } serde_json = { workspace = true } -similar = "2.1.0" +similar = { workspace = true } similar-asserts = "1.2.0" [dev-dependencies] diff --git a/crates/biome_markup/Cargo.toml b/crates/biome_markup/Cargo.toml index 81f1a7fc6ffd..f40844b34f71 100644 --- a/crates/biome_markup/Cargo.toml +++ b/crates/biome_markup/Cargo.toml @@ -16,7 +16,7 @@ proc-macro = true [dependencies] proc-macro-error = { version = "1.0.4", default-features = false } -proc-macro2 = "1.0.63" +proc-macro2 = { workspace = true } quote = "1.0.14" [lints] diff --git a/crates/biome_rowan/Cargo.toml b/crates/biome_rowan/Cargo.toml index 5b588c2ed01b..b0ad371bb68c 100644 --- a/crates/biome_rowan/Cargo.toml +++ b/crates/biome_rowan/Cargo.toml @@ -14,7 +14,7 @@ version = "0.5.7" biome_text_edit = { workspace = true } biome_text_size = { workspace = true } countme = { workspace = true } -hashbrown = { version = "0.12.3", features = ["inline-more"], default-features = false } +hashbrown = { version = "0.14.3", features = ["inline-more"], default-features = false } memoffset = "0.8.0" rustc-hash = { workspace = true } serde = { workspace = true, optional = true } diff --git a/crates/biome_rowan/src/green/node_cache.rs b/crates/biome_rowan/src/green/node_cache.rs index cc35a6abe4a9..b5a21df40157 100644 --- a/crates/biome_rowan/src/green/node_cache.rs +++ b/crates/biome_rowan/src/green/node_cache.rs @@ -344,15 +344,22 @@ impl NodeCache { /// Removes nodes, tokens and trivia entries from the cache when their /// generation doesn't match the current generation of the whole cache pub(crate) fn sweep_cache(&mut self) { - self.nodes - .drain_filter(|node, _| node.node.generation() != self.generation); + let nodes = self + .nodes + .extract_if(|node, _| node.node.generation() != self.generation); + nodes.for_each(drop); - self.tokens - .drain_filter(|token, _| token.0.generation() != self.generation); + let tokens = self + .tokens + .extract_if(|token, _| token.0.generation() != self.generation); - self.trivia + tokens.for_each(drop); + + let trivia = self + .trivia .cache - .drain_filter(|trivia, _| trivia.0.generation() != self.generation); + .extract_if(|trivia, _| trivia.0.generation() != self.generation); + trivia.for_each(drop); } } diff --git a/crates/biome_test_utils/Cargo.toml b/crates/biome_test_utils/Cargo.toml index 208a087350f2..cb924b7b097f 100644 --- a/crates/biome_test_utils/Cargo.toml +++ b/crates/biome_test_utils/Cargo.toml @@ -26,7 +26,7 @@ biome_service = { workspace = true } countme = { workspace = true, features = ["enable"] } json_comments = "0.2.1" serde_json = { workspace = true } -similar = { version = "2.2.1" } +similar = { workspace = true } [lints] workspace = true diff --git a/crates/biome_text_edit/Cargo.toml b/crates/biome_text_edit/Cargo.toml index c1c6630271dd..a19726769abe 100644 --- a/crates/biome_text_edit/Cargo.toml +++ b/crates/biome_text_edit/Cargo.toml @@ -14,7 +14,7 @@ version = "0.5.7" biome_text_size = { workspace = true, features = ["serde"] } schemars = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"] } -similar = { version = "2.1.0", features = ["unicode"] } +similar = { workspace = true, features = ["unicode"] } [features] schemars = ["dep:schemars", "biome_text_size/schemars"] diff --git a/crates/tests_macros/Cargo.toml b/crates/tests_macros/Cargo.toml index aff37e26fa74..941739ceca60 100644 --- a/crates/tests_macros/Cargo.toml +++ b/crates/tests_macros/Cargo.toml @@ -17,6 +17,6 @@ proc-macro = true case = "1.0.0" globwalk = "0.8.1" proc-macro-error = "1.0.4" -proc-macro2 = "1.0.63" +proc-macro2 = { workspace = true } quote = "1.0.14" -syn = "2.0.37" +syn = "2.0.59" diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 92cb339f554e..18f00a11f500 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -26,7 +26,7 @@ biome_js_syntax = { path = "../crates/biome_js_syntax" } biome_json_formatter = { path = "../crates/biome_json_formatter" } biome_json_parser = { path = "../crates/biome_json_parser" } biome_service = { path = "../crates/biome_service" } -similar = { version = "2.2.1" } +similar = { workspace = true } # Prevent this from interfering with workspaces [workspace] diff --git a/xtask/codegen/Cargo.toml b/xtask/codegen/Cargo.toml index b208ce6a55ac..28bd201f61dd 100644 --- a/xtask/codegen/Cargo.toml +++ b/xtask/codegen/Cargo.toml @@ -11,7 +11,7 @@ case = "1.0.0" filetime = "0.2.15" fs_extra = "1.3.0" git2 = { version = "0.18.2", default-features = false } -proc-macro2 = { version = "1.0.63", features = ["span-locations"] } +proc-macro2 = { workspace = true, features = ["span-locations"] } pulldown-cmark = { version = "0.9", default-features = false, optional = true } quote = "1.0.14" serde = { workspace = true, optional = true } diff --git a/xtask/contributors/Cargo.toml b/xtask/contributors/Cargo.toml index 9278f5f4f783..718764bfc4c2 100644 --- a/xtask/contributors/Cargo.toml +++ b/xtask/contributors/Cargo.toml @@ -7,7 +7,7 @@ version = "0.0.0" [dependencies] html-escape = "0.2.11" pico-args = "0.5.0" -serde = { version = "1.0.133", features = ["derive"] } +serde = { workspace = true, features = ["derive"] } ureq = { version = "2.4.0", features = ["json"] } xtask = { path = '../', version = "0.0" } diff --git a/xtask/coverage/Cargo.toml b/xtask/coverage/Cargo.toml index bd2fd9e6b1f1..c41d2fb4b43f 100644 --- a/xtask/coverage/Cargo.toml +++ b/xtask/coverage/Cargo.toml @@ -19,11 +19,11 @@ indicatif = { version = "0.17.0", features = ["improved_unicode"] } once_cell = "1.9.0" pico-args = { version = "0.5.0", features = ["eq-separator"] } regex = "1.5.5" -serde = { version = "1.0.133", features = ["derive"] } -serde_json = "1.0.74" +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } serde_yaml = "0.9.31" tracing = { workspace = true } -tracing-subscriber = { version = "0.3.11", features = ["env-filter", "std"] } +tracing-subscriber = { workspace = true, features = ["env-filter", "std"] } walkdir = "2.3.2" xtask = { path = '../', version = "0.0" } yastl = "0.1.2"