{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "newComponentRoot": {
      "type": "string",
      "description": "The path where new components will be created, relative to the workspace root.",
      "default": "components"
    },
    "outputPath": {
      "type": "string",
      "description": "The path where the build output will be written, relative to the current workspace root.",
      "default": "dist"
    },
    "apiApplication": {
      "type": "string",
      "description": "API application ID",
      "default": "LtDdZKEPa5lK"
    },
    "apiBaseUrl": {
      "type": "string",
      "description": "API base URL",
      "default": "https://api.ayayot.com"
    },
    "apiVersion": {
      "type": "string",
      "description": "API version",
      "default": "2"
    },
    "prefix": {
      "type": "string",
      "description": "The prefix to apply to generated selectors.",
      "minLength": 1
    },
    "components": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/component"
      }
    }
  },
  "required": ["components"],
  "title": "UI Component Workspace Configuration",
  "definitions": {
    "component": {
      "type": "object",
      "properties": {
        "root": {
          "type": "string",
          "description": "The component root path, relative to the workspace root. By default, the component root path is formed by concatenating the `newComponentRoot` and component name."
        },
        "runner": {
          "type": "object",
          "properties": {
            "build": {
              "type": "object",
              "properties": {
                "builder": {
                  "type": "string",
                  "description": "The builder package name and build command."
                },
                "input": {
                  "type": "string",
                  "description": "The component input file, relative to the component root."
                },
                "assets": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "$ref": "#/definitions/asset"
                      }
                    ]
                  },
                  "description": "List of static component assets. Can be passed as glob paths relative to the component root or as objects for more fine-tuned configuration."
                }
              },
              "required": ["builder", "input"]
            },
            "deploy": {
              "type": "object",
              "properties": {
                "company": {
                  "type": "string",
                  "description": "Company ID"
                },
                "template": {
                  "type": "string",
                  "description": "PageComponentTemplate ID"
                }
              },
              "required": ["company", "template"]
            }
          },
          "required": ["build"]
        }
      },
      "required": ["runner"]
    },
    "asset": {
      "type": "object",
      "properties": {
        "glob": {
          "type": "string",
          "description": "A node-glob using input as base directory."
        },
        "input": {
          "type": "string",
          "description": "A path relative to the workspace root."
        },
        "output": {
          "type": "string",
          "description": "A path relative to the component output path (default is dist/component-name)."
        }
      },
      "required": ["glob"]
    }
  }
}
