Skip to main content

@versionzero/configurator / configuration-sources / DefaultSequence

Enumeration: DefaultSequence

Defined in: configuration-sources/configuration-source.js:54

Standard sequence numbers for configuration sources. Lower numbers are processed first (lower priority), higher numbers are processed last (higher priority). When multiple sources assign the same property, the highest sequence number wins.

Rationale for the order of values in the default sequence:

  • Settings that can't be changed at runtime are at the lowest levels.
  • Settings that could dynamically change are at higher levels to support hot reloading.
  • Configuration files are a good way to bulk-set a bunch of things at once, so other sources should be able to swap the config file choice, and thus need to be a lower priority.

Use these constants when creating custom sources to ensure proper priority ordering:

Examples

new MySecretsSource({ sequence: ConfigurationSource.DefaultSequence.SECRETS })

To insert between standard slots, use intermediate values:
new MyCustomSource({ sequence: 450 }) // Between ENVIRONMENT(400) and SECRETS(500)

@readonly
@enum {number}

Enumeration Members

SYSTEM_DEFAULTS

SYSTEM_DEFAULTS: 100

Defined in: configuration-sources/configuration-source.js:55


MODULES

MODULES: 200

Defined in: configuration-sources/configuration-source.js:56


APP_DEFAULTS

APP_DEFAULTS: 300

Defined in: configuration-sources/configuration-source.js:57


ENVIRONMENT

ENVIRONMENT: 400

Defined in: configuration-sources/configuration-source.js:58


SECRETS

SECRETS: 500

Defined in: configuration-sources/configuration-source.js:59


ARGUMENTS

ARGUMENTS: 600

Defined in: configuration-sources/configuration-source.js:60


SERVER

SERVER: 700

Defined in: configuration-sources/configuration-source.js:61


INTERACTIVE

INTERACTIVE: 800

Defined in: configuration-sources/configuration-source.js:62


CONFIGURATION

CONFIGURATION: 900

Defined in: configuration-sources/configuration-source.js:63


OVERRIDES

OVERRIDES: 1000

Defined in: configuration-sources/configuration-source.js:64