-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
163 lines (132 loc) · 4.68 KB
/
Copy pathjustfile
File metadata and controls
163 lines (132 loc) · 4.68 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
# Pomotoro Development Commands
# List all available commands (default)
default:
@just --list
# ==============================================================================
# Development & Building
# ==============================================================================
# Run development server (starts Vite + Tauri together)
dev: (_dev "info")
# Run development server with debug-level logging
dev-debug: (_dev "debug")
# Run development server with trace-level logging (very verbose)
dev-trace: (_dev "trace")
# (private) Shared dev recipe — starts Vite then launches Tauri.
# `npm run dev` spawns `sh -> vite` as children; killing just npm leaves vite
# orphaned and still bound to port 5173 (strictPort), which makes the next
# `just dev` fail with "port already in use" — e.g. after quitting the app from
# the tray (app.exit terminates Tauri but not the npm child tree).
# `setsid` creates a new session so we can kill the whole process group on
# Linux; on macOS (where `setsid` is unavailable) we fall back to freeing the
# port directly via `lsof`.
_dev level:
#!/usr/bin/env bash
set -e
ROOT="{{justfile_directory()}}"
VITE_CMD="cd \"$ROOT/apps/react-ui\" && npm install --silent 2>/dev/null && npm run dev"
if command -v setsid >/dev/null 2>&1; then
setsid bash -c "$VITE_CMD" &
else
bash -c "$VITE_CMD" &
fi
VITE_PID=$!
cleanup() {
kill "$VITE_PID" 2>/dev/null || true
pkill -P "$VITE_PID" 2>/dev/null || true
if command -v lsof >/dev/null 2>&1; then
lsof -ti:5173 2>/dev/null | xargs kill 2>/dev/null || true
fi
}
trap cleanup EXIT INT TERM
cd "$ROOT/apps/tauri-app" && RUST_LOG="{{level}}" cargo tauri dev
# Build for production (builds React UI first, then Tauri app)
build: clippy fmt-check build-react
cd apps/tauri-app && cargo tauri build
# Build React UI frontend only
build-react:
cd apps/react-ui && npm run build
# Run React UI dev server only (without Tauri)
serve-react:
cd apps/react-ui && npm run dev
# Install React UI npm dependencies
install-react:
cd apps/react-ui && npm install
# Build just the framework-agnostic core
build-core:
cargo build -p infra -p domain -p usecases
# ==============================================================================
# Testing & Quality
# ==============================================================================
# Run all tests
test:
cargo test --workspace
# Run only infrastructure tests
test-infra:
cargo test -p infra
# Run only domain tests
test-domain:
cargo test -p domain
# Run only usecases tests
test-usecases:
cargo test -p usecases
# Run all checks (test, check, fmt, clippy, react checks)
ci: test check fmt clippy check-react
@echo "✅ All checks passed!"
# Check code without building
check:
cargo check --workspace
# Format code
fmt:
cargo fmt --all
# Check code formatting
fmt-check:
cargo fmt --all -- --check
# Run clippy linter
clippy:
cargo clippy --workspace -- -D warnings
# Lint + typecheck the React UI (no build artifacts produced)
check-react:
cd apps/react-ui && npm run lint && npm run typecheck
# ==============================================================================
# Setup & Installation
# ==============================================================================
# Install system dependencies (Linux only)
install-deps:
./scripts/install-deps.sh
# Install git hooks
install-hooks:
cp scripts/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# Build all Rust dependencies
install: install-hooks
cargo build --workspace
# ==============================================================================
# Releases
# ==============================================================================
# Cut a new release: bumps version, updates changelog, tags, and pushes.
#
# Usage:
# just release VERSION=0.2.0
#
# Bumps version in the shipping crates only:
# - apps/tauri-app/tauri.conf.json
# - apps/tauri-app/Cargo.toml
# - apps/react-ui/package.json
#
# The pomotoro-cli and cosmic-de crates are stubs (see ROADMAP.md) and are
# intentionally left at 0.1.0 until they are real.
#
# Pushing the tag triggers .github/workflows/release.yml, which builds
# Windows, macOS (universal), and Linux installers and attaches them to
# the GitHub Release automatically.
release VERSION:
#!/usr/bin/env bash
set -e
exec "{{justfile_directory()}}/scripts/release.sh" "{{VERSION}}"
# ==============================================================================
# Cleanup
# ==============================================================================
# Clean build artifacts
clean:
cargo clean
rm -rf dist