Skip to content

Reorganize project structure and rename binary#2

Merged
conallob merged 2 commits into
mainfrom
claude/flat-module-layout
May 5, 2026
Merged

Reorganize project structure and rename binary#2
conallob merged 2 commits into
mainfrom
claude/flat-module-layout

Conversation

@conallob
Copy link
Copy Markdown
Owner

@conallob conallob commented May 5, 2026

Summary

This PR reorganizes the project structure by moving internal packages to the root level and renames the binary from pattern-drill to coding-interview-pattern-drill for consistency with the module name.

Key Changes

  • Restructured package layout: Moved all packages from internal/ directory to root level:

    • internal/cachecache
    • internal/configconfig
    • internal/leetcodeleetcode
    • internal/patternspatterns
    • internal/quizquiz
  • Created new entry point: Added cmd/coding-interview-pattern-drill/main.go that:

    • Routes to server.Run() when invoked with serve argument
    • Routes to cli.Run() for default CLI behavior
  • Moved CLI and server packages: Relocated cli/ and server/ packages to root level alongside other packages

  • Updated all import paths: Changed all internal imports across the codebase to reference packages at root level instead of internal/ subdirectory

  • Updated build configuration: Modified .goreleaser.yaml to reflect new binary name and build paths:

    • Project name: pattern-drillcoding-interview-pattern-drill
    • Build ID and binary name updated accordingly
    • Homebrew formula name and test/install commands updated

Implementation Details

The reorganization simplifies the package structure by removing the internal/ directory convention, making packages more accessible and reducing import path complexity. The new main entry point provides a unified CLI interface that can switch between interactive CLI mode and server mode based on command-line arguments.

https://claude.ai/code/session_01CSqri29pumwCCTp4ApU2da

claude added 2 commits May 5, 2026 16:52
Removes internal/ from all package paths — internal/ only restricts
imports from outside the module, which is irrelevant for a CLI binary
with no external consumers.

Package renames (import path changes only, no logic changes):
  internal/cache    → cache
  internal/cli      → cli
  internal/config   → config
  internal/leetcode → leetcode
  internal/patterns → patterns
  internal/quiz     → quiz
  internal/server   → server

Entry point: cmd/pattern-drill → cmd/coding-interview-pattern-drill

goreleaser: project_name, binary, brew formula all renamed to
coding-interview-pattern-drill.

https://claude.ai/code/session_01CSqri29pumwCCTp4ApU2da
Replaces all remaining github.com/conallob/coding-interview-pop-quiz/internal/<pkg>
references with github.com/conallob/coding-interview-pop-quiz/<pkg> after the
directory restructure in the previous commit.

https://claude.ai/code/session_01CSqri29pumwCCTp4ApU2da
@conallob conallob merged commit 5698269 into main May 5, 2026
@conallob conallob deleted the claude/flat-module-layout branch May 5, 2026 16:55
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