Skip to content

v1.1.0

Choose a tag to compare

@drysius drysius released this 21 Dec 12:49
· 40 commits to main since this release

Added

  • Driver Isolation: Implemented KfgDriver.clone(). Now, each instance of Kfg clones its driver in the constructor, ensuring that the data cache (this.driver.data) is independent and does not suffer unwanted overwrites between different configurations.

  • Data Injection: Added the inject(data) method in Kfg and KfgDriver. Allows injecting and merging raw data directly into the configuration object, bypassing the standard column flow.

  • Lifecycle Management:

  • Kfg.reload(options?): New method to reload configurations from disk/environment, preserving or updating options from the last load.

  • Kfg.schematic(path): Semantic shortcut for conf(), returning the schema definition for a specific path.

  • KfgFS Improvements:

  • KfgFS.create(id, data?): Method to physically create new configuration files, allowing initial data to be passed.

  • KfgFS.exist(id): Method to check the existence of a configuration file by ID.

  • Regression Tests: Added new test suites to cover the functionalities of inject, clone, reload, and file management in KfgFS.

Fixed

  • Resolution of Recursive Defaults: Complete refactoring of buildDefaultObject in src/utils/schema.ts. Now the system uses the TypeBox pipeline (Value.Default) to generate default objects, correctly resolving the priority between defaults of parent and child nodes (Deep Merging of defaults).

  • Partial Data Validation: Fixed a bug in KfgDriver.validate() where validation failed when receiving partial driver objects. Now, the schema's default values ​​are applied before the TypeBox requirement check.

Refactoring

  • Complete internal conversion of SchemaDefinition to native TypeBox schemas during default value generation processes, ensuring technical consistency throughout the project.

Full Changelog: v1.0.0...v1.1.0