{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Schema for .mopedrc",
    "definitions": {
        "appConfigDefinition": {
            "type": "object",
            "properties": {
                "dbMigrations": {
                    "description": "Relative path to a folder to use for database migrations",
                    "type": "string"
                },
                "clientEntryPoint": {
                    "description": "Relative path to the entry point for the client.",
                    "type": "string"
                },
                "dbOverrides": {
                    "description": "Relative path to a file containing types to override database columns.",
                    "type": "string"
                },
                "dbSchema": {
                    "description": "Relative path to a folder to output a typed database schema to",
                    "type": "string"
                },
                "dbURL": {
                    "description": "The DATABASE_URL for use in development e.g. postgres://app-name@localhost/app-name",
                    "type": "string"
                },
                "disableClient": {
                    "default": false,
                    "description": "Disable all client side compilation. If you do this you **must** render everything server side.",
                    "type": "boolean"
                },
                "htmlTemplate": {
                    "description": "Relative path to an html file to use as a template.",
                    "type": "string"
                },
                "monorepo": {
                    "description": "Mark this repository as having a single app.",
                    "const": false
                },
                "port": {
                    "description": "Default port to run the app on in development (N.B. backend will default to port + 1)",
                    "type": "integer"
                },
                "publicDirectory": {
                    "description": "Relative path to a public directory, from which all files will be made publicly available.",
                    "type": "string"
                },
                "serverEntryPointDev": {
                    "description": "Relative path to the entry point for the server in development.",
                    "type": "string"
                },
                "serverEntryPointProd": {
                    "description": "Relative path to the entry point for the server in production.",
                    "type": "string"
                },
                "serverEntryPoint": {
                    "description": "Relative path to the entry point for the server (can be overridden with serverEntryPointDev and serverEntryPointProd).",
                    "type": "string"
                }
            },
            "additionalProperties": false
        },
        "monoRepoDefinition": {
            "type": "object",
            "properties": {
                "monorepo": {
                    "description": "Mark this repository as having multiple apps with different entry points.",
                    "const": true
                }
            },
            "patternProperties": {
                "^[a-z0-9\\-]+$": {
                    "description": "The options to apply for this named app.",
                    "oneOf": [
                        {
                            "$ref": "#/definitions/appConfigDefinition"
                        },
                        {
                            "const": true
                        }
                    ]
                }
            },
            "minProperties": 2,
            "additionalProperties": false
        }
    },
    "type": "object",
    "anyOf": [
        {
            "$ref": "#/definitions/appConfigDefinition"
        },
        {
            "$ref": "#/definitions/monoRepoDefinition"
        }
    ]
}