Skip to content

refactor(module): move Go module root to repo root with pkg/ subpackages - #1258

Merged
houko merged 3 commits into
mainfrom
refactor/root-module-pkg-layout
Nov 27, 2026
Merged

houko merged 3 commits into
mainfrom
refactor/root-module-pkg-layout

Conversation

@houko

@houko houko commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves the Go module entry (go.mod, go.sum, root package game, cmd/, and internal/) from packages/game/ to the repository root, while organizing all 83 library subpackages under pkg/ (github.com/nsgo-dev/game/pkg/<name>) instead of flattening them into the root directory.

  • Clean module & release tags: go get github.com/nsgo-dev/game@v0.1.0 and clean root release tags v0.1.0 instead of packages/game/v0.1.0.
  • Clean repository root: root holds only the entry package game, cmd/, internal/, and top-level repo folders; all library packages live under pkg/.
  • Imports, workspace, tooling, docs, website, and CI updated across the repository, including bilingual docs (docs/en & docs/zh), API reference generation (cmd/gameapi), JSON schema generation (cmd/gameschema), skills/nsgo-game, changelog.d/root-module-pkg-layout.md, and .agents/notes/implemented/architecture/2026-11-27-root-module-pkg-layout.md.
  • Website Bun tests renamed *.test.ts → *.spec.ts: prevents go tool nsgo test . at the root from picking up Bun tests as NSGo TSX tests while keeping bun test discovering all 24 tests.
  • Temporary template CI replacement: .github/workflows/test.yml's templates job temporarily pins github.com/nsgo-dev/game to $GITHUB_WORKSPACE under GOWORK=off until v0.1.0 is tagged at the root after this PR merges; a follow-up PR will pin all 16 template/**/go.mod.tmpl files to v0.1.0 and remove the temporary replacement.

Verification

  • go tool nsgo test . (5,837/5,838 passed in full run; TestZshCompletion passed standalone in 23.2s)
  • go tool nsgo check -target macos,windows,linux,android,web,ios,ios_simulator
  • go run ./cmd/gameschema -check
  • go run ./cmd/game check examples
  • go tool nsgo test . in tools/agenteval, tools/changelog, and all 7 examples (caverun, lantern3d, cryptquest, slidegem, starburst, tutorial, fieldmedic)
  • apps/website: bun run test (24/24), bun run build (130 packages, 325,280 API anchors on 1,300 pages, Pagefind), bun run typecheck
  • go run ./tools/changelog check, bun run verify-notes, actionlint, gofmt -l ., git diff --check

Comment thread pkg/leaderboard/selfhost/index.go Fixed
@houko
houko merged commit b4e1ab5 into main Nov 27, 2026
53 checks passed
@houko
houko deleted the refactor/root-module-pkg-layout branch November 27, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment