1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-30 10:42:55 +01:00

build: fix doc-watch recipe

This commit is contained in:
Rob Ede 2024-06-30 18:45:38 +01:00
parent 4db4251b8f
commit 0b193c7106
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933

View File

@ -3,6 +3,7 @@ _list:
# Format workspace. # Format workspace.
fmt: fmt:
just --unstable --fmt
cargo +nightly fmt cargo +nightly fmt
fd --hidden --type=file --extension=md --extension=yml --exec-batch npx -y prettier --write fd --hidden --type=file --extension=md --extension=yml --exec-batch npx -y prettier --write
@ -17,7 +18,6 @@ msrv := ```
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/' | sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/'
``` ```
msrv_rustup := "+" + msrv msrv_rustup := "+" + msrv
non_linux_all_features_list := ``` non_linux_all_features_list := ```
cargo metadata --format-version=1 \ cargo metadata --format-version=1 \
| jq '.packages[] | select(.source == null) | .features | keys' \ | jq '.packages[] | select(.source == null) | .features | keys' \
@ -25,12 +25,7 @@ non_linux_all_features_list := ```
--arg exclusions "__tls,__compress,tokio-uring,io-uring,experimental-io-uring" \ --arg exclusions "__tls,__compress,tokio-uring,io-uring,experimental-io-uring" \
'add | unique | . - ($exclusions | split(",")) | join(",")' 'add | unique | . - ($exclusions | split(",")) | join(",")'
``` ```
all_crate_features := if os() == "linux" { "--all-features" } else { "--features='" + non_linux_all_features_list + "'" }
all_crate_features := if os() == "linux" {
"--all-features"
} else {
"--features='" + non_linux_all_features_list + "'"
}
[private] [private]
check-min: check-min:
@ -84,7 +79,8 @@ doc-set-workspace-crates:
#!/usr/bin/env bash #!/usr/bin/env bash
( (
echo "window.ALL_CRATES =" echo "window.ALL_CRATES ="
cargo metadata --format-version=1 | jq '[.packages[] | select(.source == null) | .name]' cargo metadata --format-version=1 \
| jq '[.packages[] | select(.source == null) | .targets | map(select(.doc) | .name)] | flatten'
echo ";" echo ";"
) > "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js" ) > "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js"
@ -101,11 +97,7 @@ update-readmes: && fmt
cd ./actix-multipart && cargo rdme --force cd ./actix-multipart && cargo rdme --force
cd ./actix-test && cargo rdme --force cd ./actix-test && cargo rdme --force
feature_combo_skip_list := if os() == "linux" { feature_combo_skip_list := if os() == "linux" { "__tls,__compress" } else { "__tls,__compress,experimental-io-uring" }
"__tls,__compress"
} else {
"__tls,__compress,experimental-io-uring"
}
# Checks compatibility of feature combinations. # Checks compatibility of feature combinations.
check-feature-combinations: check-feature-combinations:
@ -120,7 +112,7 @@ check-external-types-all toolchain="+nightly":
set -euo pipefail set -euo pipefail
exit=0 exit=0
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
if ! just check-external-types-manifest "$f" {{toolchain}}; then exit=1; fi if ! just check-external-types-manifest "$f" {{ toolchain }}; then exit=1; fi
echo echo
echo echo
done done
@ -133,9 +125,9 @@ check-external-types-all-table toolchain="+nightly":
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
echo echo
echo "Checking for $f" echo "Checking for $f"
just check-external-types-manifest "$f" {{toolchain}} --output-format=markdown-table just check-external-types-manifest "$f" {{ toolchain }} --output-format=markdown-table
done done
# Check for unintentional external type exposure on a crate. # Check for unintentional external type exposure on a crate.
check-external-types-manifest manifest_path toolchain="+nightly" *extra_args="": check-external-types-manifest manifest_path toolchain="+nightly" *extra_args="":
cargo {{toolchain}} check-external-types --manifest-path "{{manifest_path}}" {{extra_args}} cargo {{ toolchain }} check-external-types --manifest-path "{{ manifest_path }}" {{ extra_args }}