Skip to content

Make resolution priority configurable #27

@rstagi

Description

@rstagi

Right now the resolution priority is Override > Env > Secret File > Config File > Initial Values > Default

We should let users chose a different order by programmatically expose a stepped resolution, by splitting each resolution:

const configSchema = schema({ ...someSchema });

const config = configSchema
  .loadValues({ ...initialValues })
  .loadEnv()
  .loadConfig({ configPath })
  .override({ ...overrideValues })
  .loadSecrets()
  .validate();
// in this case secrets > override > configFile > env > initialValues > default

Also we should let this order to be configured in the bootstrap with something like:

const service = bootstrap(configSchema, {
  resolve: (configSchema) => {
    // ...custom resolution...
  },
  ...otherOptions,
},
(config) => {
  // ...factory function...
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions