Skip to content

Commit abfcca1

Browse files
committed
fix: move wails.json to cmd/desktop/ and fix desktop-dev workflow
Wails v2 requires wails.json next to the main package. Moved it from the project root to cmd/desktop/ with relative paths for frontend:dir and build:dir. Updated Makefile to cd into cmd/desktop for all wails commands. Added desktop build artifacts to .gitignore.
1 parent cadc589 commit abfcca1

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Binaries
22
/radar
3+
/radar-desktop
34
/explorer
5+
/desktop
46
*.exe
57

68
# Go
@@ -24,6 +26,11 @@ Thumbs.db
2426
*.log
2527
internal/static/dist/*
2628
!internal/static/dist/.gitkeep
29+
/build/bin/
30+
31+
# Wails generated
32+
web/wailsjs/
33+
web/package.json.md5
2734

2835
# Local config
2936
.env

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,26 +177,26 @@ desktop-binary:
177177
CGO_ENABLED=1 CGO_LDFLAGS="-framework UniformTypeIdentifiers" go build -tags production -ldflags "$(LDFLAGS)" -o radar-desktop ./cmd/desktop
178178

179179
# Run desktop app in Wails dev mode with Go hot reload.
180-
# Uses -s to skip the frontend watcher — run `make watch-frontend` in a separate terminal.
180+
# wails.json lives in cmd/desktop/ (Wails requires it next to the main package).
181181
# Requires wails CLI: go install github.com/wailsapp/wails/v2/cmd/wails@latest
182182
desktop-dev:
183183
@command -v wails >/dev/null 2>&1 || { echo "Error: wails CLI not found. Install with: go install github.com/wailsapp/wails/v2/cmd/wails@latest"; exit 1; }
184-
wails dev -ldflags "$(LDFLAGS)" -s
184+
cd cmd/desktop && wails dev -ldflags "$(LDFLAGS)"
185185

186186
# Package macOS .app bundle
187187
desktop-package-darwin:
188188
@command -v wails >/dev/null 2>&1 || { echo "Error: wails CLI not found"; exit 1; }
189-
wails build -platform darwin/universal -ldflags "$(LDFLAGS)"
189+
cd cmd/desktop && wails build -platform darwin/universal -ldflags "$(LDFLAGS)"
190190

191191
# Package Windows .exe
192192
desktop-package-windows:
193193
@command -v wails >/dev/null 2>&1 || { echo "Error: wails CLI not found"; exit 1; }
194-
wails build -platform windows/amd64 -ldflags "$(LDFLAGS)"
194+
cd cmd/desktop && wails build -platform windows/amd64 -ldflags "$(LDFLAGS)"
195195

196196
# Package Linux binary
197197
desktop-package-linux:
198198
@command -v wails >/dev/null 2>&1 || { echo "Error: wails CLI not found"; exit 1; }
199-
wails build -platform linux/amd64 -ldflags "$(LDFLAGS)"
199+
cd cmd/desktop && wails build -platform linux/amd64 -ldflags "$(LDFLAGS)"
200200

201201
# ============================================================================
202202
# Release Targets

wails.json renamed to cmd/desktop/wails.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
"$schema": "https://wails.io/schemas/config.v2.json",
33
"name": "radar-desktop",
44
"outputfilename": "Radar",
5-
"frontend:dir": "web",
5+
"frontend:dir": "../../web",
66
"frontend:install": "npm install",
77
"frontend:build": "npm run build",
88
"frontend:dev:watcher": "npm run dev",
99
"frontend:dev:serverUrl": "auto",
10+
"build:dir": "../../build",
1011
"author": {
1112
"name": "Skyhook",
1213
"email": "support@skyhook.io"

0 commit comments

Comments
 (0)