-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
83 lines (73 loc) · 2.51 KB
/
Copy pathTaskfile.yml
File metadata and controls
83 lines (73 loc) · 2.51 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
# To use this file:
# 1. Install Task → https://taskfile.dev/docs/installation
# 2. Run `task --list` to see all available tasks
# 3. Run any task with: `task <name>` (example: `task dev`)
version: '3'
tasks:
# 🚀 Start the dev server with Bun + Fumadocs
# - Installs dependencies
# - Runs the server on port 2222 on all network interfaces
# - Automatically opens the docs in the default browser
# - Stops cleanly on Ctrl+C
dev:
desc: "Install dependencies and run dev server on port 2222 on all network interfaces"
interactive: true # keep terminal attached (Ctrl+C works)
silent: true # hide task overhead, only show script output
cmds:
- |
bash -c "
set -e
# Install dependencies
bun install
# Trap Ctrl+C so the dev server shuts down gracefully
trap 'echo; echo Shutting down dev...; jobs -p | xargs -r kill 2>/dev/null || true; exit 0' SIGINT
# Run the server in the background
bun run dev --port 2222 &
# Give server a moment to start
sleep 3
# Open docs in browser automatically
task _open-browser -- 2222
# Wait until the server stops
wait
"
# 🌐 Internal helper to open the docs in the browser automatically
# Supports macOS (open), Linux (xdg-open), and Windows (start)
_open-browser:
silent: true
cmds:
- |
bash -c '
PORT="$1"
URL="http://localhost:${PORT}/"
if command -v open >/dev/null 2>&1; then
open "$URL"
elif command -v xdg-open >/dev/null 2>&1; then
xdg-open "$URL"
elif command -v start >/dev/null 2>&1; then
start "$URL"
fi
' sh {{.CLI_ARGS}}
# 🧹 Clean build artifacts
# Removes .next, .source, and out directories if they exist
clean:
desc: "Remove .next, .source, and out directories"
silent: true
cmds:
- |
bash -c '
rm -rf .next .source out
echo "Clean complete!"
'
# 🐳 Build and run dev container
# Builds the Docker image and starts a container on port 8080
docker-dev:
desc: "Build and run Docker dev container on port 8080"
silent: true
cmds:
- |
bash -c '
docker build -t stackio-dev .
docker rm -f stackio-dev 2>/dev/null || true
docker run -d --name stackio-dev -p 8080:8080 stackio-dev
echo "Container started on http://localhost:8080"
'