Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
345 lines (291 loc) · 12.1 KB
/
Copy pathTaskfile.yml
File metadata and controls
345 lines (291 loc) · 12.1 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# Taskfile for renderflow development workflows
# https://taskfile.dev
version: "3"
tasks:
# Full project bootstrap – installs all toolchain dependencies, web dependencies,
# and builds the renderflow CLI in release mode.
# Works on Linux, macOS, Termux (Android), and Windows.
setup:
desc: Full project setup (installs Rust, Node.js, pnpm, web deps, and builds the CLI)
summary: |
Performs a complete development environment bootstrap in one step:
1. Rust toolchain
• Termux – pkg install rust
• Linux / macOS – rustup (https://rustup.rs)
• Windows – winget install Rustlang.Rustup
2. Node.js runtime
• Termux – pkg install nodejs
• macOS – brew install node
• Debian/Ubuntu – NodeSource LTS via apt-get
• Fedora/RHEL – dnf install nodejs
• Arch Linux – pacman -S nodejs npm
• Windows – winget install OpenJS.NodeJS.LTS
3. pnpm package manager
• Termux – npm install -g pnpm
• Others – corepack enable + corepack prepare pnpm@latest
4. Web workspace dependencies (pnpm install --frozen-lockfile)
5. renderflow CLI (cargo build --release)
After setup completes:
Use the CLI: ./target/release/renderflow (or cargo run -- build)
Start the web: task web:dev
cmds:
- cmd: |
#!/usr/bin/env sh
set -e
_green='\033[0;32m'
_yellow='\033[0;33m'
_reset='\033[0m'
_ok() { printf "${_green}✓ %s${_reset}\n" "$*"; }
_info() { printf "${_yellow}→ %s${_reset}\n" "$*"; }
_is_termux() { [ -n "${TERMUX_VERSION:-}" ]; }
# ── Rust ──────────────────────────────────────────────────────────
if command -v cargo >/dev/null 2>&1; then
_ok "Rust already installed ($(rustc --version))"
elif _is_termux; then
_info "Termux: installing Rust via pkg..."
pkg install rust -y
else
_info "Installing Rust via rustup..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
fi
# Source cargo env so subsequent commands can find cargo/rustc
if [ -f "${HOME}/.cargo/env" ]; then
# shellcheck disable=SC1091
. "${HOME}/.cargo/env"
fi
# ── Node.js ───────────────────────────────────────────────────────
if command -v node >/dev/null 2>&1; then
_ok "Node.js already installed ($(node --version))"
elif _is_termux; then
_info "Termux: installing Node.js via pkg..."
pkg install nodejs -y
elif command -v brew >/dev/null 2>&1; then
_info "Homebrew: installing Node.js..."
brew install node
elif command -v apt-get >/dev/null 2>&1; then
_info "apt-get: installing Node.js LTS via NodeSource..."
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
elif command -v dnf >/dev/null 2>&1; then
_info "dnf: installing Node.js..."
sudo dnf install -y nodejs npm
elif command -v pacman >/dev/null 2>&1; then
_info "pacman: installing Node.js..."
sudo pacman -S --noconfirm nodejs npm
else
printf "⚠ No supported package manager found to install Node.js.\n"
printf " Please install Node.js manually: https://nodejs.org\n"
exit 1
fi
# ── pnpm ──────────────────────────────────────────────────────────
if command -v pnpm >/dev/null 2>&1; then
_ok "pnpm already installed ($(pnpm --version))"
elif _is_termux; then
_info "Termux: installing pnpm via npm..."
npm install -g pnpm
else
_info "Enabling pnpm via corepack..."
corepack enable
corepack prepare pnpm@latest --activate
fi
# ── Web workspace dependencies ─────────────────────────────────
_info "Installing web workspace dependencies..."
pnpm install --frozen-lockfile
# ── Build renderflow CLI ───────────────────────────────────────
_info "Building renderflow CLI (release mode)..."
cargo build --release
printf "\n${_green}✅ Setup complete!${_reset}\n\n"
printf " Use the CLI: ./target/release/renderflow\n"
printf " or cargo run -- build\n"
printf " Start the web: task web:dev\n\n"
platforms: [linux, darwin]
- cmd: |
$ErrorActionPreference = 'Stop'
function _ok { param($msg) Write-Host "v $msg" -ForegroundColor Green }
function _info { param($msg) Write-Host "-> $msg" -ForegroundColor Yellow }
# ── Rust ──────────────────────────────────────────────────────────
if (Get-Command cargo -ErrorAction SilentlyContinue) {
_ok "Rust already installed ($(rustc --version))"
} else {
_info "Installing Rust via winget..."
winget install Rustlang.Rustup --accept-source-agreements --accept-package-agreements
$env:PATH = "$env:USERPROFILE\.cargo\bin;$env:PATH"
}
# ── Node.js ───────────────────────────────────────────────────────
if (Get-Command node -ErrorAction SilentlyContinue) {
_ok "Node.js already installed ($(node --version))"
} else {
_info "Installing Node.js LTS via winget..."
winget install OpenJS.NodeJS.LTS --accept-source-agreements --accept-package-agreements
$env:PATH = "$env:ProgramFiles\nodejs;$env:PATH"
}
# ── pnpm ──────────────────────────────────────────────────────────
if (Get-Command pnpm -ErrorAction SilentlyContinue) {
_ok "pnpm already installed ($(pnpm --version))"
} else {
_info "Enabling pnpm via corepack..."
corepack enable
corepack prepare pnpm@latest --activate
}
# ── Web workspace dependencies ─────────────────────────────────
_info "Installing web workspace dependencies..."
pnpm install --frozen-lockfile
# ── Build renderflow CLI ───────────────────────────────────────
_info "Building renderflow CLI (release mode)..."
cargo build --release
Write-Host ""
Write-Host "Setup complete!" -ForegroundColor Green
Write-Host ""
Write-Host " Use the CLI: .\target\release\renderflow.exe"
Write-Host " or cargo run -- build"
Write-Host " Start the web: task web:dev"
Write-Host ""
platforms: [windows]
# Build the project in debug mode
build:
desc: Build the project
cmds:
- cargo build
# Run the project with the default `build` subcommand
run:
desc: Run the project
cmds:
- cargo run -- build
# Run the test suite
test:
desc: Run all tests
cmds:
- cargo test
# Build the project in release mode
release:
desc: Build the project in release mode
cmds:
- cargo build --release
# Remove build artifacts
clean:
desc: Clean build artifacts
cmds:
- cargo clean
# Check the project for errors without producing a binary
check:
desc: Check the project for errors
cmds:
- cargo check
# Format source code
format:
desc: Format source code with rustfmt
cmds:
- cargo fmt
# Lint source code with Clippy
lint:
desc: Lint source code with Clippy
cmds:
- cargo clippy
# Run all benchmarks
bench:
desc: Run all benchmarks and open Criterion HTML reports
cmds:
- cargo bench
# Run a single benchmark suite by name (e.g. task bench-suite SUITE=graph_planner)
bench-suite:
desc: Run a specific benchmark suite (requires SUITE=<name>)
cmds:
- cargo bench --bench {{.SUITE}}
requires:
vars:
- SUITE
# Run benchmarks without collecting samples (compile-only check)
bench-check:
desc: Compile benchmarks without running them
cmds:
- cargo bench --no-run
# Generate CHANGELOG.md from commit history using git-cliff
changelog:
desc: Generate CHANGELOG.md from commit history
cmds:
- git-cliff -o CHANGELOG.md
# Cross-compile a release binary for a specific target using `cross`
# Usage: task cross-build TARGET=<target>
# Example: task cross-build TARGET=aarch64-unknown-linux-gnu
cross-build:
desc: Cross-compile release binary for a target (requires cross and Docker)
cmds:
- cross build --target {{.TARGET}} --release
requires:
vars:
- TARGET
# Build a Debian package (.deb) for the current host architecture
# Requires: cargo-deb (cargo install cargo-deb)
package-deb:
desc: Build a .deb package (requires cargo-deb)
cmds:
- cargo build --release
- cargo deb --no-build
# Build an RPM package (.rpm) for the current host architecture
# Requires: cargo-generate-rpm (cargo install cargo-generate-rpm)
package-rpm:
desc: Build a .rpm package (requires cargo-generate-rpm)
cmds:
- cargo build --release
- cargo generate-rpm
# Validate the Arch Linux PKGBUILD using namcap
# Requires: namcap (pacman -S namcap on Arch Linux)
validate-pkgbuild:
desc: Validate the Arch Linux PKGBUILD with namcap (requires namcap)
cmds:
- namcap pkg/aur/renderflow-git/PKGBUILD
# Bump the patch version (e.g. 0.1.0 -> 0.1.1), commit, and tag
# Requires: cargo-release (cargo install cargo-release)
release-patch:
desc: Bump patch version, commit, and tag (requires cargo-release)
cmds:
- cargo release patch --execute
# Bump the minor version (e.g. 0.1.0 -> 0.2.0), commit, and tag
# Requires: cargo-release (cargo install cargo-release)
release-minor:
desc: Bump minor version, commit, and tag (requires cargo-release)
cmds:
- cargo release minor --execute
# Bump the major version (e.g. 0.1.0 -> 1.0.0), commit, and tag
# Requires: cargo-release (cargo install cargo-release)
release-major:
desc: Bump major version, commit, and tag (requires cargo-release)
cmds:
- cargo release major --execute
web:install:
desc: Install web workspace dependencies
cmds:
- corepack enable
- pnpm install --frozen-lockfile
web:dev:
desc: Run the Renderflow product site locally
cmds:
- pnpm web:dev
web:format:
desc: Check web formatting
cmds:
- pnpm web:format
web:lint:
desc: Lint web sources
cmds:
- pnpm web:lint
web:typecheck:
desc: Typecheck web sources
cmds:
- pnpm web:typecheck
web:test:
desc: Run web tests
cmds:
- pnpm web:test
web:build:
desc: Build the Renderflow product site
cmds:
- pnpm web:build
web:preview:
desc: Preview the Renderflow product site
cmds:
- pnpm web:preview
web:check:
desc: Run all web quality checks
cmds:
- pnpm web:check