v0.1 bf7c821

Makefile RawHistoryFolder

1# Makefile for dumber
2
3.PHONY: build build-frontend test lint clean install-tools dev generate help check init build-static
4
5# Variables
6BINARY_NAME=dumber
7MAIN_PATH=.
8DIST_DIR=dist
9
10# Version information from git
11VERSION=$(shell git describe --tags --always --dirty 2>/dev/null || echo "v0.0.0-dev")
12COMMIT=$(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
13BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
14
15# Linker flags
16LDFLAGS=-ldflags "-s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.buildDate=$(BUILD_DATE)"
17
18# Default target
19help: ## Show this help message
20	@echo "Available targets:"
21	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "  \033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
22
23# Build targets
24build: build-frontend ## Build the application (frontend assets, then Go binary)
25	@echo "Building $(BINARY_NAME) $(VERSION)..."
26	@mkdir -p $(DIST_DIR)
27	CGO_ENABLED=1 go build $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH)
28
29build-frontend: ## Build TypeScript frontend
30	@echo "Building TypeScript frontend..."
31	@cd frontend && npm install --silent && npm run build
32	@echo "Frontend build complete"
33
34build-static: ## Build static binary (CGO disabled, CLI-only functionality)
35	@echo "Building static $(BINARY_NAME) $(VERSION) (CLI-only)..."
36	@mkdir -p $(DIST_DIR)
37	CGO_ENABLED=0 go build $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME)-static $(MAIN_PATH)
38
39# GUI build with WebKit2GTK
40.PHONY: build-gui run-gui
41build-gui: build-frontend ## Build GUI binary with native WebKit2GTK (requires dev packages)
42	@echo "Building $(BINARY_NAME) (GUI, webkit_cgo)…"
43	@mkdir -p $(DIST_DIR)
44	CGO_ENABLED=1 go build $(LDFLAGS) -tags=webkit_cgo -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH)
45
46run-gui: ## Run the GUI with native WebKit2GTK (requires dev packages)
47	@echo "Running GUI (webkit_cgo)…"
48	CGO_ENABLED=1 go run -tags=webkit_cgo $(MAIN_PATH)
49
50# Development targets
51dev: ## Run in development mode
52	@echo "Running in development mode..."
53	go run $(MAIN_PATH)
54
55generate: ## Generate code (SQLC)
56	@echo "Generating code with SQLC..."
57	sqlc generate
58	@echo "Code generation complete"
59
60# Testing
61test: ## Run tests
62	@echo "Running tests..."
63	CGO_ENABLED=0 go test -v ./...
64
65test-race: ## Run tests with race detection
66	@echo "Running tests with race detection..."
67	CGO_ENABLED=1 go test -race -v ./...
68
69# Linting
70lint: ## Run golangci-lint
71	@echo "Running golangci-lint..."
72	golangci-lint run
73
74lint-fix: ## Run golangci-lint with --fix
75	@echo "Running golangci-lint with --fix..."
76	golangci-lint run --fix
77
78# Tools installation
79install-tools: ## Install development tools
80	@echo "Installing development tools..."
81	go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
82	go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
83	@echo "Tools installed successfully"
84
85# Cleanup
86clean: ## Clean build artifacts
87	@echo "Cleaning build artifacts..."
88	rm -rf $(DIST_DIR)
89	rm -f $(BINARY_NAME)  # Remove any old binaries in root
90	rm -rf frontend/dist frontend/node_modules
91	go clean -cache
92	go clean -testcache
93
94# Project initialization 
95init: install-tools ## Initialize project dependencies and tools
96	@echo "Project dependencies and tools installed!"
97	@echo "Ready for development. Run 'make help' for available commands."
98
99# Check setup
100check: ## Check that all tools and dependencies are working
101	@echo "Checking project setup..."
102	@echo "Go version:"
103	@go version
104	@echo "\nSQLC version:"
105	@sqlc version
106	@echo "\nGolangci-lint version:"
107	@golangci-lint version
108	@echo "\nBuilding project..."
109	@make build
110	@echo "\nTesting built binary..."
111	@$(DIST_DIR)/$(BINARY_NAME) version
112	@echo "\nRunning tests..."
113	@make test
114	@echo "\n✅ All checks passed! Project is ready for development."

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close