@localey/core
v0.1.26
Published
The central orchestration logic for the Localey ecosystem.
Readme
@localey/core
The central orchestration logic for the Localey ecosystem.
The @localey/core package contains the fundamental abstractions and services required to run Localey's automated localization workflows. It is designed to be framework-agnostic and highly extensible.
Architecture and Services
Configuration Management
The ConfigLoader service is responsible for discovering, parsing, and validating project-specific configurations. It provides a unified configuration object used by the CLI and all registered adapters.
Plugin Architecture
Localey utilizes a registry-based plugin system managed by the PluginRegistry. This allows framework-specific functionality to be decoupled from the core engine. Each adapter registers its supported file extensions and scanning capabilities with this central registry.
Adapter Abstraction
The FrameworkAdapter is an abstract base class that defines the contract for framework-specific implementations. Any developer wishing to extend Localey to support a new framework (e.g., Vue or Angular) should implement this interface.
Core API Reference
ConfigLoader.load(cwd: string): Retrieves the effective configuration for a given working directory.PluginRegistry.register(adapter: FrameworkAdapter): Adds a new adapter to the system.LocaleyConfig: TypeScript interface defining the structure of the configuration file.ScanResult: Standardized data structure for representing a discovered hardcoded string, including its location and context.
Implementation Details
The core package ensures that file system operations are handled consistently across different platforms. It also provides the logical foundation for the check command, implementing deep-object flattening and key comparison algorithms used for translation validation.
