{
  "$id": "https://stanza.tools/schema.json",
  "title": "Stanza manifest",
  "description": "Schema for stanza.json — a Stanza monorepo manifest.",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "version": {
      "type": "string",
      "enum": [
        "0.3",
        "0.4"
      ]
    },
    "projectShape": {
      "type": "string",
      "const": "monorepo"
    },
    "packageManager": {
      "type": "string",
      "enum": [
        "pnpm",
        "bun",
        "npm"
      ]
    },
    "name": {
      "type": "string"
    },
    "apps": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "dir": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "web",
              "native"
            ]
          }
        },
        "required": [
          "id",
          "dir",
          "kind"
        ],
        "additionalProperties": false
      }
    },
    "modules": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "enum": [
          "framework",
          "ui",
          "api",
          "db",
          "orm",
          "auth",
          "payments",
          "email",
          "ai",
          "tooling",
          "testing",
          "deploy",
          "monorepo"
        ]
      },
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "version": {
              "type": "string"
            },
            "adapter": {
              "type": "string"
            },
            "apps": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "namespace": {
              "type": "string"
            },
            "codemods": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "args": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "consumesPackages": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "id",
            "version",
            "adapter"
          ],
          "additionalProperties": false
        }
      }
    },
    "regions": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "string"
        }
      }
    },
    "registries": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "headers": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              "params": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "readmeChecksum": {
      "type": "string"
    }
  },
  "required": [
    "version",
    "projectShape",
    "packageManager",
    "name",
    "apps",
    "modules",
    "regions"
  ],
  "additionalProperties": false
}
