This repository has been archived on 2026-04-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core/CONTRIBUTING.md
Jeffrey Smith 680ec3b897
All checks were successful
CI/CD / detect-changes (push) Successful in 3s
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m34s
CI/CD / test-sqlite (push) Successful in 2m46s
CI/CD / build-and-deploy (push) Successful in 1m55s
Feat rebrand armature (#43)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
2026-03-31 23:25:37 +00:00

65 lines
2.1 KiB
Markdown

# Contributing to Armature
## Development Setup
**Requirements:** Go 1.23+, Node.js 20+ (for frontend tests), SQLite (local dev).
**Build from source:**
```sh
cd server
go build -o armature .
DB_DRIVER=sqlite DATABASE_URL=/tmp/armature.db ./armature
```
**Docker (recommended):**
```sh
docker compose up --build
# open http://localhost:3000 (default login: admin / admin)
```
Data persists in the `sb_data` named volume. Reset with `docker compose down -v`.
## Project Structure
```
server/ Go backend (handlers, store, config, auth, workflow engine)
src/js/ Browser SDK and built-in surface JS
packages/ Extension packages (surfaces, libraries, browser extensions)
build.sh Builds each subdirectory into a .pkg archive
docs/ Documentation markdown (served at /api/v1/docs)
k8s/ Kubernetes manifests and Helm chart
```
## Running Tests
**Backend:** `cd server && go test ./...`
**Frontend:** `node --test src/js/__tests__/`
## Code Conventions
- **Go:** Standard formatting via `gofmt`. Handlers in `server/handlers/`,
persistence in `server/store/`. Database access goes through the store
interface, never directly from handlers.
- **Browser JS:** Vanilla ES modules + Preact via CDN. No build step for
browser code (except the CM6 editor bundle). SDK lives at `src/js/sw/`.
- **Extensions:** IIFE pattern (see `packages/*/js/script.js`). Register with
`sw.renderers` or `sw.slots` via the `sw:ready` event.
## Creating a Package
A package is a ZIP archive (`.pkg`) containing `manifest.json` and optional
`js/`, `css/`, `assets/`, and `script.star` files. The build script
(`packages/build.sh`) automates this. See `docs/PACKAGE-FORMAT.md` for the
full manifest spec and `docs/TUTORIAL-FIRST-EXTENSION.md` for a walkthrough.
## Pull Request Process
1. Create a feature branch from `main`.
2. Make your changes. Keep commits focused.
3. Run both Go and JS test suites and confirm they pass.
4. Submit a PR with a clear description of what changed and why.
5. Address review feedback, then squash-merge when approved.