diff --git a/Cargo.lock b/Cargo.lock index 289b73496..5fcc8ac3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1620,7 +1620,6 @@ dependencies = [ "bpaf", "camino", "lock_api", - "ls-types", "pulldown-cmark", "schemars", "serde", diff --git a/Cargo.toml b/Cargo.toml index 78a6404ea..4afb3cb9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "codegen" -version = "0.1.0" -edition = "2024" +name = "codegen" +version = "0.1.0" +edition = "2024" description = "Crate used to generate pages from the Rust source code of Biome" -publish = false +publish = false [lib] name = "codegen" @@ -57,8 +57,6 @@ biome_string_case = { git = "https://github.com/biomejs/biome.git", rev = "1f308 biome_test_utils = { git = "https://github.com/biomejs/biome.git", rev = "1f30838b288bf317bf88c9247da029d9a394d009" } biome_text_edit = { git = "https://github.com/biomejs/biome.git", rev = "1f30838b288bf317bf88c9247da029d9a394d009" } bpaf = { version = "0.9.23", features = ["docgen"] } -# pin it because cargo keeps update it -ls-types = "=0.0.3" # If you update this library, be aware of the breaking changes camino = "1.2.2" # Needed to fix some weird dependency diff --git a/scripts/update-revision.sh b/scripts/update-revision.sh index 86ae79986..a9bca5846 100755 --- a/scripts/update-revision.sh +++ b/scripts/update-revision.sh @@ -18,10 +18,21 @@ jq ".devDependencies[\"@biomejs/wasm-web\"] = \"https://pkg.pr.new/biomejs/biome # Install dependencies pnpm install --no-frozen-lockfile -# Update the rev values for the biome dependencies -awk -v new_rev="$new_rev" '{gsub(/rev = "[^"]+"/, "rev = \"" new_rev "\""); print}' Cargo.toml >temp.toml && mv temp.toml Cargo.toml - -# Update Cargo.lock -cargo update +# Identify all top-level biome crates +biome_crates=$( + cargo tree --prefix none --depth 1 --format '{p}' \ + | grep '^biome_' \ + | awk '{print $1}' +) + +# Update each biome crate to point to the new revision +if [ -n "$biome_crates" ]; then + # shellcheck disable=SC2086 + set -- $biome_crates + cargo add \ + --git https://github.com/biomejs/biome.git \ + --rev "$new_rev" \ + "$@" +fi echo "Revision updated to $new_rev."