Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/go-int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
- name: Deps
run: |
just go::deps
just react::deps
just react-deps
- name: Build UI
run: just react::build
run: just react-build
- name: Linux tuning
run: just linux-tune
- name: Integration
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
just go::deps
just go::mod
just react::deps
just react-deps
- name: Test
run: just test
- name: Upload coverage reports to Codecov
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ examples/**
!examples/**/*.go
!examples/**/*.mod
!examples/**/*.sum

# Host network state written by `netplan status --format=json`
netplanStatus.txt
4 changes: 0 additions & 4 deletions .just/remote/react.mod.just

This file was deleted.

10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ just go::vet # Run golangci-lint
just go::fmt # Auto-format (gofumpt + golines)
go test -run TestName -v ./internal/job/... # Run a single test

just react::dev # Start UI dev server (http://localhost:5173)
just react::build # Production UI build
just react::lint # Run ESLint on UI
just react::fmt # Format UI with Prettier
just react-dev # Start UI dev server (http://localhost:5173)
just react-build # Production UI build
just react-lint # Run ESLint on UI
just react-fmt # Format UI with Prettier
```

## Architecture (Quick Reference)
Expand Down Expand Up @@ -66,7 +66,7 @@ just react::fmt # Format UI with Prettier
- **`ui/embed.go`** - `//go:embed dist/*` directive exposing `ui.Assets`.
- **`internal/controller/api/ui/`** - SPA serving handler (static files + `index.html` fallback for client-side routing).
- Config: `controller.ui.enabled` in `osapi.yaml` (default `true`).
- `//go:embed dist/*` requires `ui/dist/` to have files at compile time. Always use `just build` / `just test` / `just ready` — these run `just react::build` first. Running `go build` / `go test` directly without a prior UI build will fail.
- `//go:embed dist/*` requires `ui/dist/` to have files at compile time. Always use `just build` / `just test` / `just ready` — these run `just react-build` first. Running `go build` / `go test` directly without a prior UI build will fail.

## UI Conventions (MANDATORY)

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sidebar/architecture/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ in order:
`internal/controller/api/gen/api.yaml`.
2. `go generate` regenerates Go server and SDK code.
3. The combined spec is copied to `ui/src/sdk/gen/api.yaml`.
4. `just react::generate` runs orval against the copied spec to regenerate typed
4. `just react-generate` runs orval against the copied spec to regenerate typed
fetch functions and schema types under `ui/src/sdk/gen/`.

### Fetch mutator
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/sidebar/development/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ just build # Builds React UI + Go binary

Use `just build` (not `go build` directly). The `//go:embed` directive for the
UI assets requires `ui/dist/` to be populated at compile time — `just build`
runs `just react::build` first to satisfy this. The same applies to tests: use
runs `just react-build` first to satisfy this. The same applies to tests: use
`just test`, not `go test ./...`.

:::
Expand All @@ -85,7 +85,7 @@ runs `just react::build` first to satisfy this. The same applies to tests: use

The embedded React management dashboard has its own development workflow. See
the [UI Development](ui-development.md) guide for prerequisites, the development
server (`just react::dev`), code style, and component conventions.
server (`just react-dev`), code style, and component conventions.

## Documentation

Expand Down
10 changes: 5 additions & 5 deletions docs/docs/sidebar/development/ui-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ This installs Go modules, Docusaurus dependencies, and the UI's Bun packages. To
install only the UI dependencies:

```bash
just react::deps
just react-deps
```

## Development server

```bash
just react::dev
just react-dev
```

Opens at `http://localhost:5173`. Hot-reloads on file changes.
Expand Down Expand Up @@ -69,7 +69,7 @@ page. If not set, users paste their token on the sign-in page.
just build
```

This is the top-level build recipe. It runs `just react::build` first (to
This is the top-level build recipe. It runs `just react-build` first (to
populate `ui/dist/` with static assets), then `just go::build` to produce the Go
binary with the assets embedded via the `//go:embed` directive in `ui/embed.go`.
The controller API serves these assets at runtime from the embedded filesystem —
Expand Down Expand Up @@ -104,8 +104,8 @@ TypeScript and CSS are formatted by [Prettier][] and linted using [ESLint][].
This style is enforced by CI.

```bash
just react::fmt # Auto-fix formatting
just react::lint # Run ESLint
just react-fmt # Auto-fix formatting
just react-lint # Run ESLint
```

### Component conventions
Expand Down
23 changes: 14 additions & 9 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@
# .github/codecov.yml — change both together.
export JUST_COVERAGE_TARGET := "99.9"

# The React application lives in ui/, not at the repository root. The flat
# react module requires the importing justfile to declare it.
react_dir := "ui"

mod? go '.just/remote/go.mod.just'
mod? docs '.just/remote/docs.mod.just'
mod? just '.just/remote/just.mod.just'
mod? docker '.just/remote/docker.mod.just'
mod? react '.just/remote/react.mod.just'

import? '.just/remote/react.just'

# --- Fetch ---

Expand All @@ -27,7 +32,7 @@ fetch:
curl -sSfL https://raw.githubusercontent.com/osapi-io/osapi-justfiles/refs/heads/main/just.just -o .just/remote/just.just
curl -sSfL https://raw.githubusercontent.com/osapi-io/osapi-justfiles/refs/heads/main/docker.mod.just -o .just/remote/docker.mod.just
curl -sSfL https://raw.githubusercontent.com/osapi-io/osapi-justfiles/refs/heads/main/docker.just -o .just/remote/docker.just
curl -sSfL https://raw.githubusercontent.com/osapi-io/osapi-justfiles/refs/heads/main/react.just -o .just/remote/react.just
curl -sSfL https://raw.githubusercontent.com/osapi-io/osapi-justfiles/refs/heads/main/react/react.just -o .just/remote/react.just

# --- Top-level orchestration ---

Expand All @@ -36,17 +41,17 @@ deps:
just go::deps
just go::mod
just docs::deps
just react::deps
just react-deps

# Build production binary (includes embedded UI)
build:
just react::build
just react-build
go build -o osapi .

# Run all tests
test: linux-tune
just just::fmt-check
just react::build
just react-build
just go::test

# Generate code
Expand All @@ -55,7 +60,7 @@ generate:
just go::generate
just docs::generate
cp internal/controller/api/gen/api.yaml ui/src/sdk/gen/api.yaml
just react::generate
just react-generate

# Format, lint, and generate before committing
ready:
Expand All @@ -64,9 +69,9 @@ ready:
just docs::fmt
just go::fmt
just go::vet
just react::fmt
just react::lint
just react::build
just react-fmt
just react-lint
just react-build

[linux]
linux-tune:
Expand Down
Loading