-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathJustfile
More file actions
216 lines (172 loc) ยท 7.14 KB
/
Copy pathJustfile
File metadata and controls
216 lines (172 loc) ยท 7.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# Justfile for Crablet
# Minimal build
build-minimal:
cargo build --manifest-path ./crablet/Cargo.toml --no-default-features --features web
# Full build
build-full:
cargo build --manifest-path ./crablet/Cargo.toml --release
# Run tests
test:
cargo test --manifest-path ./crablet/Cargo.toml --locked --no-default-features --features web
# Run all tests
test-all:
cargo test --manifest-path ./crablet/Cargo.toml --locked --all-features
# Backend web suite used by CI
test-web:
cargo test --manifest-path ./crablet/Cargo.toml --locked --no-default-features --features web
# Backend doctests used by CI
test-doc:
cargo test --manifest-path ./crablet/Cargo.toml --locked --doc --no-default-features --features web
# Fast all-features compile validation
check-all-features:
cargo check --manifest-path ./crablet/Cargo.toml --locked --all-features
# Single local backend quality gate (no extra system tools required)
quality:
bash ./scripts/quality.sh
# Lint
lint:
cargo fmt --manifest-path ./crablet/Cargo.toml --all -- --check
cargo clippy --manifest-path ./crablet/Cargo.toml --locked --all-targets --no-default-features --features web -- -D warnings
# Audit
audit:
cargo audit --manifest-path ./crablet/Cargo.toml
cargo deny check --manifest-path ./crablet/Cargo.toml
# CI-oriented security audit
audit-ci:
cd ./crablet && cargo audit --no-fetch --stale
cd ./frontend && npm audit --omit=dev --audit-level=high
# Coverage
coverage:
mkdir -p ./crablet/coverage
cargo llvm-cov --manifest-path ./crablet/Cargo.toml --workspace --no-default-features --features web --html --output-dir ./crablet/coverage/html
# Generate LCOV report for CI-style gate checks
coverage-lcov:
mkdir -p ./crablet/coverage
cargo llvm-cov --manifest-path ./crablet/Cargo.toml --workspace --no-default-features --features web --lcov --output-path ./crablet/coverage/lcov.info
# Enforce the same LCOV threshold used in CI
coverage-gate threshold="80":
bash ./scripts/check_lcov_threshold.sh ./crablet/coverage/lcov.info {{threshold}} backend-web
# Frontend lint
frontend-lint:
cd ./frontend && npm run lint
# Frontend CI lint gate
frontend-lint-ci:
cd ./frontend && npm run lint:ci
# Frontend type check
frontend-typecheck:
cd ./frontend && npm run type-check
# Frontend tests
frontend-test:
cd ./frontend && npm run test:ci
# Frontend coverage report
frontend-coverage:
cd ./frontend && npm run test:coverage
# Frontend production build
frontend-build:
cd ./frontend && npm run build
# Local CI smoke check
ci-smoke:
just test-web
just test-doc
just check-all-features
just build-minimal
just frontend-lint-ci
just frontend-typecheck
just frontend-build
just frontend-test
# Validate the docker-compose wiring with CI-safe defaults
compose-validate:
NEO4J_PASSWORD=ci-password OPENAI_API_KEY=sk-test MOONSHOT_API_KEY=sk-test ZHIPU_API_KEY=sk-test OPENAI_API_BASE=https://api.openai.com/v1 OPENAI_MODEL_NAME=gpt-4o-mini docker compose -f docker-compose.yml config -q
# Reproduce the container build validation job locally
docker-check:
docker build -t crablet:ci .
# Full local CI/CD smoke check
ci-smoke-full:
just ci-smoke
just compose-validate
just docker-check
# Dev Server
dev:
cargo run --manifest-path ./crablet/Cargo.toml --no-default-features --features web -- serve-web --port 3000
# Docker Build
docker-build:
docker build -t crablet:latest .
# Up
up:
docker compose up -d
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Desktop (Tauri 2) โ ็ปไธไฝฟ็จ scripts/pack.sh
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Build sidecar binary (release, web-only)
desktop-sidecar:
cargo build --release -p crablet --no-default-features --features web
# Copy sidecar binary to desktop/binaries/ (auto-detect platform)
desktop-sidecar-copy: desktop-sidecar
mkdir -p desktop/binaries
#!/usr/bin/env bash
set -euo pipefail
os=$(uname -s)
arch=$(uname -m)
case "$os" in
Darwin)
target="aarch64-apple-darwin"
if [ "$arch" = "x86_64" ]; then target="x86_64-apple-darwin"; fi
;;
Linux)
target="x86_64-unknown-linux-gnu"
if [ "$arch" = "aarch64" ]; then target="aarch64-unknown-linux-gnu"; fi
;;
MINGW*|CYGWIN*|MSYS*)
target="x86_64-pc-windows-msvc"
;;
*)
target="unknown"
;;
esac
cp target/release/crablet "desktop/binaries/crablet-$target"
chmod +x "desktop/binaries/crablet-$target"
echo "Copied sidecar for $target"
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# ไธ้ฎๆๅ
ๅ
ฅๅฃ๏ผ็ปไธ่ๆฌ scripts/pack.sh๏ผ
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# ๅฎๆดๆๅ
๏ผๅ็ซฏโsidecarโTauriโ็ญพๅโDMG๏ผ
desktop-pack:
bash scripts/pack.sh
# ๅฟซ้ๆๅ
๏ผ่ทณ่ฟๅ็ซฏๆๅปบ๏ผ
desktop-pack-quick:
bash scripts/pack.sh --quick
# ๅชๆๅปบ .app๏ผไธๅ DMG๏ผ
desktop-pack-app:
bash scripts/pack.sh --app-only
# ๅชๅๅปบ DMG๏ผ้ๅ
ๆ .app๏ผ
desktop-pack-dmg:
bash scripts/pack.sh --dmg-only
# ๅช็ญพๅๅทฒๆ .app
desktop-pack-sign:
bash scripts/pack.sh --sign-only
# CI ๆจกๅผๆๅ
desktop-pack-ci:
bash scripts/pack.sh --ci
# Apple ๅ
ฌ่ฏ๏ผ้ๅ
ๅฎๆดๆๅ
+ ้
็ฝฎ ~/.crablet-notary.env๏ผ
desktop-notarize:
bash desktop/notarize-dmg.sh
# ็ๆฌๅทไธ่ดๆงๆฃๆฅ๏ผCI ็จ๏ผไธไฟฎๆนๆไปถ๏ผ
desktop-version-check:
bash scripts/sync-version.sh --check
# Dev mode: launch Tauri dev server with hot reload
desktop-dev:
cd desktop && cargo tauri dev
# Clean desktop build artifacts
desktop-clean:
rm -rf desktop/binaries desktop/gen target/release/bundle
# Quick check: verify desktop + sidecar compile without full build
desktop-check:
cargo check --manifest-path ./crablet/Cargo.toml --no-default-features --features web
cargo check --manifest-path ./desktop/Cargo.toml
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# General
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Clean
clean:
cargo clean --manifest-path ./crablet/Cargo.toml
docker compose down -v