I don't like shuffling configuration files around. Often chunks of config are related to a specific entity in a specific environment (like the "production redis service" or some such). ConfigKit resolves a series of URI-like references until a concrete value it located, making it easy to provide sensible defaults for local development while also pointing to environmentally-appropriate configuration in an operationally-appropriate repository (GCP Secret Manager or the like).
// In server.ts for example:
//
const configKit = new ConfigKit();
const serviceAccount = await configKit.fetch(process.env.SA_EMAIL || '$ref=file:./config/identity.json#/email');
const redisConfig = await configKit.fetch(process.env.REDIS_CONF || '$ref=file:./config/redis.toml');
SA_EMAIL: $ref=gcp:metadata::service-accounts/default/email
REDIS_CONF: $ref=gcp:secret::redis
// serviceAccount
is resolved from instance metadata, while redisConfig
is resolved from Secret Manager (assuming
// the proper permissions have been granted to that secret payload.