Skip to content

Development

Building

bash
go build -o mctui main.go

Running

bash
go run main.go

Project Layout

The codebase follows Go standard layout conventions using an internal/ directory to encapsulate domain logic.

text
/
├── main.go               # UI Entrypoint (Bubble Tea)
└── internal/
    ├── config/           # Persistence & Paths
    ├── fabric/           # Modloader API
    ├── java/             # JRE Discovery
    ├── launcher/         # Execution Engine
    ├── mojang/           # Vanilla API & Downloads
    ├── nbt/              # Binary Parser
    ├── roadmap/          # GitHub Integration
    ├── ui/               # TUI State Machine & Views
    └── worlds/           # Saves Metadata

Contributing

  1. Adhere to the Single Responsibility Principle (SRP).
  2. Do not introduce CGO or external dependencies unless strictly necessary.
  3. Keep the UI layer separate from domain logic.

Coding Standards

  • UI State Machine: UI changes must occur through the Bubble Tea Update function altering the current state.
  • Input Validation: Network-sensitive inputs (like LAN names) must be strictly validated before storage.
  • ANSI Styling: Use lipgloss exclusively. Avoid raw ANSI escapes. Clean concatenations to prevent color bleed.
  • Concurrency: Always use buffered channels acting as semaphores for network calls to avoid file descriptor exhaustion.

Release Process

  1. Update Roadmap: Ensure roadmap.json and the embedded fallback in internal/roadmap/roadmap.go are up to date.
  2. Cross-compile Binaries: Compile utilizing size optimization flags:
    • Linux: go build -ldflags="-s -w" -o mctui-linux-amd64 main.go
    • Windows: GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o mctui-windows-amd64.exe main.go
  3. Publish: Tag the release, publish the notes on GitHub, and attach both generated binaries.