-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmise.toml
More file actions
250 lines (216 loc) · 9.11 KB
/
Copy pathmise.toml
File metadata and controls
250 lines (216 loc) · 9.11 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
min_version = "2025.1.0"
[tools]
bun = "1.3.14"
go = "1.26.4"
node = "26.4.0"
# Tasks replace the old Makefile. Run them with `mise run <task>` (or `mise <task>`).
# List everything with `mise tasks`. Tools pinned in [tools] are on PATH inside
# every task, so commands call `go`/`bun`/`bunx` directly (no `mise exec --`).
[tasks.build]
description = "Build the application"
run = [
{ task = "clean" },
{ task = "build_web_client" },
{ task = "build_tui" },
"go build -v -ldflags=\"-X 'github.com/timmo001/system-bridge/version.Version=$(git describe --tags --abbrev=0)'\" -o system-bridge-linux .",
]
run_windows = [
{ task = "clean" },
{ task = "build_web_client" },
{ task = "build_tui" },
"powershell -ExecutionPolicy Bypass -File ./.scripts/windows/generate-rc.ps1",
"windres system-bridge.rc -O coff -o system-bridge.syso",
"go build -v -ldflags=\"-H windowsgui -X 'github.com/timmo001/system-bridge/version.Version={{ exec(command='git describe --tags --abbrev=0') }}'\" -o system-bridge.exe .",
]
[tasks.build_console]
description = "Build console version for debugging (Windows only)"
run = "echo 'Console build is only supported on Windows'"
run_windows = [
{ task = "clean" },
{ task = "build_web_client" },
"go build -v -ldflags=\"-X 'github.com/timmo001/system-bridge/version.Version={{ exec(command='git describe --tags --abbrev=0') }}'\" -o system-bridge-console.exe .",
]
[tasks.generate_schemas]
description = "Generate Zod schemas from Go types"
run = [
"echo 'Generating Zod schemas from Go types...'",
"go run tools/generate-schemas/main.go",
"echo 'Formatting generated schemas...'",
"cd web-client && bun install && bun run format:write src/lib/system-bridge/types-modules-schemas.ts",
]
[tasks.build_web_client]
description = "Build the web client"
depends = ["clean_web_client", "generate_schemas"]
run = '''
(cd web-client && bun run build)
echo "Waiting for file system to sync..."
sync
echo "Verifying build files are accessible..."
if ! ls web-client/dist/index.html >/dev/null 2>&1; then
echo "ERROR: web-client/dist/index.html not found"
exit 1
fi
if ! ls web-client/dist/assets/*.css >/dev/null 2>&1; then
echo "ERROR: CSS files not found in web-client/dist/assets/"
ls -la web-client/dist/assets/ || true
exit 1
fi
if ! ls web-client/dist/assets/*.js >/dev/null 2>&1; then
echo "ERROR: JS files not found in web-client/dist/assets/"
ls -la web-client/dist/assets/ || true
exit 1
fi
echo "Verifying Tailwind CSS compilation..."
CSS_FILE=$(find web-client/dist/assets -name "*.css" -type f 2>/dev/null | head -1)
if [ -z "$CSS_FILE" ]; then
echo "ERROR: No CSS file found for Tailwind verification"
exit 1
fi
TAILWIND_FOUND=0
if grep -qE "@layer utilities" "$CSS_FILE" 2>/dev/null; then
echo " ✓ Found @layer utilities"
TAILWIND_FOUND=1
fi
if grep -qE "\.(flex|grid|hidden|block)\{" "$CSS_FILE" 2>/dev/null; then
echo " ✓ Found Tailwind utility classes"
TAILWIND_FOUND=1
fi
if grep -qE "--tw-" "$CSS_FILE" 2>/dev/null; then
echo " ✓ Found Tailwind CSS custom properties"
TAILWIND_FOUND=1
fi
if [ "$TAILWIND_FOUND" -eq 0 ]; then
echo "ERROR: Tailwind CSS compilation failed - no utility classes found"
echo "Expected @layer utilities, utility classes (.flex, .grid, etc.), or --tw-* properties"
echo "This may indicate that @tailwindcss/vite plugin did not run properly"
exit 1
fi
echo "✓ Build files verified and ready for embedding"
'''
run_windows = "powershell -ExecutionPolicy Bypass -File ./.scripts/windows/build-web-client.ps1"
[tasks.build_tui]
description = "Build the TUI binary"
run = "cd tui && bun install --frozen-lockfile && bun build src/index.ts --compile --outfile ../system-bridge-tui"
run_windows = "cd tui && bun install --frozen-lockfile && bun build src/index.ts --compile --outfile ../system-bridge-tui.exe"
[tasks.create_all_packages]
description = "Build all Linux packages (DEB, RPM, Arch, Flatpak)"
depends = ["clean_dist", "build"]
run = '''
echo "Packaging all Linux formats in parallel..."
chmod +x ./.scripts/linux/create-deb.sh ./.scripts/linux/create-rpm.sh ./.scripts/linux/create-arch.sh ./.scripts/linux/create-flatpak.sh
VERSION="5.0.0-dev+$(git rev-parse --short HEAD)" ./.scripts/linux/create-deb.sh &
VERSION="5.0.0-dev+$(git rev-parse --short HEAD)" ./.scripts/linux/create-rpm.sh &
VERSION="5.0.0-dev+$(git rev-parse --short HEAD)" ./.scripts/linux/create-arch.sh &
VERSION="5.0.0-dev+$(git rev-parse --short HEAD)" ./.scripts/linux/create-flatpak.sh &
wait
'''
run_windows = "echo create_all_packages is only supported on Linux hosts"
[tasks.create_arch]
description = "Create Arch Linux package"
depends = ["clean_dist"]
run = "VERSION=\"5.0.0-dev+$(git rev-parse --short HEAD)\" ./.scripts/linux/create-arch.sh"
[tasks.create_flatpak]
description = "Create Flatpak package"
depends = ["clean_dist"]
run = "VERSION=\"5.0.0-dev+$(git rev-parse --short HEAD)\" ./.scripts/linux/create-flatpak.sh"
[tasks.create_deb]
description = "Create Debian package"
depends = ["clean_dist"]
run = "VERSION=\"5.0.0-dev+$(git rev-parse --short HEAD)\" ./.scripts/linux/create-deb.sh"
[tasks.create_rpm]
description = "Create RPM package"
depends = ["clean_dist"]
run = "VERSION=\"5.0.0-dev+$(git rev-parse --short HEAD)\" ./.scripts/linux/create-rpm.sh"
[tasks.create_windows_installer]
description = "Create Windows installer"
depends = ["clean_dist", "download_windows_now_playing"]
run = "echo 'Creating the Windows installer is only supported on Windows'"
run_windows = "powershell -ExecutionPolicy Bypass -File ./.scripts/windows/create-installer.ps1 /Clean"
[tasks.download_windows_now_playing]
description = "Download the Windows NowPlaying helper (Windows only)"
run = "echo 'Downloading the NowPlaying helper is only supported on Windows'"
run_windows = "powershell -ExecutionPolicy Bypass -File ./.scripts/windows/download-now-playing.ps1"
[tasks.install]
description = "Install the application with go install"
depends = ["build"]
run = "go install ."
[tasks.run]
description = "Build and run the application (development only)"
depends = ["build"]
run = 'cd web-client && bunx concurrently -n "web,backend" -c "blue,green" "bun run dev" "../system-bridge-linux backend"'
run_windows = 'cd web-client && bunx concurrently -n "web,backend" -c "blue,green" "bun run dev" "../system-bridge.exe backend"'
[tasks."run-web-client"]
description = "Run the web client dev server (Vite)"
run = "cd web-client && bun run dev"
[tasks."run-backend"]
description = "Build and run the backend server"
depends = ["build"]
run = "./system-bridge-linux backend"
run_windows = "./system-bridge.exe backend"
[tasks."run-tui"]
description = "Build and run the TUI"
depends = ["build_tui"]
run = "./system-bridge-tui"
run_windows = "./system-bridge-tui.exe"
[tasks.cli]
description = "Build and run the CLI (append subcommands after --, e.g. mise run cli -- version)"
depends = ["build"]
run = "./system-bridge-linux cli"
run_windows = "./system-bridge.exe cli"
[tasks.run_console]
description = "Build and run console version for debugging (Windows only)"
depends = ["build_console"]
run = "echo 'Console run is only supported on Windows'"
run_windows = "./system-bridge-console.exe backend"
[tasks.list_processes]
description = "List running System Bridge processes (Windows only)"
run = "echo 'Process management is only supported on Windows'"
run_windows = "powershell -ExecutionPolicy Bypass -File ./.scripts/windows/list-processes.ps1"
[tasks.stop_processes]
description = "Stop all running System Bridge processes (Windows only)"
run = "echo 'Process management is only supported on Windows'"
run_windows = "powershell -ExecutionPolicy Bypass -File ./.scripts/windows/stop-processes.ps1"
[tasks.test]
description = "Run tests"
depends = ["test_go"]
[tasks.test_go]
description = "Run Go tests"
run = "go test -v ./..."
[tasks.lint]
description = "Run all linters (Go, web client, fallow)"
depends = ["lint_go", "lint_web_client", "lint_fallow"]
[tasks.lint_go]
description = "Run Go linters (fmt, vet)"
run = [
"go fmt ./...",
"go vet ./...",
]
[tasks.lint_web_client]
description = "Run web client linters (eslint, typecheck)"
run = [
"cd web-client && bun run lint",
"cd web-client && bun run typecheck",
]
[tasks.lint_fallow]
description = "Run fallow dead code analysis"
run = "cd web-client && bunx fallow --fail-on-issues"
[tasks.clean]
description = "Remove build artifacts"
run = "rm -f system-bridge system-bridge-linux system-bridge-tui"
run_windows = "powershell -ExecutionPolicy Bypass -File ./.scripts/windows/clean.ps1"
[tasks.clean_dist]
description = "Remove dist directory"
run = "rm -rf .flatpak-builder AppDir appimagetool build dist dist-agg rpm-structure rpmbuild flatpak-build repo deb-structure"
run_windows = "powershell -ExecutionPolicy Bypass -File ./.scripts/windows/clean-dist.ps1"
[tasks.clean_web_client]
description = "Remove web client build artifacts"
run = "rm -rf web-client/dist"
run_windows = "powershell -ExecutionPolicy Bypass -File ./.scripts/windows/clean-web-client.ps1"
[tasks.deps]
description = "Install dependencies (go mod tidy)"
run = "go mod tidy"
[tasks.version]
description = "Show the version of the application"
depends = ["build"]
run = "./system-bridge-linux version"
run_windows = "./system-bridge.exe version"