{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "miyagi.performance.json",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "compression": {
      "type": "string",
      "enum": ["raw", "gzip", "brotli"],
      "default": "gzip"
    },
    "warnRatio": {
      "type": "number",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 1,
      "default": 0.8
    },
    "components": {
      "type": "object",
      "minProperties": 0,
      "propertyNames": { "minLength": 1 },
      "default": {},
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "css": { "$ref": "#/definitions/assetEntry" },
          "js": { "$ref": "#/definitions/assetEntry" }
        }
      }
    },
    "pages": {
      "default": {},
      "type": "object",
      "propertyNames": { "minLength": 1 },
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "required": ["variations"],
        "properties": {
          "variations": {
            "type": "object",
            "propertyNames": { "minLength": 1 },
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "required": ["components"],
              "properties": {
                "components": {
                  "type": "array",
                  "items": { "type": "string", "minLength": 1 }
                },
                "budget": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "css": { "type": "string" },
                    "js": { "type": "string" },
                    "html": { "type": "string" },
                    "total": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "assetEntry": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "budget": { "type": "string" }
      }
    }
  }
}
