Skip to content

Commit 40f6d60

Browse files
aksOpsclaude
andcommitted
feat(module): use full module path for go install + version fallback
Rename the module from the bare `aiusage` to its canonical repository path `github.com/RandomCodeSpace/aiusage` so the tool is installable directly: go install github.com/RandomCodeSpace/aiusage@latest A bare module name cannot be resolved by `go install pkg@version` — the go.mod module path must match the repo URL. All internal imports are updated to the new path, and the GoReleaser ldflags `-X` target is updated to match. Also add a runtime/debug.ReadBuildInfo() fallback in buildinfo.Identity(): when no -X version is linked in (the `go install module@vX.Y.Z` case), the module version embedded by the toolchain is reported instead of a dev stamp, so installed binaries show the real version without ldflags. Working-tree builds still report "(devel)" and fall through to the per-build dev stamp, preserving daemon auto-restart behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9510bb5 commit 40f6d60

68 files changed

Lines changed: 139 additions & 127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ builds:
3131
flags:
3232
- -trimpath
3333
ldflags:
34-
- -s -w -X aiusage/internal/buildinfo.Version={{ .Version }}
34+
- -s -w -X github.com/RandomCodeSpace/aiusage/internal/buildinfo.Version={{ .Version }}
3535

3636
archives:
3737
- id: default

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module aiusage
1+
module github.com/RandomCodeSpace/aiusage
22

33
go 1.25.10
44

internal/adapter/adapter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package adapter
1010
import (
1111
"context"
1212

13-
"aiusage/internal/model"
13+
"github.com/RandomCodeSpace/aiusage/internal/model"
1414
)
1515

1616
// Source is a concrete usage source discovered by an adapter — typically a

internal/adapter/agy/agy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import (
3232
"strings"
3333
"time"
3434

35-
"aiusage/internal/adapter"
36-
"aiusage/internal/model"
35+
"github.com/RandomCodeSpace/aiusage/internal/adapter"
36+
"github.com/RandomCodeSpace/aiusage/internal/model"
3737
)
3838

3939
const (

internal/adapter/agy/agy_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"path/filepath"
77
"testing"
88

9-
"aiusage/internal/adapter"
10-
"aiusage/internal/model"
9+
"github.com/RandomCodeSpace/aiusage/internal/adapter"
10+
"github.com/RandomCodeSpace/aiusage/internal/model"
1111
)
1212

1313
func writeFile(t *testing.T, dir, name, content string) string {

internal/adapter/claudecode/claudecode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"strings"
2020
"time"
2121

22-
"aiusage/internal/adapter"
23-
"aiusage/internal/model"
22+
"github.com/RandomCodeSpace/aiusage/internal/adapter"
23+
"github.com/RandomCodeSpace/aiusage/internal/model"
2424
)
2525

2626
// usageMarker fast-skips lines that cannot carry usage data.

internal/adapter/claudecode/claudecode_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"strings"
88
"testing"
99

10-
"aiusage/internal/adapter"
11-
"aiusage/internal/model"
10+
"github.com/RandomCodeSpace/aiusage/internal/adapter"
11+
"github.com/RandomCodeSpace/aiusage/internal/model"
1212
)
1313

1414
// writeFixture creates <root>/projects/<seg>/<session>.jsonl with the given lines.

internal/adapter/claudecode/dedup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package claudecode
22

3-
import "aiusage/internal/model"
3+
import "github.com/RandomCodeSpace/aiusage/internal/model"
44

55
// deduper implements ccusage-equivalent in-cycle deduplication for Claude Code
66
// transcript lines.

internal/adapter/codex/codex.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"strings"
2222
"time"
2323

24-
"aiusage/internal/adapter"
25-
"aiusage/internal/model"
24+
"github.com/RandomCodeSpace/aiusage/internal/adapter"
25+
"github.com/RandomCodeSpace/aiusage/internal/model"
2626
)
2727

2828
const (

internal/adapter/codex/codex_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"path/filepath"
77
"testing"
88

9-
"aiusage/internal/adapter"
10-
"aiusage/internal/model"
9+
"github.com/RandomCodeSpace/aiusage/internal/adapter"
10+
"github.com/RandomCodeSpace/aiusage/internal/model"
1111
)
1212

1313
// codexHome returns the default codex home (<home>/.codex) for a user home dir,

0 commit comments

Comments
 (0)