-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
208 lines (164 loc) · 4.86 KB
/
Copy pathjustfile
File metadata and controls
208 lines (164 loc) · 4.86 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
# cor — JSON log colorizer
# https://github.com/alexsavio/cor-cli
# Build the project
build:
cargo build
# Build for release
build-release:
cargo build --release
# Install cor locally
install:
cargo install --path .
# Run all tests
test:
cargo test
# Run tests with output
test-verbose:
cargo test -- --nocapture
# Run specific test
test-one TEST:
cargo test {{TEST}} -- --nocapture
# Run benchmarks
bench:
cargo bench
# Run clippy linter
lint:
cargo clippy --all-targets --all-features -- -D warnings
# Auto-fix linting issues where possible
lint-fix:
cargo clippy --all-targets --all-features --fix
# Format code
format:
cargo fmt
rumdl fmt *.md
# Check formatting without modifying files
format-check:
cargo fmt -- --check
rumdl check *.md
# Run all quality checks
check: format-check lint test
# Generate documentation
doc:
cargo doc --no-deps --open
# Clean build artifacts
clean:
cargo clean
# Full clean and rebuild
rebuild: clean build
# Run the demo (colorized)
demo:
#!/usr/bin/env bash
set -euo pipefail
BIN="cargo run -q --"
echo "━━━ Default colorized output ━━━"
echo "$ cat assets/demo.jsonl | cor"
echo ""
cat assets/demo.jsonl | $BIN --color=always
echo ""
echo "━━━ Filter: warn and above ━━━"
echo "$ cat assets/demo.jsonl | cor --level warn"
echo ""
cat assets/demo.jsonl | $BIN --color=always --level warn
echo ""
echo "━━━ Include only specific fields ━━━"
echo "$ cat assets/demo.jsonl | cor -i method,path,status"
echo ""
cat assets/demo.jsonl | $BIN --color=always -i method,path,status
echo ""
echo "━━━ Exclude fields ━━━"
echo "$ cat assets/demo.jsonl | cor -e func,query"
echo ""
cat assets/demo.jsonl | $BIN --color=always -e func,query
echo ""
echo "━━━ JSON output (filtered) ━━━"
echo "$ cat assets/demo.jsonl | cor --json --level error"
echo ""
cat assets/demo.jsonl | $BIN --json --level error
echo ""
echo "━━━ Truncate long field values ━━━"
echo "$ cat assets/demo.jsonl | cor --max-field-length 20"
echo ""
cat assets/demo.jsonl | $BIN --color=always --max-field-length 20
# Generate demo screenshots (requires termshot)
screenshots:
scripts/demo-screenshots.sh
# Generate coverage report
coverage:
cargo tarpaulin --out Html --output-dir coverage
# Security audit
audit:
cargo audit
# Install development tools
dev-tools:
cargo install cargo-watch
cargo install cargo-tarpaulin
cargo install cargo-audit
cargo install git-cliff
cargo install rumdl
# Publish to crates.io (dry-run first)
publish-dry:
cargo publish --dry-run
# Publish to crates.io
publish: check
cargo publish
# =============================================================================
# Release Management
# =============================================================================
# Show current version
version:
@sed -n '/^\[package\]/,/^\[/{s/^version = "\(.*\)"/\1/p;}' Cargo.toml
# Generate/update CHANGELOG.md
changelog:
git-cliff -o CHANGELOG.md
# Preview changelog for next release (unreleased changes)
changelog-preview:
git-cliff --unreleased --strip header
# Compute next CalVer version (YYYY.MM.MICRO)
_next-version:
#!/usr/bin/env bash
set -euo pipefail
YEAR=$(date +%Y)
MONTH=$(date +%-m)
PREFIX="${YEAR}.${MONTH}"
CURRENT=$(sed -n '/^\[package\]/,/^\[/{s/^version = "\(.*\)"/\1/p;}' Cargo.toml)
if [[ "$CURRENT" == ${PREFIX}.* ]]; then
MICRO=${CURRENT##*.}
echo "${PREFIX}.$((MICRO + 1))"
else
echo "${PREFIX}.0"
fi
# Create a new release with explicit version
# Usage: just release 2026.2.1
release VERSION:
#!/usr/bin/env bash
set -euo pipefail
echo "📦 Releasing v{{VERSION}} (CalVer)"
# Update Cargo.toml version (only in [package] section)
sed -i '' '/^\[package\]/,/^\[/{s/^version = ".*"/version = "{{VERSION}}"/;}' Cargo.toml
# Ensure it compiles and passes checks
just check
# Update CHANGELOG.md
git-cliff --tag "v{{VERSION}}" -o CHANGELOG.md
rumdl fmt CHANGELOG.md
# Update Cargo.lock
cargo check
# Commit, tag, and push
git add Cargo.toml Cargo.lock CHANGELOG.md
git commit -m "chore: release v{{VERSION}}"
git tag "v{{VERSION}}"
git push
git push origin "v{{VERSION}}"
echo "✅ Released v{{VERSION}}"
echo " Run 'just publish' to push to crates.io"
# Create a new release with auto-computed CalVer version
release-next:
#!/usr/bin/env bash
set -euo pipefail
VERSION=$(just _next-version)
just release "$VERSION"
# =============================================================================
# Help
# =============================================================================
# Show help
help:
@just --list