Skip to content

Commit 14b7357

Browse files
authored
chore(workspace): Touchup Justfile (#124)
* rm: justfile * add: Justfile * chore(workspace): touchup justfile Add aliases, comments, and proper recipe descriptions. Use npx to auto-install biome when needed instead of npm install.
1 parent 603f6b2 commit 14b7357

File tree

1 file changed

+39
-26
lines changed

1 file changed

+39
-26
lines changed

justfile renamed to Justfile

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,52 @@
1-
### DEVELOPMENT COMMANDS ###
1+
set positional-arguments
2+
3+
alias f := fix
4+
alias c := ci
5+
6+
# Default to display help menu
7+
default:
8+
@just --list
9+
10+
# Runs all ci checks
211
ci:
3-
# Rust
412
cargo fmt --all -- --check
513
cargo clippy -- -D warnings
614
cargo build
715
cargo test
8-
# UI
9-
cd ui && npm run lint
16+
cd ui && npx --yes @biomejs/biome check .
1017
cd ui && npm run build
1118

19+
# Fixes formatting and clippy issues
1220
fix:
13-
# Rust
1421
cargo fmt --all
1522
cargo clippy --fix --allow-dirty --allow-staged
16-
# UI
17-
cd ui && npx biome check --write --unsafe
23+
cd ui && npx --yes @biomejs/biome check --write --unsafe .
1824

19-
sync: deps-reset
20-
### ENV ###
21-
just sync-env
22-
### REFORMAT ###
23-
just fix
25+
# Resets dependencies and reformats code
26+
sync: deps-reset sync-env fix
2427

28+
# Copies environment templates and adapts for docker
2529
sync-env:
2630
cp .env.example .env
2731
cp .env.example ./ui/.env
2832
cp .env.example .env.docker
29-
# Change kafka ports
3033
sed -i '' 's/localhost:9092/host.docker.internal:9094/g' ./.env.docker
31-
# Change other dependencies
3234
sed -i '' 's/localhost/host.docker.internal/g' ./.env.docker
3335

36+
# Stops and removes all docker containers and data
3437
stop-all:
3538
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && docker compose down && docker compose rm && rm -rf data/
3639

37-
# Start every service running in docker, useful for demos
40+
# Starts all services in docker, useful for demos
3841
start-all: stop-all
3942
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && mkdir -p data/kafka data/minio && docker compose build && docker compose up -d
4043

41-
# Start every service in docker, except the one you're currently working on. e.g. just start-except ui ingress-rpc
44+
# Starts docker services except specified ones, e.g. just start-except ui ingress-rpc
4245
start-except programs: stop-all
4346
#!/bin/bash
4447
all_services=(kafka kafka-setup minio minio-setup ingress-rpc audit ui)
4548
exclude_services=({{ programs }})
46-
49+
4750
# Create result array with services not in exclude list
4851
result_services=()
4952
for service in "${all_services[@]}"; do
@@ -58,28 +61,34 @@ start-except programs: stop-all
5861
result_services+=("$service")
5962
fi
6063
done
61-
64+
6265
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && mkdir -p data/kafka data/minio && docker compose build && docker compose up -d ${result_services[@]}
6366

64-
### RUN SERVICES ###
67+
# Resets docker dependencies with clean data
6568
deps-reset:
6669
COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml docker compose down && docker compose rm && rm -rf data/ && mkdir -p data/kafka data/minio && docker compose up -d
6770

71+
# Restarts docker dependencies without data reset
6872
deps:
6973
COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml docker compose down && docker compose rm && docker compose up -d
7074

75+
# Runs the tips-audit service
7176
audit:
7277
cargo run --bin tips-audit
7378

79+
# Runs the tips-ingress-rpc service
7480
ingress-rpc:
7581
cargo run --bin tips-ingress-rpc
7682

83+
# Runs the tips-maintenance service
7784
maintenance:
7885
cargo run --bin tips-maintenance
7986

87+
# Runs the tips-ingress-writer service
8088
ingress-writer:
8189
cargo run --bin tips-ingress-writer
8290

91+
# Starts the UI development server
8392
ui:
8493
cd ui && yarn dev
8594

@@ -88,6 +97,13 @@ validator_url := "http://localhost:8549"
8897
builder_url := "http://localhost:2222"
8998
ingress_url := "http://localhost:8080"
9099

100+
sender := "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
101+
sender_key := "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
102+
103+
backrunner := "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
104+
backrunner_key := "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"
105+
106+
# Queries block numbers from sequencer, validator, and builder
91107
get-blocks:
92108
echo "Sequencer"
93109
cast bn -r {{ sequencer_url }}
@@ -96,12 +112,7 @@ get-blocks:
96112
echo "Builder"
97113
cast bn -r {{ builder_url }}
98114

99-
sender := "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
100-
sender_key := "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
101-
102-
backrunner := "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
103-
backrunner_key := "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"
104-
115+
# Sends a test transaction through the ingress endpoint
105116
send-txn:
106117
#!/usr/bin/env bash
107118
set -euxo pipefail
@@ -112,6 +123,7 @@ send-txn:
112123
cast receipt $hash -r {{ sequencer_url }} | grep status
113124
cast receipt $hash -r {{ builder_url }} | grep status
114125

126+
# Sends a transaction with a backrun bundle
115127
send-txn-with-backrun:
116128
#!/usr/bin/env bash
117129
set -euxo pipefail
@@ -176,6 +188,7 @@ send-txn-with-backrun:
176188
echo "=== Backrun transaction (from backrunner) ==="
177189
cast receipt $backrun_hash_computed -r {{ sequencer_url }} | grep -E "(status|blockNumber|transactionIndex)" || echo "Backrun tx not found yet"
178190

191+
# Runs integration tests with infrastructure checks
179192
e2e:
180193
#!/bin/bash
181194
if ! INTEGRATION_TESTS=1 cargo test --package tips-system-tests --test integration_tests; then
@@ -191,4 +204,4 @@ e2e:
191204
fi
192205
echo "═══════════════════════════════════════════════════════════════════"
193206
echo " ✅ Integration tests passed!"
194-
echo "═══════════════════════════════════════════════════════════════════"
207+
echo "═══════════════════════════════════════════════════════════════════"

0 commit comments

Comments
 (0)