Unifig aims to provides simple and abstract way of handling app's configuration. It allows to load configuration data from multiple sources without changing defined config template. Many templates can be defined to further organize the code eg. MainConfiguration and ModuleConfiguration.
Adapted configuration data is transformed into templates and validated via class-transformer and class-validator. Once initialized configurations can be reloaded without app restart.
- Core - project implementation for vanilla typescript
- Nest - nestjs integration
- Adapter: env - adapter for environment variables and .env files
- Validation presenter: table - transforms configuration validation errors into table format
- Validation presenter: JSON - transforms configuration validation errors into JSON string
Project uses yarn workspaces in combination with lerna. To initialize the project run
yarn
As project uses typescript for the package to be seen as other packages dependency they need to be built first.
yarn build
yarn lint:staged # linting staged files
yarn test # running unit tests for packages changed since HEAD
yarn test:cov # running unit tests for whole repo with coverage report
yarn test:e2e # running e2e tests for packages changed since HEAD with packages dependent on them
yarn test:all # combining test and test:e2e
The project follows Conventional Commits standard. To conveniently create commit message use commitizen by typing
yarn cz
Mateusz Fonfara
See also the full list of contributors.
This project is licensed under the MIT License - see the LICENSE file for details.