forked from librefang/librefang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
199 lines (152 loc) · 5.12 KB
/
Copy pathjustfile
File metadata and controls
199 lines (152 loc) · 5.12 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
# LibreFang development commands — requires https://github.com/casey/just
set windows-shell := ["cmd", "/c"]
# Default: list available recipes
default:
@just --list
# Build all workspace libraries
build:
cargo build --workspace --lib
# Run all workspace tests
test:
cargo test --workspace
# Run clippy with strict warnings
lint:
cargo clippy --workspace --all-targets -- -D warnings
# Format all code
fmt:
cargo fmt --all
# Check formatting without modifying files
fmt-check:
cargo fmt --all -- --check
# Type-check the workspace
check:
cargo check --workspace
# Local CI simulation: build + test + clippy + web lint
ci:
cargo xtask ci
# Build and open workspace documentation
doc:
cargo doc --workspace --no-deps --open
# Build frontend targets (dashboard, web, docs)
build-web *ARGS:
cargo xtask build-web {{ARGS}}
# Build the React dashboard assets used by librefang-api
dashboard-build:
cargo xtask build-web --dashboard
# Start React dashboard in dev mode (requires API running on :4545)
dash:
cd crates/librefang-api/dashboard && pnpm install && pnpm dev
# Build desktop app (Tauri) — builds dashboard assets first (requires: cargo install tauri-cli)
desktop-build: dashboard-build
cargo tauri build -c crates/librefang-desktop/tauri.conf.json
# Start desktop app in dev mode (requires: cargo install tauri-cli)
desktop-dev: dashboard-build
cargo tauri dev -c crates/librefang-desktop/tauri.conf.json
# Build release CLI and install to ~/.librefang/bin
[unix]
install: dashboard-build
cargo build --profile release-local -p librefang-cli
mkdir -p ~/.librefang/bin
cp -f target/release-local/librefang ~/.librefang/bin/librefang
# Build release CLI, install binary and fresh dashboard to ~/.librefang
[unix]
install-full: dashboard-build
cargo build --profile release-local -p librefang-cli
mkdir -p ~/.librefang/bin
cp -f target/release-local/librefang ~/.librefang/bin/librefang
rm -rf ~/.librefang/dashboard
cp -r crates/librefang-api/static/react ~/.librefang/dashboard
cargo metadata --format-version 1 --no-deps 2>/dev/null | python3 -c "import sys,json; pkgs=json.load(sys.stdin)['packages']; print(next(p['version'] for p in pkgs if p['name']=='librefang-cli'))" > ~/.librefang/dashboard/.version
# Build release CLI and install to %USERPROFILE%\.librefang\bin (Windows)
[windows]
install: dashboard-build
cargo build --profile release-local -p librefang-cli
if not exist "%USERPROFILE%\.librefang\bin" mkdir "%USERPROFILE%\.librefang\bin"
copy /Y "target\release-local\librefang.exe" "%USERPROFILE%\.librefang\bin\librefang.exe"
# Remove build artifacts
clean:
cargo clean
# Synchronize crate versions
sync-versions *ARGS:
cargo xtask sync-versions {{ARGS}}
# Cut a release
release *ARGS:
cargo xtask release {{ARGS}}
# Generate CHANGELOG from merged PRs
changelog *ARGS:
cargo xtask changelog {{ARGS}}
# Run live integration tests
integration-test *ARGS:
cargo xtask integration-test {{ARGS}}
# Publish SDKs to npm/PyPI/crates.io
publish-sdks *ARGS:
cargo xtask publish-sdks {{ARGS}}
# Build release binaries for multiple platforms
dist *ARGS:
cargo xtask dist {{ARGS}}
# Build and optionally push Docker image
docker *ARGS:
cargo xtask docker {{ARGS}}
# Set up local development environment
setup *ARGS:
cargo xtask setup {{ARGS}}
# Generate test coverage report
coverage *ARGS:
cargo xtask coverage {{ARGS}}
# Audit dependencies for vulnerabilities and updates
deps *ARGS:
cargo xtask deps {{ARGS}}
# Run code generation (OpenAPI spec, etc.)
codegen *ARGS:
cargo xtask codegen {{ARGS}}
# Check for broken links in documentation
check-links *ARGS:
cargo xtask check-links {{ARGS}}
# Run criterion benchmarks
bench *ARGS:
cargo xtask bench {{ARGS}}
# Migrate agents from other frameworks
migrate *ARGS:
cargo xtask migrate {{ARGS}}
# Check/fix formatting (Rust + web)
fmt-all *ARGS:
cargo xtask fmt {{ARGS}}
# Clean all build artifacts
clean-all *ARGS:
cargo xtask clean-all {{ARGS}}
# Diagnose development environment issues
doctor *ARGS:
cargo xtask doctor {{ARGS}}
# Start dev environment (daemon + dashboard hot reload)
dev *ARGS:
cargo xtask dev {{ARGS}}
# Database management (info, backup, reset)
db *ARGS:
cargo xtask db {{ARGS}}
# Check dependency licenses
license-check *ARGS:
cargo xtask license-check {{ARGS}}
# Code statistics (lines of code, dependency graph)
loc *ARGS:
cargo xtask loc {{ARGS}}
# Update dependencies (Rust + web)
update-deps *ARGS:
cargo xtask update-deps {{ARGS}}
# Validate config.toml
validate-config *ARGS:
cargo xtask validate-config {{ARGS}}
# Run pre-commit checks (fmt + clippy + test)
pre-commit *ARGS:
cargo xtask pre-commit {{ARGS}}
# Generate API docs from OpenAPI spec
api-docs *ARGS:
cargo xtask api-docs {{ARGS}}
# Generate contributors + star history SVGs
contributors *ARGS:
cargo xtask contributors {{ARGS}}
# Publish CLI binaries to npm
publish-npm-binaries *ARGS:
cargo xtask publish-npm-binaries {{ARGS}}
# Publish CLI wheels to PyPI
publish-pypi-binaries *ARGS:
cargo xtask publish-pypi-binaries {{ARGS}}