Currently we just hope that the developer provided a valid configuration object, without checking it. We should add a runtime check for this, and throw a nice error. As is, providing the configuration to the CLI is prone to typos and difficult-to-debug missing behaviors, given that there's no autocomplete in IDEs for the webdoc.conf.json file.
Both of these issues can be solved by providing and exposing a JSON schema -- IDEs could use it to autocomplete and show hints to the developer, and we could use it internally to validate the object against it. It's also a universal documentation language which serves as the source of truth for what the configuration should and shouldn't contain.
Currently we just hope that the developer provided a valid configuration object, without checking it. We should add a runtime check for this, and throw a nice error. As is, providing the configuration to the CLI is prone to typos and difficult-to-debug missing behaviors, given that there's no autocomplete in IDEs for the
webdoc.conf.json
file.Both of these issues can be solved by providing and exposing a JSON schema -- IDEs could use it to autocomplete and show hints to the developer, and we could use it internally to validate the object against it. It's also a universal documentation language which serves as the source of truth for what the configuration should and shouldn't contain.