mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-09-10 23:15:40 +00:00
157ca4e88f
* chore: bump Go toolchain to 1.26 (TASK-763) Bump Go from 1.25 to 1.26 across all toolchain pins: - go.mod — go 1.25.0 → go 1.26.0 - Dockerfile — golang:1.25-alpine → golang:1.26-alpine - .github/workflows/ci.yml — three setup-go steps (Go, Go-Postgres, E2E jobs) - .github/workflows/release.yml — release pipeline No `toolchain` directive: the repo is pre-launch with no external contributors yet, so we set the floor where we want it (hard requirement). Verified locally before commit: - golangci-lint v2.11.4 builds and runs under Go 1.26.2 (pinned in CI) - golang:1.26-alpine and 1.26.2-alpine images present on Docker Hub - go build ./... clean - go vet ./... clean - go test ./... all pass Parent: PLAN-644 (OSS Repo Hygiene and Launch Polish). * chore: gofmt -w under Go 1.26 (TASK-763) Apply Go 1.26's gofmt to the codebase. ~41 files reformatted, all struct-tag whitespace realignment — no semantic changes. Verified: - gofmt -l ./cmd ./internal returns empty after - go build ./... still clean - go test ./... still passes (run before commit) Bundling the gofmt diff with the toolchain bump in the same PR because the formatting drift is a direct consequence of moving from 1.25 to 1.26; splitting them creates a mandatory two-PR ordering for no value. Parent: PLAN-644. * docs: bump documented Go floor to 1.26 (TASK-763) Match go.mod's hard 1.26.0 requirement in the source-build instructions. Caught by Codex review round 1 on PR #247. - README.md:158 — "Go 1.25+" → "Go 1.26+" - CONTRIBUTING.md:9 — "Go 1.25+" → "Go 1.26+"
3.9 KiB
3.9 KiB
Contributing to Pad
Thanks for your interest in contributing to Pad! This guide will help you get set up and familiar with how we work.
Getting Started
Prerequisites
- Go 1.26+
- Node.js 22+
- Make
Setup
git clone https://github.com/xarmian/pad
cd pad
make build # Build web UI + Go binary
This produces a ./pad binary in the project root.
Development
make build # Full build: web UI + Go binary
make build-go # Go only (skip web — faster for backend changes)
make dev-web # SvelteKit dev server with hot reload (localhost:5173)
make test # Run Go tests
make lint # Run go vet
make install # Build, install to ~/.local/bin/pad, restart server
Typical workflow:
- Make your changes
make buildto verify everything compilesmake testto run testsmake installto test the full binary locally- Open http://localhost:7777 to verify the web UI
Project Structure
cmd/pad/main.go — CLI entry point (Cobra commands)
internal/
server/ — HTTP API handlers, SSE, middleware
store/ — SQLite CRUD, migrations, FTS
models/ — Go types
items/ — Field validation
collections/ — Default schemas, templates
cli/ — HTTP client, formatting
events/ — EventBus for real-time SSE
config/ — Workspace detection
web/src/
routes/ — SvelteKit pages
lib/api/client.ts — TypeScript API client
lib/types/index.ts — TypeScript types
lib/components/ — Reusable UI components
skills/pad/SKILL.md — Claude Code agent skill
Making Changes
Branch Naming
Use descriptive branch names:
feat/relation-field-picker— new featuresfix/dashboard-progress-bar— bug fixesdocs/update-api-reference— documentationrefactor/store-interface— refactoring
Commit Messages
Write clear, concise commit messages that explain why, not just what:
Add phase relation field to Tasks collection
Tasks can now be linked to phases via a relation field,
enabling progress tracking on the phase detail page.
Pull Requests
- Keep PRs focused — one feature or fix per PR
- Include a description of what changed and why
- Add tests for new backend functionality
- Verify
make buildandmake testpass before opening
Code Style
- Go: Standard
gofmtformatting. Rungo vet ./...to catch issues. - Svelte: Follow existing component patterns. Use Svelte 5 runes (
$state,$derived,$effect). - TypeScript: Types live in
web/src/lib/types/index.ts.
Adding Features
New API Endpoint
- Add handler in
internal/server/handlers_*.go - Register route in
internal/server/server.go(setupRouter()) - Add store method in
internal/store/if needed - Add CLI client method in
internal/cli/client.go - Add TypeScript type in
web/src/lib/types/index.ts - Add API method in
web/src/lib/api/client.ts
New CLI Command
- Add function in
cmd/pad/main.go - Register in
rootCmd.AddCommand()
Database Migration
- Add migration in
internal/store/migrations/ - Update models in
internal/models/ - Migrations run automatically on server start
Reporting Issues
- Bugs: Use the bug report template — include steps to reproduce
- Features: Use the feature request template — describe the problem first, then your proposed solution
- Questions: Open a discussion or issue
Contributor License Agreement
By submitting a pull request, you agree to the terms of our Contributor License Agreement. This is a lightweight CLA that preserves your rights while granting the project maintainers flexibility for future licensing decisions.
License
Pad is licensed under Apache 2.0. By contributing, your code is released under the same license.