Skip to content

v1.2.0 - Refactored Architecture with Library Support

Latest

Choose a tag to compare

@Moderrek Moderrek released this 24 May 16:49
· 2 commits to main since this release

v1.2.0 - Refactored Architecture with Library Support

Overview

This release marks a significant milestone with a complete project restructuring that transforms lines into both a powerful CLI tool and a reusable Go library. Major improvements include configurable buffer management, JSON output support, and automated multi-platform builds.

Major Changes

Refactored Project Structure

  • Separated CLI logic from core functionality into cmd/lines and pkg/lines directories
  • The core line counting engine is now available as a public library at github.com/moderrek/lines/pkg/lines
  • Improved code organization for better maintainability and reusability

New Features

  • JSON output support: Use --json flag to output results in machine-readable format
  • Configurable buffer sizes: Users can now customize scanner buffer initial and maximum sizes through the Config struct
  • Library API: Go developers can now import and use lines as a dependency in their projects

CI/CD & Release Automation

  • Enhanced GitHub Actions workflow with code quality checks
  • Added go fmt, go vet, and go mod tidy verification
  • Automated cross-platform binary builds for Linux, macOS, and Windows
  • Automatic release creation with compiled binaries

Documentation

  • Completely rewritten README with clear installation and usage instructions
  • Added library usage examples for Go developers
  • GitHub sponsorship configuration

Installation

go install github.com/Moderrek/lines/cmd/lines@v1.2.0

Usage Examples

Analyze current directory:

lines

Display top 5 file extensions by line count:

lines --dir ~/projects/my-app --top 5

Get results in JSON format for scripting:

lines --dir ~/projects/my-app --json

Use as a library in your Go project:

import "github.com/moderrek/lines/pkg/lines"

config := lines.Config{
  IncludeHidden: false,
  BufferInitialSize: 64 * 1024,
  BufferMaxSize: 1024 * 1024,
}
counter := lines.NewCounter(config)
result, err := counter.Run("./src")