launchcodedev / app-config

Easy Configuration Loader with Strict Validation
https://app-config.dev
Mozilla Public License 2.0
69 stars 11 forks source link

allow loading all config from `.app-config.secrets.*` without `.app-config.*` #154

Open DetachHead opened 3 years ago

DetachHead commented 3 years ago

Currently it throws an error when .app-config.yml isn't found, even if a .app-config.secrets.yml file exists with all of the required properties

joelgallant commented 3 years ago

Interesting, that makes enough sense. FWIW if you need a workaround, you can of course just touch .app-config.yml.

In terms of implementing this suggestion, I think we'll need to catch a NotFoundError on the main config file source, try to validate only secrets, and in case of error, just throw up the NotFoundError again.

It's a bit tricky though, because you might be intending to just use app-config secrets, and happen to have a validation error. Maybe a warning log with the validation error is enough.