dissolve app/ into repo root (D-056)
Single Flutter package at the repo root. All code, tests, assets, and platform directories moved from app/ to root. Package renamed from clide_app to clide — all imports rewritten. Merged pubspec combines core (ffi) and app (flutter, yaml, xterm) dependencies. Makefile simplified: no APP_PRESENT conditionals, no cd, no daemon lifecycle. 317 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
# clide — local dev targets. CI scripts in ci/ shell out to these.
|
||||
#
|
||||
# One toolchain: Flutter + Dart. Native supporter tools (`ptyc`, future
|
||||
# peers) live in their own directories with their own build targets and
|
||||
# compose in under `make build`.
|
||||
# Single Flutter package at the repo root. Native supporter tools
|
||||
# (ptyc, future peers) live in their own directories.
|
||||
|
||||
INSTALL_DIR ?= $(HOME)/.local/bin
|
||||
|
||||
# Version stamping. Source of truth: project.yaml `version:` field. Local
|
||||
# builds augment with git short SHA + dirty marker (semver build metadata).
|
||||
VERSION_BASE ?= $(shell awk -F': *' '/^version:/ {gsub(/[" ]/,"",$$2); print $$2; exit}' project.yaml)
|
||||
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
||||
DIRTY := $(shell git diff --quiet HEAD 2>/dev/null || echo .dirty)
|
||||
@@ -18,85 +15,30 @@ DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
help: ## Show this help.
|
||||
@awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z0-9_-]+:.*##/ {printf " \033[36m%-22s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
|
||||
# -- app + core (Flutter / Dart) ----------------------------------------
|
||||
|
||||
# App and core targets gracefully noop if the Dart package isn't
|
||||
# scaffolded yet (pre-Tier-0 state) or if flutter isn't installed
|
||||
# locally.
|
||||
APP_PRESENT := $(shell test -f pubspec.yaml && echo yes || echo no)
|
||||
HAS_FLUTTER := $(shell command -v flutter >/dev/null && echo yes || echo no)
|
||||
|
||||
.PHONY: build
|
||||
build: ## Build the Dart AOT `clide` binary (CLI + --daemon modes in one binary).
|
||||
ifeq ($(APP_PRESENT),yes)
|
||||
dart compile exe bin/clide.dart -o bin/clide \
|
||||
--define=clideVersion=$(VERSION) \
|
||||
--define=clideCommit=$(COMMIT) \
|
||||
--define=clideDate=$(DATE)
|
||||
else
|
||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
||||
endif
|
||||
|
||||
DAEMON_PID_FILE := /tmp/clide-daemon-$(shell id -u).pid
|
||||
# -- app (Flutter) -------------------------------------------------------
|
||||
|
||||
.PHONY: run
|
||||
run: stop build ## Build the daemon + launch the Flutter desktop app.
|
||||
ifeq ($(APP_PRESENT),yes)
|
||||
@echo "Starting daemon…"
|
||||
@bin/clide --daemon & echo $$! > $(DAEMON_PID_FILE)
|
||||
@echo "Daemon PID $$(cat $(DAEMON_PID_FILE))"
|
||||
@echo "Launching Flutter app…"
|
||||
-cd app && LD_LIBRARY_PATH=$(CURDIR)/app/native/linux-x64$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} flutter run -d linux
|
||||
@$(MAKE) --no-print-directory stop
|
||||
else
|
||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
||||
endif
|
||||
|
||||
.PHONY: stop
|
||||
stop: ## Kill any running clide daemon.
|
||||
@if [ -f $(DAEMON_PID_FILE) ]; then \
|
||||
kill $$(cat $(DAEMON_PID_FILE)) 2>/dev/null && echo "daemon stopped" || true; \
|
||||
rm -f $(DAEMON_PID_FILE); \
|
||||
fi
|
||||
|
||||
.PHONY: install
|
||||
install: build ## Install bin/clide into $(INSTALL_DIR).
|
||||
ifeq ($(APP_PRESENT),yes)
|
||||
install -m 0755 bin/clide $(INSTALL_DIR)/clide
|
||||
else
|
||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
||||
endif
|
||||
run: ## Launch the Flutter desktop app.
|
||||
LD_LIBRARY_PATH=$(CURDIR)/native/linux-x64$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} flutter run -d linux
|
||||
|
||||
.PHONY: pubget
|
||||
pubget: ## flutter pub get (hydrate the pub cache).
|
||||
ifeq ($(APP_PRESENT),yes)
|
||||
pubget: ## flutter pub get.
|
||||
flutter pub get
|
||||
else
|
||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
||||
endif
|
||||
|
||||
.PHONY: analyze
|
||||
analyze: ## dart analyze / flutter analyze.
|
||||
ifeq ($(APP_PRESENT),yes)
|
||||
analyze: ## flutter analyze.
|
||||
flutter analyze
|
||||
else
|
||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
||||
endif
|
||||
|
||||
.PHONY: format
|
||||
format: ## dart format --set-exit-if-changed.
|
||||
ifeq ($(APP_PRESENT),yes)
|
||||
dart format --set-exit-if-changed .
|
||||
else
|
||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
||||
endif
|
||||
|
||||
.PHONY: test
|
||||
test: ## Fast: analyze + format + unit + widget + golden (<60s).
|
||||
ci/test.sh
|
||||
|
||||
.PHONY: test-core
|
||||
test-core: ## Flutter-free core tests (IPC, daemon, PTY) with hard timeout.
|
||||
test-core: ## Core subsystem tests (IPC, PTY, git, pane registry).
|
||||
ci/test_core.sh
|
||||
|
||||
.PHONY: test-a11y
|
||||
@@ -108,7 +50,7 @@ test-integration: ## Integration tests (real app boot; xvfb on headless Linux).
|
||||
ci/test_integration.sh
|
||||
|
||||
.PHONY: test-e2e
|
||||
test-e2e: build ## Daemon subprocess + web WASM Playwright smoke.
|
||||
test-e2e: ## End-to-end Playwright smoke.
|
||||
ci/test_e2e.sh
|
||||
|
||||
.PHONY: test-all
|
||||
@@ -122,7 +64,7 @@ coverage: ## flutter test --coverage + lcov summary.
|
||||
smoke-bundle: ## Build Linux release bundle and run it under xvfb for 5s.
|
||||
ci/smoke_bundle.sh
|
||||
|
||||
# -- web UI harness (for Claude Code to drive the app) -----------------
|
||||
# -- web UI harness ------------------------------------------------------
|
||||
|
||||
.PHONY: ui-dev
|
||||
ui-dev: ## Build web WASM + start localhost:4280 in the background.
|
||||
@@ -141,23 +83,14 @@ ui-smoke: ## Build + serve + run Playwright smoke + stop.
|
||||
|
||||
.PHONY: build-linux
|
||||
build-linux: ## flutter build linux (desktop bundle).
|
||||
ifeq ($(APP_PRESENT),yes)
|
||||
flutter build linux
|
||||
else
|
||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
||||
endif
|
||||
|
||||
.PHONY: build-macos
|
||||
build-macos: ## flutter build macos (desktop bundle).
|
||||
ifeq ($(APP_PRESENT),yes)
|
||||
flutter build macos
|
||||
else
|
||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
||||
endif
|
||||
|
||||
# -- ptyc (C supporter tool) --------------------------------------------
|
||||
# -- ptyc (C supporter tool) ---------------------------------------------
|
||||
|
||||
# Compiled alongside the main binary. Tiny, no deps beyond libc.
|
||||
PTYC_PRESENT := $(shell test -f ptyc/Makefile && echo yes || echo no)
|
||||
|
||||
.PHONY: ptyc-build
|
||||
@@ -184,33 +117,32 @@ else
|
||||
@echo "(ptyc/ not scaffolded yet; skipping)"
|
||||
endif
|
||||
|
||||
# -- security ------------------------------------------------------------
|
||||
# -- security -------------------------------------------------------------
|
||||
|
||||
.PHONY: security
|
||||
security: ## Dart advisory review + ptyc source review (manual — no floating deps).
|
||||
security: ## Dart advisory review + ptyc source review.
|
||||
@echo "security: Dart advisories reviewed manually before pubspec.yaml bumps;"
|
||||
@echo " ptyc is reviewed by reading it (tiny libc-only C)."
|
||||
@echo " Automated Dart CVE tooling lands here when a reliable option exists."
|
||||
|
||||
# -- pre-push gate -------------------------------------------------------
|
||||
# -- pre-push gate --------------------------------------------------------
|
||||
|
||||
.PHONY: decisions-validate
|
||||
decisions-validate: ## Parser dry-run over decisions/*.md (cheap pre-push gate).
|
||||
decisions-validate: ## Parser dry-run over decisions/*.md.
|
||||
pql decisions validate
|
||||
|
||||
.PHONY: push-check
|
||||
push-check: decisions-validate test-core test test-a11y ## Pre-push gate: decisions + core + fast unit + widget + golden + a11y (<90s).
|
||||
push-check: decisions-validate test-core test test-a11y ## Pre-push gate.
|
||||
|
||||
.PHONY: hooks
|
||||
hooks: ## Install the repo's git hooks (points core.hooksPath at .githooks/).
|
||||
hooks: ## Install the repo's git hooks.
|
||||
git config core.hooksPath .githooks
|
||||
@echo "hooks installed (core.hooksPath = .githooks)"
|
||||
|
||||
# -- housekeeping --------------------------------------------------------
|
||||
# -- housekeeping ---------------------------------------------------------
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Remove build artefacts.
|
||||
rm -rf bin build .dart_tool
|
||||
rm -rf build .dart_tool
|
||||
$(MAKE) ptyc-clean
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
Reference in New Issue
Block a user