-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
110 lines (87 loc) · 2.73 KB
/
justfile
File metadata and controls
110 lines (87 loc) · 2.73 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
# ucharm development commands
# Run `just` to see all available commands
# Default: show help
default:
@just --list
# Build the CLI in release mode
build:
cp VERSION cli/src/VERSION
cd cli && zig build -Doptimize=ReleaseSmall
# Build the CLI in debug mode
build-debug:
cp VERSION cli/src/VERSION
cd cli && zig build
# Run all tests
test: test-unit test-e2e
# Run unit tests
test-unit:
cd cli && zig build test
# Run end-to-end tests
test-e2e:
cd cli && ./test_e2e.sh
# Run a Python script with ucharm
run script:
./cli/zig-out/bin/ucharm run {{ script }}
# Build a universal binary from a Python script
build-app script output="app":
./cli/zig-out/bin/ucharm build {{ script }} -o {{ output }} --mode universal
# Build PocketPy runtime with native modules
build-pocketpy:
cd pocketpy && zig build -Doptimize=ReleaseSmall
# Run the demo
demo:
./cli/zig-out/bin/ucharm run examples/demo.py
# Run the full feature demo
demo-full:
./cli/zig-out/bin/ucharm run examples/simple_cli.py
# Clean build artifacts
clean:
rm -rf cli/zig-out cli/.zig-cache
rm -rf pocketpy/zig-out pocketpy/.zig-cache
# Format Zig code
fmt:
cd cli && zig fmt src/
# Check Zig code formatting
fmt-check:
cd cli && zig fmt --check src/
# Create a new release (interactive) - built with ucharm!
# Interactive release
release:
./cli/zig-out/bin/ucharm run scripts/release.py
# Show binary size breakdown
size:
@echo "CLI binary:"
@ls -lh cli/zig-out/bin/ucharm 2>/dev/null || echo " Not built yet. Run: just build"
@echo ""
@echo "PocketPy runtime:"
@ls -lh pocketpy/zig-out/bin/pocketpy-ucharm 2>/dev/null || echo " Not built yet. Run: just build-pocketpy"
# Run benchmarks
bench:
@echo "Running native module benchmarks..."
cd cli && zig build test 2>&1 | grep -E "(benchmark|ns|ms)"
# Install locally (symlink to ~/.local/bin)
install:
@mkdir -p ~/.local/bin
@ln -sf $(pwd)/cli/zig-out/bin/ucharm ~/.local/bin/ucharm
@echo "Installed ucharm to ~/.local/bin/ucharm"
@echo "Make sure ~/.local/bin is in your PATH"
# Uninstall local installation
uninstall:
@rm -f ~/.local/bin/ucharm
@echo "Removed ucharm from ~/.local/bin"
# Setup development environment
setup:
@echo "Checking dependencies..."
@which zig > /dev/null || (echo "Error: zig not found. Install from https://ziglang.org" && exit 1)
@echo "Building PocketPy runtime..."
@just build-pocketpy
@echo "Building CLI..."
@just build
@echo ""
@echo "Setup complete! Try: just demo"
# Watch for changes and rebuild (requires watchexec)
watch:
watchexec -w cli/src -e zig -- just build
# Generate Homebrew formula (after release)
homebrew version:
./scripts/update-homebrew.sh {{ version }}