fix: better config package to enhance test and restructuring
- use yaml for configuration instead of .env
- better config reading, caching and writing
- supports writing and reading local configs (configuration in working directory)
- supports reading and writing host-level configuration which over-rides global config but can be overridden by local configs
- preserves
glabs
's config read format (Environmental variables -> Local Config -> Global Config) - supports writing an updated config, preserving comments
- supports mostly lazy evaluation of yaml
Related Issue
Motivation and Context
This PR seeks to resolve #170 (closed) while making it easier to work on #157 (closed)
How Has This Been Tested?
This has been manually tested by building and running the binary and I have added tests to cover my changes.
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
-
My code follows the code style of this project. -
My change requires a change to the documentation. -
I have updated the documentation accordingly. -
I have read the CONTRIBUTING document. -
I have added tests to cover my changes. -
All new and existing tests passed.
TODO (Available for discussion)
-
Migrate the old .env to config.yml -
Properly format old aliases.yml