{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mangle.icebreaker.top/schemas/tailwindcss-patch/migration-report.schema.json",
  "title": "tailwindcss-patch migration report",
  "description": "Schema for reports generated by `tw-patch migrate --report-file`.",
  "type": "object",
  "required": [
    "cwd",
    "dryRun",
    "rollbackOnError",
    "scannedFiles",
    "changedFiles",
    "writtenFiles",
    "backupsWritten",
    "unchangedFiles",
    "missingFiles",
    "entries"
  ],
  "properties": {
    "reportKind": {
      "type": "string",
      "const": "tw-patch-migrate-report"
    },
    "schemaVersion": {
      "type": "integer",
      "const": 1
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "tool": {
      "type": "object",
      "required": [
        "name",
        "version"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "cwd": {
      "type": "string"
    },
    "dryRun": {
      "type": "boolean"
    },
    "rollbackOnError": {
      "type": "boolean"
    },
    "backupDirectory": {
      "type": "string"
    },
    "scannedFiles": {
      "type": "integer",
      "minimum": 0
    },
    "changedFiles": {
      "type": "integer",
      "minimum": 0
    },
    "writtenFiles": {
      "type": "integer",
      "minimum": 0
    },
    "backupsWritten": {
      "type": "integer",
      "minimum": 0
    },
    "unchangedFiles": {
      "type": "integer",
      "minimum": 0
    },
    "missingFiles": {
      "type": "integer",
      "minimum": 0
    },
    "entries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/entry"
      }
    }
  },
  "allOf": [
    {
      "if": {
        "required": [
          "reportKind"
        ]
      },
      "then": {
        "required": [
          "schemaVersion",
          "generatedAt",
          "tool"
        ]
      }
    }
  ],
  "$defs": {
    "entry": {
      "type": "object",
      "required": [
        "file",
        "changed",
        "written",
        "rolledBack",
        "changes"
      ],
      "properties": {
        "file": {
          "type": "string"
        },
        "changed": {
          "type": "boolean"
        },
        "written": {
          "type": "boolean"
        },
        "rolledBack": {
          "type": "boolean"
        },
        "backupFile": {
          "type": "string"
        },
        "changes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
