Small improvements

This commit is contained in:
Andras Schmelczer 2026-09-19 15:23:24 +01:00
commit 5624e51f52
4 changed files with 82 additions and 225 deletions

View file

@ -4,11 +4,11 @@ set -e
./scripts/utils/check-node.sh
cd docs
(
cd docs
npm ci
npm run format:check
npm run spell:check
npm run build
cd -
npm ci
npm run format:check
npm run spell:check
npm run build
)

View file

@ -25,13 +25,16 @@ else
fi
echo "Bumping sync-server versions"
cd sync-server
cargo set-version --bump $1
(
cd sync-server
cargo set-version --bump $1
)
echo "Bumping frontend versions"
cd ../frontend
npm version $1 --workspaces
cd ..
(
cd frontend
npm version $1 --workspaces
)
cp frontend/obsidian-plugin/manifest.json manifest.json # for BRAT, otherwise it wouldn't update

View file

@ -12,43 +12,42 @@ fi
echo "Running checks in sync-server"
cd sync-server
which sqlx || cargo install sqlx-cli
sqlx database create --database-url sqlite://db.sqlite3
sqlx migrate run --source src/app_state/database/migrations --database-url sqlite://db.sqlite3
(
cd sync-server
which sqlx || cargo install sqlx-cli
sqlx database create --database-url sqlite://db.sqlite3
sqlx migrate run --source src/app_state/database/migrations --database-url sqlite://db.sqlite3
cargo test --verbose
cargo test --verbose
if [[ "$FIX_MODE" == true ]]; then
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged
cargo fmt --all
else
cargo clippy --all-targets --all-features
cargo fmt --all -- --check
fi
if [[ "$FIX_MODE" == true ]]; then
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged
cargo fmt --all
else
cargo clippy --all-targets --all-features
cargo fmt --all -- --check
fi
which cargo-machete || cargo install cargo-machete
cargo machete --with-metadata
which cargo-machete || cargo install cargo-machete
cargo machete --with-metadata
)
cd ..
scripts/update-api-types.sh # this will dirty up the git state if not up-to-date
echo "Running checks in frontend"
cd frontend
(
cd frontend
if [[ "$FIX_MODE" == true ]]; then
npm install
else
npm ci
fi
if [[ "$FIX_MODE" == true ]]; then
npm install
else
npm ci
fi
cd ..
cd frontend
npm run build
npm run test
npm run lint
cd ..
npm run build
npm run test
npm run lint
)
# Format all files across the project (frontend and backend)
# Prettier respects .gitignore by default

View file

@ -21,8 +21,10 @@ mkdir -p logs
# Build and restart the server
echo "Building server..."
cd sync-server
cargo build --release
(
cd sync-server
cargo build --release
)
# Kill any existing server process
echo "Stopping existing server..."
@ -35,8 +37,12 @@ rm -rf /host/tmp/vaultlink-e2e-databases
# Start the server in the background
echo "Starting server..."
./target/release/sync_server config-e2e.yml &
server_pid=$!
(
cd sync-server
./target/release/sync_server config-e2e.yml &
echo $! > ../logs/server.pid
)
server_pid=$(cat logs/server.pid)
echo "Server started with PID: $server_pid"
# Ensure server is killed on script exit
@ -52,22 +58,22 @@ trap cleanup_server EXIT
cd ..
cd frontend
npm ci
npm run build
(
cd frontend
npm ci
npm run build
)
../scripts/utils/wait-for-server.sh
./scripts/utils/wait-for-server.sh
pids=()
for i in $(seq 1 $process_count); do
node test-client/dist/cli.js > "../logs/log_${i}.log" 2>&1 &
node frontend/test-client/dist/cli.js > "logs/log_${i}.log" 2>&1 &
pid=$!
pids+=($pid)
echo "Started process $i with PID: $pid (log: logs/log_${i}.log)"
done
cd ..
print_failed_log() {
for i in $(seq 1 $process_count); do
if [ -n "${pids[$i-1]}" ] && ! kill -0 ${pids[$i-1]} 2>/dev/null; then