diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4963a87 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + branches: [main, dev] + pull_request: + branches: [main] + pull_request_review: + types: [submitted] + +jobs: + test: + if: github.event_name != 'pull_request_review' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dAppCore/build/actions/build/core@dev + with: + go-version: "1.26" + run-vet: "true" + + auto-fix: + if: > + github.event_name == 'pull_request_review' && + github.event.review.user.login == 'coderabbitai' && + github.event.review.state == 'changes_requested' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + - uses: dAppCore/build/actions/fix@dev + with: + go-version: "1.26" + + auto-merge: + if: > + github.event_name == 'pull_request_review' && + github.event.review.user.login == 'coderabbitai' && + github.event.review.state == 'approved' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + - name: Merge PR + run: gh pr merge ${{ github.event.pull_request.number }} --merge --delete-branch + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 2c045df..cdc6f76 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -dist/ -.core/ .idea/ +.vscode/ +*.log +.core/ diff --git a/CLAUDE.md b/CLAUDE.md index 2594f0b..53333f7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,7 +2,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. -Agent instructions for `go-html`. Module path: `forge.lthn.ai/core/go-html` +Agent instructions for `go-html`. Module path: `dappco.re/go/core/html` ## Commands @@ -40,8 +40,9 @@ Files guarded with `//go:build !js` are excluded from WASM: ## Dependencies -- `forge.lthn.ai/core/go-i18n` (replace directive → `../go-i18n`) -- `forge.lthn.ai/core/go-inference` (indirect, via go-i18n) +- `dappco.re/go/core/i18n` (replace directive → local go-i18n) +- `forge.lthn.ai/core/go-inference` (indirect, via go-i18n; not yet migrated) +- `forge.lthn.ai/core/go-log` (indirect, via go-i18n; not yet migrated) - Both `go-i18n` and `go-inference` must be cloned alongside this repo for builds - Go 1.26+ required (uses `range` over integers, `iter.Seq`, `maps.Keys`, `slices.Collect`) diff --git a/bench_test.go b/bench_test.go index 63e6ab5..220363e 100644 --- a/bench_test.go +++ b/bench_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - i18n "forge.lthn.ai/core/go-i18n" + i18n "dappco.re/go/core/i18n" ) func init() { diff --git a/cmd/codegen/main.go b/cmd/codegen/main.go index 85bd76b..b72def3 100644 --- a/cmd/codegen/main.go +++ b/cmd/codegen/main.go @@ -11,8 +11,8 @@ import ( goio "io" "os" - "forge.lthn.ai/core/go-html/codegen" - log "forge.lthn.ai/core/go-log" + "dappco.re/go/core/html/codegen" + log "dappco.re/go/core/log" ) func run(r goio.Reader, w goio.Writer) error { diff --git a/cmd/wasm/main.go b/cmd/wasm/main.go index 254f08d..a3c0db2 100644 --- a/cmd/wasm/main.go +++ b/cmd/wasm/main.go @@ -5,7 +5,7 @@ package main import ( "syscall/js" - html "forge.lthn.ai/core/go-html" + html "dappco.re/go/core/html" ) // renderToString builds an HLCRF layout from JS arguments and returns HTML. diff --git a/cmd/wasm/register.go b/cmd/wasm/register.go index 543a178..d88c866 100644 --- a/cmd/wasm/register.go +++ b/cmd/wasm/register.go @@ -5,8 +5,8 @@ package main import ( "encoding/json" - "forge.lthn.ai/core/go-html/codegen" - log "forge.lthn.ai/core/go-log" + "dappco.re/go/core/html/codegen" + log "dappco.re/go/core/log" ) // buildComponentJS takes a JSON slot map and returns the WC bundle JS string. diff --git a/cmd/wasm/size_test.go b/cmd/wasm/size_test.go index 5552844..ed759c1 100644 --- a/cmd/wasm/size_test.go +++ b/cmd/wasm/size_test.go @@ -11,7 +11,7 @@ import ( "path/filepath" "testing" - coreio "forge.lthn.ai/core/go-io" + coreio "dappco.re/go/core/io" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/codegen/codegen.go b/codegen/codegen.go index b2e81f5..8692b0b 100644 --- a/codegen/codegen.go +++ b/codegen/codegen.go @@ -5,7 +5,7 @@ import ( "strings" "text/template" - log "forge.lthn.ai/core/go-log" + log "dappco.re/go/core/log" ) // wcTemplate is the Web Component class template. diff --git a/context.go b/context.go index 19cddfb..3bc77ef 100644 --- a/context.go +++ b/context.go @@ -1,6 +1,6 @@ package html -import i18n "forge.lthn.ai/core/go-i18n" +import i18n "dappco.re/go/core/i18n" // Context carries rendering state through the node tree. type Context struct { diff --git a/edge_test.go b/edge_test.go index c1f5e83..9ff9055 100644 --- a/edge_test.go +++ b/edge_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - i18n "forge.lthn.ai/core/go-i18n" + i18n "dappco.re/go/core/i18n" ) // --- Unicode / RTL edge cases --- diff --git a/go.mod b/go.mod index cf1b367..af2ee05 100644 --- a/go.mod +++ b/go.mod @@ -1,19 +1,27 @@ -module forge.lthn.ai/core/go-html +module dappco.re/go/core/html go 1.26.0 require ( - forge.lthn.ai/core/go-i18n v0.1.6 - forge.lthn.ai/core/go-io v0.1.2 - forge.lthn.ai/core/go-log v0.0.4 + dappco.re/go/core/i18n v0.1.8 + dappco.re/go/core/io v0.2.0 + dappco.re/go/core/log v0.1.0 github.com/stretchr/testify v1.11.1 ) require ( - forge.lthn.ai/core/go v0.3.1 // indirect - forge.lthn.ai/core/go-inference v0.1.5 // indirect + dappco.re/go/core v0.5.0 // indirect + forge.lthn.ai/core/go-inference v0.1.4 // indirect + forge.lthn.ai/core/go-log v0.0.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect golang.org/x/text v0.35.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + dappco.re/go/core => ../../../../core/go + dappco.re/go/core/i18n => ../../../../core/go-i18n + dappco.re/go/core/io => ../../../../core/go-io + dappco.re/go/core/log => ../../../../core/go-log +) diff --git a/go.sum b/go.sum index ba7391d..899aa9b 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,5 @@ -forge.lthn.ai/core/go v0.3.1 h1:5FMTsUhLcxSr07F9q3uG0Goy4zq4eLivoqi8shSY4UM= -forge.lthn.ai/core/go v0.3.1/go.mod h1:gE6c8h+PJ2287qNhVUJ5SOe1kopEwHEquvinstpuyJc= -forge.lthn.ai/core/go-i18n v0.1.6 h1:Z9h6sEZsgJmWlkkq3ZPZyfgWipeeqN5lDCpzltpamHU= -forge.lthn.ai/core/go-i18n v0.1.6/go.mod h1:C6CbwdN7sejTx/lbutBPrxm77b8paMHBO6uHVLHOdqQ= -forge.lthn.ai/core/go-inference v0.1.5 h1:Az/Euv1DusJQJz/Eca0Ey7sVXQkFLPHW0TBrs9g+Qwg= -forge.lthn.ai/core/go-inference v0.1.5/go.mod h1:jfWz+IJX55wAH98+ic6FEqqGB6/P31CHlg7VY7pxREw= -forge.lthn.ai/core/go-io v0.1.2 h1:q8hj2jtOFqAgHlBr5wsUAOXtaFkxy9gqGrQT/il0WYA= -forge.lthn.ai/core/go-io v0.1.2/go.mod h1:PbNKW1Q25ywSOoQXeGdQHbV5aiIrTXvHIQ5uhplA//g= +forge.lthn.ai/core/go-inference v0.1.4 h1:fuAgWbqsEDajHniqAKyvHYbRcBrkGEiGSqR2pfTMRY0= +forge.lthn.ai/core/go-inference v0.1.4/go.mod h1:jfWz+IJX55wAH98+ic6FEqqGB6/P31CHlg7VY7pxREw= 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= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= diff --git a/integration_test.go b/integration_test.go index 38c2da3..1a6346c 100644 --- a/integration_test.go +++ b/integration_test.go @@ -3,7 +3,7 @@ package html import ( "testing" - i18n "forge.lthn.ai/core/go-i18n" + i18n "dappco.re/go/core/i18n" ) func TestIntegration_RenderThenReverse(t *testing.T) { diff --git a/node.go b/node.go index 54a359c..f47ee36 100644 --- a/node.go +++ b/node.go @@ -7,7 +7,7 @@ import ( "slices" "strings" - i18n "forge.lthn.ai/core/go-i18n" + i18n "dappco.re/go/core/i18n" ) // Node is anything renderable. diff --git a/node_test.go b/node_test.go index 002911d..8230fbd 100644 --- a/node_test.go +++ b/node_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - i18n "forge.lthn.ai/core/go-i18n" + i18n "dappco.re/go/core/i18n" ) func TestRawNode_Render(t *testing.T) { diff --git a/pipeline.go b/pipeline.go index 0fcdcb4..c400dd3 100644 --- a/pipeline.go +++ b/pipeline.go @@ -5,7 +5,7 @@ package html import ( "strings" - "forge.lthn.ai/core/go-i18n/reversal" + "dappco.re/go/core/i18n/reversal" ) // StripTags removes HTML tags from rendered output, returning plain text. diff --git a/pipeline_test.go b/pipeline_test.go index 46ae676..c896859 100644 --- a/pipeline_test.go +++ b/pipeline_test.go @@ -5,7 +5,7 @@ package html import ( "testing" - i18n "forge.lthn.ai/core/go-i18n" + i18n "dappco.re/go/core/i18n" ) func TestStripTags_Simple(t *testing.T) { diff --git a/render_test.go b/render_test.go index 083ee1c..02ebb8e 100644 --- a/render_test.go +++ b/render_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - i18n "forge.lthn.ai/core/go-i18n" + i18n "dappco.re/go/core/i18n" ) func TestRender_FullPage(t *testing.T) {