Skip to content

Read submodule defaults from their own config directory (PR welcome) #225

@lorenwest

Description

@lorenwest

Proposal to add 1-arg behavior to config.setModuleDefaults(moduleName, defaults). If the 2nd argument isn't specified, it loads defaults from the /config directory within the module specified by moduleName.

This serves many purposes:

* It moves submodule configurations out of code
* It puts submodule configuration into a well known place
* It provides a common place to put configuration documentation
* It allows running the submodule as an app, with overrides for tests, etc.
* It prevents namespace clash by utilizing the submodule package name
* It doesn't break backwards compatibility
* The 2-arg mechanism can be deprecated, with ample warning

When this change is made, change the wiki page to document only this behavior. Make a note about the features the 2-arg behavior doesn't have, and that it will be going away in the future (at least 1 year).

Establish a convention for submodules that they be configured by passing overrides to the module constructor, or by overrides in the app /config directory. This allows the submodule to be used by apps that also use node-config as well as apps that use other configuration systems.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions