diff --git a/.gitignore b/.gitignore index 66120f7..9c00447 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,11 @@ coverage/ .cache/ tmp/ bin/ + +# Task's checksum cache, written by every `wails3 task` run. +.task/ + +# Generated by build/linux/Taskfile.yml's generate:dotdesktop from +# build/config.yml on every build, and consumed by the deb/rpm/AppImage +# packaging tasks that depend on it. A derived file with one source. +build/linux/yellowjacket.desktop diff --git a/.planning/plans/active/009-wails-v3-migration.md b/.planning/plans/active/009-wails-v3-migration.md index a1ef509..cc8e1fb 100644 --- a/.planning/plans/active/009-wails-v3-migration.md +++ b/.planning/plans/active/009-wails-v3-migration.md @@ -294,6 +294,14 @@ Taskfile tree — a genuinely larger and more visible build surface. `make build-prod` still strips and UPX-compresses; `make skill-check` passes; `grep -r webkit2_41` returns nothing. +> **Corrected after the fact.** `make build-prod` strips and trims +> (`-trimpath -ldflags="-w -s"`, 28.8 MB against the dev build's +> 38 MB) but **does not UPX-compress**: that was v2's `wails build +> -upx` flag, and v3's Taskfile has no equivalent. Neither `make +> build-dev` nor `make build-prod` was actually run when Phase 1 was +> recorded — both were broken until the shim below. Whether to +> reintroduce UPX is a packaging decision for Phase 7, not a port. + **Est.** Half a session. Low risk, high churn. ### Phase 1 — what actually landed diff --git a/CLAUDE.md b/CLAUDE.md index e7069f6..769e81c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -32,7 +32,7 @@ make sandbox-seed-bulk # Same, from the bulk library (minutes; it is a real scan make perf LABEL= # Measure a running app; writes .dev/perf/.json make perf-compare BEFORE= AFTER= # Print the before/after table make build-dev # Debug build with symbols -make build-prod # Production build (stripped, UPX-compressed) +make build-prod # Production build (stripped and trimmed; no UPX) make generate # Run code generators (sqlc + templ via go generate) make e2e # Playwright smoke suite against a running dev-headless app make e2e-setup # Install the e2e runner + its browser (once) diff --git a/Makefile b/Makefile index 5e9f8e2..4351b3c 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,18 @@ LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' # point elsewhere (or unset it there to share the real user dirs). DEV_YJ_HOME ?= $(HOME)/.local/share/yellowjacket-dev +# `wails3 dev` and `wails3 task` run the scaffold's Taskfile tree, which +# invokes `wails3` by bare name. The CLI is a vendored Go tool, so the +# name only exists on PATH via this shim -- see scripts/toolbin/wails3. +# Without it every supervisor target dies with +# "/bin/sh: wails3: command not found" at its first sub-task. +TOOLBIN := $(CURDIR)/scripts/toolbin + dev: setup generate clean - if [ -f .env ]; then set -a; . ./.env; set +a; fi; : "$${YJ_HOME:=$(DEV_YJ_HOME)}"; export YJ_HOME; go tool wails3 dev -config ./build/config.yml + if [ -f .env ]; then set -a; . ./.env; set +a; fi; : "$${YJ_HOME:=$(DEV_YJ_HOME)}"; export YJ_HOME; PATH="$(TOOLBIN):$$PATH" go tool wails3 dev -config ./build/config.yml dev-debug: setup generate clean - if [ -f .env ]; then set -a; . ./.env; set +a; fi; : "$${YJ_HOME:=$(DEV_YJ_HOME)}"; export YJ_HOME; YJ_LOG_LEVEL=debug go tool wails3 dev -config ./build/config.yml + if [ -f .env ]; then set -a; . ./.env; set +a; fi; : "$${YJ_HOME:=$(DEV_YJ_HOME)}"; export YJ_HOME; YJ_LOG_LEVEL=debug PATH="$(TOOLBIN):$$PATH" go tool wails3 dev -config ./build/config.yml # ── Headless harness (plan 005) ────────────────────────────────────── # The same dev server `make dev` runs, minus the blocking GTK window: @@ -162,7 +169,7 @@ fresh-install: setup generate clean case "$$(findmnt -no FSTYPE -T "$$YJ_HOME" 2>/dev/null)" in \ tmpfs|ramfs) echo "==> WARNING: $$YJ_HOME is RAM-backed; the search index import needs ~6GB of real disk. Set FRESH_HOME_BASE to a disk-backed path." ;; \ esac; \ - go tool wails3 dev -config ./build/config.yml + PATH="$(TOOLBIN):$$PATH" go tool wails3 dev -config ./build/config.yml # Named, persistent sandboxes: `make sandbox foo` runs dev against # $(FRESH_HOME_BASE)/yellowjacket-sandbox-foo, creating it on first use @@ -222,7 +229,7 @@ sandbox-%: setup generate clean case "$$(findmnt -no FSTYPE -T "$$YJ_HOME" 2>/dev/null)" in \ tmpfs|ramfs) echo "==> WARNING: $$YJ_HOME is RAM-backed; the search index import needs ~6GB of real disk. Set FRESH_HOME_BASE to a disk-backed path." ;; \ esac; \ - go tool wails3 dev -config ./build/config.yml + PATH="$(TOOLBIN):$$PATH" go tool wails3 dev -config ./build/config.yml sandboxes: ## List existing named sandboxes @ls -d "$(SANDBOX_DIR)"-* 2>/dev/null \ @@ -232,10 +239,10 @@ sandboxes: ## List existing named sandboxes .PHONY: sandbox sandbox-rm sandboxes build-dev: generate - go tool wails3 task build DEV=true + PATH="$(TOOLBIN):$$PATH" go tool wails3 task build DEV=true build-prod: generate - go tool wails3 task build + PATH="$(TOOLBIN):$$PATH" go tool wails3 task build build-frontend: cd frontend && pnpm install && pnpm build diff --git a/build/darwin/icons.icns b/build/darwin/icons.icns index 93c7299..3fba993 100644 Binary files a/build/darwin/icons.icns and b/build/darwin/icons.icns differ diff --git a/build/windows/icon.ico b/build/windows/icon.ico index bfa0690..e1b576c 100644 Binary files a/build/windows/icon.ico and b/build/windows/icon.ico differ diff --git a/frontend/package.json b/frontend/package.json index 69fadc0..f7637b5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -2,6 +2,7 @@ "scripts": { "dev": "vite", "build": "vite build", + "build:dev": "vite build --mode development", "preview": "vite preview" }, "dependencies": { diff --git a/frontend/vite.config.mts b/frontend/vite.config.mts index 2143dd9..41f9a76 100644 --- a/frontend/vite.config.mts +++ b/frontend/vite.config.mts @@ -33,6 +33,12 @@ export default defineConfig({ }, }, server: { + // IPv4, explicitly. Vite's default binds `localhost`, which on + // this machine resolves to `[::1]` *only* — and wails3 dev's + // asset proxy dials 127.0.0.1, so the app's first request for + // the dev server was answered with "connection refused" and the + // first paint raced a retry. + host: '127.0.0.1', hmr: { host: 'localhost', protocol: 'ws', diff --git a/go.mod b/go.mod index 17bcf03..ebc414e 100644 --- a/go.mod +++ b/go.mod @@ -406,7 +406,6 @@ require ( mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect ) - tool ( github.com/a-h/templ/cmd/templ github.com/evilmartians/lefthook diff --git a/scripts/toolbin/wails3 b/scripts/toolbin/wails3 new file mode 100755 index 0000000..21d3694 --- /dev/null +++ b/scripts/toolbin/wails3 @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# `wails3`, for the Taskfiles that shell out to it by bare name. +# +# The CLI is a vendored Go tool (go.mod's `tool` block), invoked as +# `go tool wails3` — deliberately, so the build declares its own +# dependencies rather than assuming a global install (plan 009, D3). +# But `wails3 dev` and `wails3 task` are supervisors: they run the +# scaffold's Taskfile tree, which invokes `wails3` by name in 54 places +# across build/Taskfile.yml and the three per-platform ones. Those are +# scaffold files, and rewriting every call site is churn that would +# have to be redone whenever they are refreshed from a newer scaffold. +# +# So the name is put on PATH instead, pointing back at the vendored +# tool. The Makefile prepends this directory for the targets that +# start a supervisor; nothing else needs it, and nothing global is +# installed. +# +# Two details are load-bearing. +# +# `exec` rather than a call, so signals and the exit status reach the +# real tool: `make dev` is stopped with Ctrl-C, and a wrapper that ate +# SIGINT would leave the app running. +# +# And the working directory is left alone. An earlier version cd'd to +# the repo root to be sure `go tool` found the module -- it does not +# need that, `go tool` resolves from anywhere inside it -- and the cd +# silently discarded the `dir:` a task had set, so `generate:icons` +# (dir: build) failed with "open appicon.png: no such file or +# directory" against a file that was right there. +set -euo pipefail + +exec go tool wails3 "$@"