-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
109 lines (94 loc) · 3.23 KB
/
Taskfile.yml
File metadata and controls
109 lines (94 loc) · 3.23 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
version: "3"
dotenv: [".env"]
tasks:
init:
desc: "Install all required development tools"
cmds:
- echo "Installing development tools..."
- |
# Ensure GOPATH is set and in PATH
export GOPATH="${GOPATH:-$HOME/go}"
export PATH="$GOPATH/bin:$PATH"
echo "Installing templ..."
go install github.com/a-h/templ/cmd/templ@latest
echo "Installing air..."
go install github.com/air-verse/air@latest
# Verify installations
echo "Verifying installations..."
which templ || echo "Warning: templ not found in PATH"
which air || echo "Warning: air not found in PATH"
# Add PATH to shell configuration if not already present
SHELL_RC="$HOME/.$(basename $SHELL)rc"
if ! grep -q "GOPATH/bin" "$SHELL_RC" 2>/dev/null; then
echo 'export PATH="$HOME/go/bin:$PATH"' >> "$SHELL_RC"
echo "Added GOPATH/bin to $SHELL_RC. Please restart your terminal or run: source $SHELL_RC"
fi
- task: download-tailwind
silent: false
download-tailwind:
cmds:
- |
if [ ! -f ./tailwindcss ]; then
echo "Downloading Tailwind CSS v4 standalone CLI..."
if [ "$(uname)" == "Darwin" ]; then
# macOS
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.10/tailwindcss-macos-x64
mv tailwindcss-macos-x64 tailwindcss
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Linux
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.10/tailwindcss-linux-x64
mv tailwindcss-linux-x64 tailwindcss
else
# Windows (assuming Git Bash or similar)
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.10/tailwindcss-windows-x64.exe
mv tailwindcss-windows-x64.exe tailwindcss.exe
fi
chmod +x tailwindcss*
fi
echo "Tailwind CLI path: $(pwd)/tailwindcss"
ls -la ./tailwindcss
silent: false
tailwind:
cmds:
- echo "Running Tailwind CSS build..."
- ./tailwindcss -i ./static/css/app.css -o ./static/dist/styles.css --minify
- echo "Tailwind CSS build complete. Output file:"
- ls -la ./static/dist/styles.css
silent: false
tailwind-watch:
cmds:
- echo "Running Tailwind CSS in watch mode..."
- ./tailwindcss -i ./static/css/app.css -o ./static/dist/styles.css --watch
silent: false
templ:
cmds:
- templ generate --watch
silent: true
air:
cmds:
- air
silent: true
dev:
deps: [templ, air, tailwind-watch]
cmds:
- echo "Running all tasks concurrently"
silent: false
build:
cmds:
- echo "Building project for production..."
- templ generate
- ./tailwindcss -i ./static/css/app.css -o ./static/dist/styles.css --minify
- go build -o ./bin/app ./main.go
silent: false
clean:
cmds:
- rm -rf ./bin
- rm -f ./static/dist/styles.css
- rm -f ./tailwindcss*
silent: true
production:
deps: [clean, build]
cmds:
- echo "Starting production server..."
- ./bin/app
silent: false