-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
124 lines (98 loc) · 3.48 KB
/
justfile
File metadata and controls
124 lines (98 loc) · 3.48 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
# =============================================================================
# Justfile - Development Build & Test Commands
# =============================================================================
#
# Install Just command runner: cargo install just
# Install dev dependencies: just install
# List available commands: just -l
#
# Reference documentation: https://github.com/casey/just
# =============================================================================
features := ""
_features := if features == "all" {
"--all-features"
} else if features != "" {
"--features=" + features
} else { "" }
# Initialize git submodules (ghostty for terminal emulator)
submodules:
git submodule update --init --recursive
# Installs required dev tools
install: submodules
cargo install --locked cargo-machete cargo-nextest cargo-deny git-cliff
cd website && npm install
# Cleans everything through cargo clean
clean:
cargo clean
# Runs cargo fmt
fmt:
cargo fmt --all
# Find unused dependencies through machete
machete:
cargo machete
# Checks for rust fmt issues
check-fmt:
cargo fmt --all -- --check
# runs cargo-deny across the workspace
deny:
cargo deny check
# Runs clippy checks across the workspace
clippy:
cargo clippy --all-targets {{ _features }} --profile ci -- -D warnings
check-wasm:
cargo check -p enya-editor --target wasm32-unknown-unknown --profile ci
# Build the website (validates links and content)
website-build:
#!/usr/bin/env bash
if command -v npm &> /dev/null && [ -d "website/node_modules" ]; then
cd website && npm run build
else
echo "Skipping website build (npm not available or node_modules not installed)"
fi
# Run the website dev server
website-dev:
cd website && npm run dev
# Run all lints
lint: check-fmt clippy
# Runs workspace tests using nextest
test:
cargo nextest run {{ _features }} --cargo-profile ci
# Runs integration tests (requires Docker)
it-test:
cargo nextest run -p enya-integration-tests --run-ignored ignored-only
# Runs a local CI check
# Note: We don't use --all-features because puffin and tracy profiling backends are mutually exclusive
ci: submodules
just lint machete test check-wasm website-build
# Run the editor (initializes submodules first)
run: submodules
cargo run -p enya-editor
# Build the editor (initializes submodules first)
build: submodules
cargo build -p enya-editor
# Build the serve binary (trunk first, then cargo with embedded WASM assets)
serve-build:
cd crates/editor && trunk build --release
cargo build -p enya --features serve --release
# Deploy website + WASM editor to Cloudflare Pages
deploy-website:
cd crates/editor && trunk build --release --public-url /editor/
mkdir -p website/public/editor
cp -r crates/editor/dist/* website/public/editor/
cd website && npm install && npm run build
npx wrangler pages deploy website/dist --project-name=enya --branch=deploy
# Run the local snapshot server for development
snapshot-server:
cargo run -p enya-snapshot-server
# Deploy the snapshot API worker to Cloudflare (R2)
deploy-snapshot-api:
cd workers/snapshot-api && npx wrangler deploy
# Generate full changelog from git history
changelog:
git-cliff -o CHANGELOG.md
# Preview changelog for unreleased commits
changelog-unreleased:
git-cliff --unreleased --strip header
# Run enya serve in development
serve workspace:
cargo run -p enya --features serve -- serve {{workspace}}