| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Config.Resolve
Description
Hierarchical configuration resolution (Viper-style). Unifies defaults, configuration files, and environment variables into a single resolution tree with strict precedence: Defaults < File < Env.
Documentation
deepMerge :: Value -> Value -> Value Source #
Right-biased deep merge of two Aeson Values. Objects are merged recursively. Other types (Arrays, Strings, etc.) are overwritten by the right side (the higher precedence value).
buildEnvAst :: [(String, String)] -> Value Source #
Convert a list of environment variables into a nested JSON Object.
Filters for keys starting with ECLUSE_ and strips the prefix.
Double underscores (__) represent nested object paths.
Single underscores (_) are converted to camelCase for Aeson key matching.
For example, ECLUSE_MOUNTSNPMPRIVATE_UPSTREAM becomes
{"mounts": {"npm": {"privateUpstream": ...}}}.
Values that parse as valid JSON (like numbers or booleans) are decoded;
otherwise they remain as Strings.