{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "number",
      "const": 1
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z]+(?:-[a-z]+)*$"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "description": {
      "type": "string",
      "minLength": 1
    },
    "source": {
      "type": "string",
      "format": "uri"
    },
    "tags": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "license": {
      "type": "string",
      "const": "MIT"
    },
    "testedCompatibility": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "starter": {
            "type": "string"
          },
          "astro": {
            "type": "string"
          },
          "node": {
            "type": "string"
          }
        },
        "required": [
          "starter",
          "astro",
          "node"
        ],
        "additionalProperties": false
      }
    },
    "entryPoints": {
      "type": "object",
      "properties": {
        "tokens": {
          "type": "string",
          "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
        },
        "example": {
          "type": "string",
          "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
        },
        "layout": {
          "type": "string",
          "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
        },
        "guidance": {
          "type": "string",
          "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
        }
      },
      "required": [
        "tokens",
        "example",
        "layout",
        "guidance"
      ],
      "additionalProperties": false
    },
    "requiredTokens": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^--[a-z0-9-]+$"
      }
    },
    "extensions": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^--[a-z0-9-]+$"
      }
    },
    "fonts": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "family": {
            "type": "string"
          },
          "file": {
            "type": "string",
            "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
          },
          "licenseFile": {
            "type": "string",
            "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
          },
          "weight": {
            "type": "string"
          },
          "subset": {
            "type": "string",
            "const": "latin"
          }
        },
        "required": [
          "family",
          "file",
          "licenseFile",
          "weight",
          "subset"
        ],
        "additionalProperties": false
      }
    },
    "dependencies": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "reason"
        ],
        "additionalProperties": false
      }
    },
    "patterns": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "file": {
            "type": "string",
            "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
          }
        },
        "required": [
          "name",
          "file"
        ],
        "additionalProperties": false
      }
    },
    "previews": {
      "type": "object",
      "properties": {
        "desktop": {
          "type": "string",
          "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
        },
        "mobile": {
          "type": "string",
          "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[a-zA-Z0-9_./-]+$"
        }
      },
      "required": [
        "desktop",
        "mobile"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schemaVersion",
    "id",
    "name",
    "version",
    "description",
    "source",
    "tags",
    "license",
    "testedCompatibility",
    "entryPoints",
    "requiredTokens",
    "extensions",
    "fonts",
    "dependencies",
    "patterns",
    "previews"
  ],
  "additionalProperties": false
}
