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: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.core/
.idea/
.vscode/
*.log
.core/
16 changes: 8 additions & 8 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

`core/go-build` is the build system, release pipeline, and SDK generation tool for the Core ecosystem. Three subsystems under `pkg/` — **build**, **release**, **sdk** — can be used as libraries or wired together via CLI commands in `cmd/`. This repo produces no standalone binary; `cmd/` packages register commands via `cli.RegisterCommands()` in `init()` functions, compiled into the `core` binary from `forge.lthn.ai/core/cli`.
`core/go-build` is the build system, release pipeline, and SDK generation tool for the Core ecosystem. Three subsystems under `pkg/` — **build**, **release**, **sdk** — can be used as libraries or wired together via CLI commands in `cmd/`. This repo produces no standalone binary; `cmd/` packages register commands via `cli.RegisterCommands()` in `init()` functions, compiled into the `core` binary from `forge.lthn.ai/core/cli`. Module path: `dappco.re/go/core/build`.

## Build & Test

Expand All @@ -15,7 +15,7 @@ go test ./pkg/build/... -run TestLoadConfig_Good # single test by name
go test -race ./... # with race detection
```

**Go workspace**: this module is part of `~/Code/go.work`. Run `go work sync` after cloning. Set `GOPRIVATE=forge.lthn.ai/*` for private module fetching.
**Go workspace**: this module is part of `~/Code/go.work`. Run `go work sync` after cloning. Set `GOPRIVATE=dappco.re/*,forge.lthn.ai/*` for private module fetching.

## Architecture

Expand Down Expand Up @@ -49,7 +49,7 @@ project dir -> Discover() -> ProjectType -> getBuilder() -> Builder.Build

### Filesystem Abstraction

All file operations use `io.Medium` from `forge.lthn.ai/core/go-io`. Production uses `io.Local`; tests inject mocks for isolation.
All file operations use `io.Medium` from `dappco.re/go/core/io`. Production uses `io.Local`; tests inject mocks for isolation.

### Configuration Files

Expand All @@ -60,7 +60,7 @@ All file operations use `io.Medium` from `forge.lthn.ai/core/go-io`. Production

- **UK English** in comments and strings (colour, organisation, notarisation)
- **Strict types** — all parameters and return types explicitly typed
- **Error wrapping** — `coreerr.E("package.Function", "message", err)` via `coreerr "forge.lthn.ai/core/go-log"`
- **Error wrapping** — `coreerr.E("package.Function", "message", err)` via `coreerr "dappco.re/go/core/log"`
- **testify** (`assert`/`require`) for assertions
- **Test naming** — `_Good` (happy path), `_Bad` (expected errors), `_Ugly` (edge cases)
- **Conventional commits** — `type(scope): description`
Expand All @@ -76,9 +76,9 @@ All file operations use `io.Medium` from `forge.lthn.ai/core/go-io`. Production

## Dependencies

- `forge.lthn.ai/core/cli` — Command registration (`cli.RegisterCommands`, `cli.Command`)
- `forge.lthn.ai/core/go-io` — Filesystem abstraction (`io.Medium`, `io.Local`)
- `forge.lthn.ai/core/go-i18n` — Internationalisation (`i18n.T()`, `i18n.Label()`)
- `forge.lthn.ai/core/go-log` — Structured logging
- `forge.lthn.ai/core/cli` — Command registration (`cli.RegisterCommands`, `cli.Command`) *(not yet migrated)*
- `dappco.re/go/core/io` — Filesystem abstraction (`io.Medium`, `io.Local`)
- `dappco.re/go/core/i18n` — Internationalisation (`i18n.T()`, `i18n.Label()`)
- `dappco.re/go/core/log` — Structured logging
- `github.com/Snider/Borg` — XZ compression for archives
- `github.com/getkin/kin-openapi` + `github.com/oasdiff/oasdiff` — OpenAPI parsing and diff
4 changes: 2 additions & 2 deletions cmd/build/cmd_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ package buildcmd
import (
"embed"

_ "dappco.re/go/core/build/locales" // registers locale translations
"dappco.re/go/core/i18n"
"forge.lthn.ai/core/cli/pkg/cli"
_ "forge.lthn.ai/core/go-build/locales" // registers locale translations
"forge.lthn.ai/core/go-i18n"
)

func init() {
Expand Down
12 changes: 6 additions & 6 deletions cmd/build/cmd_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"runtime"
"strings"

"forge.lthn.ai/core/go-build/pkg/build"
"forge.lthn.ai/core/go-build/pkg/build/builders"
"forge.lthn.ai/core/go-build/pkg/build/signing"
"forge.lthn.ai/core/go-i18n"
"forge.lthn.ai/core/go-io"
coreerr "forge.lthn.ai/core/go-log"
"dappco.re/go/core/build/pkg/build"
"dappco.re/go/core/build/pkg/build/builders"
"dappco.re/go/core/build/pkg/build/signing"
"dappco.re/go/core/i18n"
"dappco.re/go/core/io"
coreerr "dappco.re/go/core/log"
)

// runProjectBuild handles the main `core build` command with auto-detection.
Expand Down
6 changes: 3 additions & 3 deletions cmd/build/cmd_pwa.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"path/filepath"
"strings"

"forge.lthn.ai/core/go-i18n"
coreio "forge.lthn.ai/core/go-io"
coreerr "forge.lthn.ai/core/go-log"
"dappco.re/go/core/i18n"
coreio "dappco.re/go/core/io"
coreerr "dappco.re/go/core/log"
"github.com/leaanthony/debme"
"github.com/leaanthony/gosod"
"golang.org/x/net/html"
Expand Down
12 changes: 6 additions & 6 deletions cmd/build/cmd_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"context"
"os"

"dappco.re/go/core/build/pkg/release"
"dappco.re/go/core/i18n"
coreerr "dappco.re/go/core/log"
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-log"
"forge.lthn.ai/core/go-i18n"
"forge.lthn.ai/core/go-build/pkg/release"
)

// Flag variables for release command
Expand Down Expand Up @@ -51,7 +51,7 @@ func runRelease(ctx context.Context, dryRun bool, version string, draft, prerele
// Get current directory
projectDir, err := os.Getwd()
if err != nil {
return log.E("release", "get working directory", err)
return coreerr.E("release", "get working directory", err)
}

// Check for release config
Expand All @@ -61,13 +61,13 @@ func runRelease(ctx context.Context, dryRun bool, version string, draft, prerele
i18n.T("cmd.build.release.error.no_config"),
)
cli.Print(" %s\n", buildDimStyle.Render(i18n.T("cmd.build.release.hint.create_config")))
return log.E("release", "config not found", nil)
return coreerr.E("release", "config not found", nil)
}

// Load configuration
cfg, err := release.LoadConfig(projectDir)
if err != nil {
return log.E("release", "load config", err)
return coreerr.E("release", "load config", err)
}

// Apply CLI overrides
Expand Down
6 changes: 3 additions & 3 deletions cmd/build/cmd_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"os"
"strings"

"forge.lthn.ai/core/go-build/pkg/sdk"
"forge.lthn.ai/core/go-i18n"
coreerr "forge.lthn.ai/core/go-log"
"dappco.re/go/core/build/pkg/sdk"
"dappco.re/go/core/i18n"
coreerr "dappco.re/go/core/log"
)

// runBuildSDK handles the `core build sdk` command.
Expand Down
6 changes: 3 additions & 3 deletions cmd/ci/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os/exec"
"strings"

"dappco.re/go/core/build/pkg/release"
"dappco.re/go/core/i18n"
coreerr "dappco.re/go/core/log"
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-i18n"
"forge.lthn.ai/core/go-build/pkg/release"
coreerr "forge.lthn.ai/core/go-log"
)

// Style aliases from shared
Expand Down
6 changes: 3 additions & 3 deletions cmd/sdk/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ package sdkcmd
import (
"os"

"dappco.re/go/core/build/pkg/sdk"
"dappco.re/go/core/i18n"
coreerr "dappco.re/go/core/log"
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-build/pkg/sdk"
"forge.lthn.ai/core/go-i18n"
coreerr "forge.lthn.ai/core/go-log"
)

func init() {
Expand Down
28 changes: 21 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module forge.lthn.ai/core/go-build
module dappco.re/go/core/build

go 1.26.0

require (
forge.lthn.ai/core/api v0.1.5
dappco.re/go/core/api v0.1.5
dappco.re/go/core/i18n v0.1.7
dappco.re/go/core/io v0.2.0
dappco.re/go/core/log v0.1.0
dappco.re/go/core/ws v0.2.5
forge.lthn.ai/core/cli v0.3.7
forge.lthn.ai/core/go-i18n v0.1.7
forge.lthn.ai/core/go-io v0.1.7
forge.lthn.ai/core/go-log v0.0.4
forge.lthn.ai/core/go-ws v0.2.5
github.com/Snider/Borg v0.2.0
github.com/gin-gonic/gin v1.12.0
github.com/leaanthony/debme v1.2.1
Expand All @@ -23,8 +23,11 @@ require (

require (
cloud.google.com/go v0.123.0 // indirect
forge.lthn.ai/core/go v0.3.3 // indirect
dappco.re/go/core v0.5.0 // indirect
forge.lthn.ai/core/go v0.3.2 // indirect
forge.lthn.ai/core/go-i18n v0.1.7 // indirect
forge.lthn.ai/core/go-inference v0.1.7 // indirect
forge.lthn.ai/core/go-log v0.0.4 // indirect
github.com/99designs/gqlgen v0.17.88 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/TwiN/go-color v1.4.1 // indirect
Expand Down Expand Up @@ -152,3 +155,14 @@ require (
golang.org/x/tools v0.43.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
)

replace (
dappco.re/go/core => /Users/snider/Code/core/go
dappco.re/go/core/api => /Users/snider/Code/core/api
dappco.re/go/core/i18n => /Users/snider/Code/core/go-i18n
dappco.re/go/core/io => /Users/snider/Code/core/go-io
dappco.re/go/core/log => /Users/snider/Code/core/go-log
dappco.re/go/core/ws => /Users/snider/Code/core/go-ws
forge.lthn.ai/core/cli => /Users/snider/Code/core/cli
forge.lthn.ai/core/go-inference => /Users/snider/Code/core/go-inference
)
14 changes: 2 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE=
cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU=
forge.lthn.ai/core/api v0.1.5 h1:NwZrcOyBjaiz5/cn0n0tnlMUodi8Or6FHMx59C7Kv2o=
forge.lthn.ai/core/api v0.1.5/go.mod h1:PBnaWyOVXSOGy+0x2XAPUFMYJxQ2CNhppia/D06ZPII=
forge.lthn.ai/core/cli v0.3.7 h1:1GrbaGg0wDGHr6+klSbbGyN/9sSbHvFbdySJznymhwg=
forge.lthn.ai/core/cli v0.3.7/go.mod h1:DBUppJkA9P45ZFGgI2B8VXw1rAZxamHoI/KG7fRvTNs=
forge.lthn.ai/core/go v0.3.3 h1:kYYZ2nRYy0/Be3cyuLJspRjLqTMxpckVyhb/7Sw2gd0=
forge.lthn.ai/core/go v0.3.3/go.mod h1:Cp4ac25pghvO2iqOu59t1GyngTKVOzKB5/VPdhRi9CQ=
forge.lthn.ai/core/go v0.3.2 h1:VB9pW6ggqBhe438cjfE2iSI5Lg+62MmRbaOFglZM+nQ=
forge.lthn.ai/core/go v0.3.2/go.mod h1:f7/zb3Labn4ARfwTq5Bi2AFHY+uxyPHozO+hLb54eFo=
forge.lthn.ai/core/go-i18n v0.1.7 h1:aHkAoc3W8fw3RPNvw/UszQbjyFWXHszzbZgty3SwyAA=
forge.lthn.ai/core/go-i18n v0.1.7/go.mod h1:0VDjwtY99NSj2iqwrI09h5GUsJeM9s48MLkr+/Dn4G8=
forge.lthn.ai/core/go-inference v0.1.7 h1:9Dy6v03jX5ZRH3n5iTzlYyGtucuBIgSe+S7GWvBzx9Q=
forge.lthn.ai/core/go-inference v0.1.7/go.mod h1:jfWz+IJX55wAH98+ic6FEqqGB6/P31CHlg7VY7pxREw=
forge.lthn.ai/core/go-io v0.1.7 h1:Tdb6sqh+zz1lsGJaNX9RFWM6MJ/RhSAyxfulLXrJsbk=
forge.lthn.ai/core/go-io v0.1.7/go.mod h1:8lRLFk4Dnp5cR/Cyzh9WclD5566TbpdRgwcH7UZLWn4=
forge.lthn.ai/core/go-log v0.0.4 h1:KTuCEPgFmuM8KJfnyQ8vPOU1Jg654W74h8IJvfQMfv0=
forge.lthn.ai/core/go-log v0.0.4/go.mod h1:r14MXKOD3LF/sI8XUJQhRk/SZHBE7jAFVuCfgkXoZPw=
forge.lthn.ai/core/go-ws v0.2.5 h1:ZIV7Yrv01R/xpJUogA5vrfP9yB9li1w7EV3eZFMt8h0=
forge.lthn.ai/core/go-ws v0.2.5/go.mod h1:C3riJyLLcV6QhLvYlq3P/XkGTsN598qQeGBoLdoHBU4=
github.com/99designs/gqlgen v0.17.88 h1:neMQDgehMwT1vYIOx/w5ZYPUU/iMNAJzRO44I5Intoc=
github.com/99designs/gqlgen v0.17.88/go.mod h1:qeqYFEgOeSKqWedOjogPizimp2iu4E23bdPvl4jTYic=
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
Expand Down
2 changes: 1 addition & 1 deletion locales/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package locales
import (
"embed"

"forge.lthn.ai/core/go-i18n"
"dappco.re/go/core/i18n"
)

//go:embed *.json
Expand Down
16 changes: 8 additions & 8 deletions pkg/api/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"os"
"path/filepath"

"forge.lthn.ai/core/api"
"forge.lthn.ai/core/api/pkg/provider"
"forge.lthn.ai/core/go-build/pkg/build"
"forge.lthn.ai/core/go-build/pkg/build/builders"
"forge.lthn.ai/core/go-build/pkg/release"
"forge.lthn.ai/core/go-build/pkg/sdk"
"forge.lthn.ai/core/go-io"
"forge.lthn.ai/core/go-ws"
"dappco.re/go/core/api"
"dappco.re/go/core/api/pkg/provider"
"dappco.re/go/core/build/pkg/build"
"dappco.re/go/core/build/pkg/build/builders"
"dappco.re/go/core/build/pkg/release"
"dappco.re/go/core/build/pkg/sdk"
"dappco.re/go/core/io"
"dappco.re/go/core/ws"
"github.com/gin-gonic/gin"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/api/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"testing"

"forge.lthn.ai/core/go-build/pkg/build"
"dappco.re/go/core/build/pkg/build"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/build/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"path/filepath"
"strings"

io_interface "forge.lthn.ai/core/go-io"
coreerr "forge.lthn.ai/core/go-log"
io_interface "dappco.re/go/core/io"
coreerr "dappco.re/go/core/log"
"github.com/Snider/Borg/pkg/compress"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/build/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"path/filepath"
"testing"

io_interface "dappco.re/go/core/io"
"github.com/Snider/Borg/pkg/compress"
io_interface "forge.lthn.ai/core/go-io"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package build
import (
"context"

"forge.lthn.ai/core/go-io"
"dappco.re/go/core/io"
)

// ProjectType represents a detected project type.
Expand Down
6 changes: 3 additions & 3 deletions pkg/build/builders/cpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"runtime"
"strings"

"forge.lthn.ai/core/go-build/pkg/build"
"forge.lthn.ai/core/go-io"
coreerr "forge.lthn.ai/core/go-log"
"dappco.re/go/core/build/pkg/build"
"dappco.re/go/core/io"
coreerr "dappco.re/go/core/log"
)

// CPPBuilder implements the Builder interface for C++ projects using CMake + Conan.
Expand Down
4 changes: 2 additions & 2 deletions pkg/build/builders/cpp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"path/filepath"
"testing"

"forge.lthn.ai/core/go-build/pkg/build"
"forge.lthn.ai/core/go-io"
"dappco.re/go/core/build/pkg/build"
"dappco.re/go/core/io"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/build/builders/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"path/filepath"
"strings"

"forge.lthn.ai/core/go-build/pkg/build"
"forge.lthn.ai/core/go-io"
coreerr "forge.lthn.ai/core/go-log"
"dappco.re/go/core/build/pkg/build"
"dappco.re/go/core/io"
coreerr "dappco.re/go/core/log"
)

// DockerBuilder builds Docker images.
Expand Down
4 changes: 2 additions & 2 deletions pkg/build/builders/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"path/filepath"
"testing"

"forge.lthn.ai/core/go-build/pkg/build"
"forge.lthn.ai/core/go-io"
"dappco.re/go/core/build/pkg/build"
"dappco.re/go/core/io"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/build/builders/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"path/filepath"
"strings"

"forge.lthn.ai/core/go-build/pkg/build"
"forge.lthn.ai/core/go-io"
coreerr "forge.lthn.ai/core/go-log"
"dappco.re/go/core/build/pkg/build"
"dappco.re/go/core/io"
coreerr "dappco.re/go/core/log"
)

// GoBuilder implements the Builder interface for Go projects.
Expand Down
4 changes: 2 additions & 2 deletions pkg/build/builders/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"runtime"
"testing"

"forge.lthn.ai/core/go-build/pkg/build"
"forge.lthn.ai/core/go-io"
"dappco.re/go/core/build/pkg/build"
"dappco.re/go/core/io"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
Loading