Skip to content

Simplify management of documentation of default configuration #307

Open
@pmeijer

Description

@pmeijer

The ./config/config.default.js should contain the documentation as well as the default values.

Suggestion is to augment the json structure with metadata such as doc, type, category, value etc. When requiring the file as a config - the structure should be transformed back into the regular config format.

Depending on the category the config variables would be listed from "default", "advanced", "cli".

Example of how the format could look like:

    config = {
        addOn: {
            doc: "AddOn are stateful server workers listening in on changes made to a branch",
            type: "container",
            category: "default",
            enable: {
                doc: "If true enables add-ons",
                value: false
            },
            monitorTimeout: {
                category: "advanced",
                doc: "In milliseconds, the waiting time before add-ons are stopped after no activity (new clients joined or hash updates) in the branch.",
                displayValue: '2 * 60 * 1000',
                value: 2 * 60 * 1000,
            },
            workerUrl: {
                category: "advanced",
                doc: "If given the webgme server will not spawn a child process for running add-ons and instead post the related events to the url. Use addon_handler.js for a machine handling such requests.",
                value: null
            },
            basePaths: {
                category: "cli",
                doc: "Array of paths to custom add-ons. If you have an add-on at `C:/SomeAddOns/MyAddOn/MyAddOn.js` the path to append would be `C:/SomeAddOns` or a relative path (from the current working directory). N.B. this will also expose any other add-on in that directory, e.g. `C:/SomeAddOns/MyOtherAddOn/MyOtherAddOn.js`.",
                type: "array",
                displayValue: "[path.join(__dirname, '../src/addon/core')]",
                value: [path.join(__dirname, '../src/addon/core')]
            }
        },
...

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