Skip to content

006 stabilize base - #25

Merged
dgtalbug merged 9 commits into
developfrom
006-stabilize-base
Dec 25, 2025
Merged

006 stabilize base#25
dgtalbug merged 9 commits into
developfrom
006-stabilize-base

Conversation

@dgtalbug

Copy link
Copy Markdown
Contributor

This pull request introduces a new application context system to enable dependency injection across the Arc CLI, improves testability, and enhances documentation for custom themes. The main changes include the creation of a centralized Context struct to hold dependencies, refactoring the CLI entrypoint to use this context, and adding comprehensive documentation and examples for custom themes. Additional improvements were made to the Makefile for more robust test and race detection workflows.

Dependency Injection & Application Context:

  • Introduced a new Context struct in internal/app/context.go to centralize all application-wide dependencies, enabling dependency injection and eliminating global state. This includes logger, configuration, store, preferences, UI, and base directory.
  • Added a factory (NewDefaultContextWithConfig) in internal/app/factory.go to construct the context with all dependencies, handling configuration loading, logger setup, store and repository initialization, preferences, and theme loading. Also includes a deprecated NewDefaultContext for backward compatibility.
  • Provided thorough unit tests for context creation and its options in internal/app/context_test.go, ensuring correct initialization and configuration handling.
  • Refactored the CLI entrypoint (cmd/arc/main.go) to load configuration, create an application context, and pass it to the CLI, improving startup error handling and enabling dependency injection for commands.

Testing & Build Improvements:

  • Updated the Makefile to run core package and CLI tests separately, addressing known race conditions in the CLI due to the Cobra library. Added a new test-race target to run the race detector only on safe packages, and improved output clarity for test commands. [1] [2]

Documentation & Theming:

  • Added a comprehensive guide for creating custom themes in docs/CUSTOM_THEMES.md, detailing file structure, color formats, accessibility, troubleshooting, and sharing themes.
  • Provided a sample custom theme YAML file in docs/custom-theme-example.yaml for users to use as a template.

Dependency Management:

  • Updated go.mod to move the github.com/charmbracelet/harmonica dependency from direct to indirect, reflecting its usage in the project. [1] [2]

…tiple sources

Signed-off-by: dgtalbug <dgtalbug@gmail.com>
…ctions

Signed-off-by: dgtalbug <dgtalbug@gmail.com>
…monica dependency

Signed-off-by: dgtalbug <dgtalbug@gmail.com>
…alidation

Signed-off-by: dgtalbug <dgtalbug@gmail.com>
…re metrics

Signed-off-by: dgtalbug <dgtalbug@gmail.com>
…e against multiple profiles

Signed-off-by: dgtalbug <dgtalbug@gmail.com>
@github-actions github-actions Bot added dependencies documentation Improvements or additions to documentation labels Dec 25, 2025
@dgtalbug
dgtalbug merged commit 894a915 into develop Dec 25, 2025
1 check passed
@dgtalbug
dgtalbug deleted the 006-stabilize-base branch December 29, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant