Skip to content

Conversation

@adnaan
Copy link
Contributor

@adnaan adnaan commented Dec 24, 2025

Summary

  • Consolidates all examples into a single Go module (github.com/livetemplate/examples)
  • Updates livetemplate to v0.7.5
  • Adds scripts/update-livetemplate.sh for automated version updates

Changes

  • Created single go.mod at repo root
  • Removed 11 individual go.mod/go.sum files from example subdirectories
  • Updated todos example imports to use new module path (github.com/livetemplate/examples/todos/db)
  • Updated test-all.sh to work with single module structure
  • Added scripts/update-livetemplate.sh script that:
    • Checks latest version from GitHub releases
    • Updates go.mod if newer version available
    • Creates a PR automatically

Benefits

  • Single place to update livetemplate version - no more updating 11 go.mod files
  • Simpler dependency management - one go mod tidy for everything
  • Reduced maintenance overhead - fewer files to track

Usage

# Run an example
go run ./counter
go run ./todos
go run ./chat

# Build all
go build ./...

# Test all
./test-all.sh

# Update livetemplate version (creates PR if newer version available)
./scripts/update-livetemplate.sh
./scripts/update-livetemplate.sh --dry-run  # preview only

Test plan

  • All examples build successfully (go build ./...)
  • All tests pass (./test-all.sh --skip-disabled)
  • Update script works (./scripts/update-livetemplate.sh --dry-run)

🤖 Generated with Claude Code

- Create single go.mod at repo root (github.com/livetemplate/examples)
- Update livetemplate to v0.7.5
- Remove 11 individual go.mod/go.sum files from example subdirectories
- Update todos example imports to use new module path
- Update test-all.sh to work with single module structure
- Add scripts/update-livetemplate.sh for automated version updates

Benefits:
- Single place to update livetemplate version
- Simpler dependency management
- Reduced maintenance overhead

Running examples: `go run ./counter`, `go run ./todos`, etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 24, 2025 18:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates multiple Go modules into a single monorepo structure for simplified dependency management. The changes unify 11+ individual example directories (each with their own go.mod) into a single module at the repository root with module path github.com/livetemplate/examples.

Key changes:

  • Single go.mod at repository root replaces 11+ individual module files
  • Updates livetemplate dependency from v0.7.4 to v0.7.5
  • Adds new livetemplate/components dependency
  • Adds automation script for future version updates

Reviewed changes

Copilot reviewed 16 out of 27 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go.mod New root module definition with consolidated dependencies, updated to livetemplate v0.7.5
go.sum Consolidated dependency checksums with updated livetemplate v0.7.5 and components
todos/state.go Updated import path from relative to absolute module path
todos/db_manager.go Updated import path from relative to absolute module path
todos/controller.go Updated import path from relative to absolute module path
test-all.sh Modified to work with single module structure, added GOWORK=off
scripts/update-livetemplate.sh New automation script for updating livetemplate dependency
*/go.mod (removed) Individual module files removed from example directories
*/go.sum (removed) Individual dependency checksums removed from example directories

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Tests use relative paths like 'go run main.go' which require the working
directory to be the example directory, not the repo root.
@adnaan adnaan merged commit 2ac05f6 into main Dec 24, 2025
9 checks passed
@adnaan adnaan deleted the refactor/single-go-module branch December 24, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants