{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "$schema": {
      "default": "https://cdn.jsdelivr.net/npm/revola@0.1.0/schema.json",
      "description": "Path to the JSON schema for IDE autocompletion.",
      "type": "string",
      "format": "uri"
    },
    "logLevel": {
      "default": "info",
      "description": "Controls the verbosity of Revola logging output.",
      "type": "string",
      "enum": [
        "trace",
        "debug",
        "info",
        "success",
        "warn",
        "error",
        "fatal",
        "silent"
      ]
    },
    "preset": {
      "default": "node",
      "description": "Preset configuration allowing a single value or a unique array values.",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "node",
            "deno",
            "git"
          ]
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "node",
              "deno"
            ]
          },
          "uniqueItems": true
        }
      ]
    },
    "version": {
      "default": {
        "strategy": "semver",
        "defaultBump": "patch"
      },
      "type": "object",
      "properties": {
        "strategy": {
          "default": "semver",
          "description": "Determines how the next version is calculated.",
          "type": "string",
          "enum": [
            "semver"
          ]
        },
        "defaultBump": {
          "default": "patch",
          "description": "The default level to bump the version when using the \"semver\" strategy.",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "description": "Configuration for versioning behavior."
    },
    "git": {
      "default": {
        "cleanWorkingDirectory": true,
        "upstream": true,
        "author": {
          "name": "github-actions[bot]",
          "email": "41898282+github-actions[bot]@users.noreply.github.com"
        },
        "targetBranch": "main",
        "add": true,
        "commit": true,
        "commitMessage": "Release {{REVOLA_VERSION}}",
        "push": true,
        "tag": true,
        "tagFormat": "v{{REVOLA_VERSION}}",
        "tagAnnotation": "Release {{REVOLA_VERSION}}",
        "tagMajor": false,
        "tagMinor": false
      },
      "type": "object",
      "properties": {
        "cleanWorkingDirectory": {
          "default": true,
          "description": "If true, Revola will check for a clean working directory before performing versioning operations.",
          "type": "boolean"
        },
        "upstream": {
          "default": true,
          "description": "If true, Revola will check for an upstream branch and push to it by default when pushing new versions.",
          "type": "boolean"
        },
        "author": {
          "default": {
            "name": "github-actions[bot]",
            "email": "41898282+github-actions[bot]@users.noreply.github.com"
          },
          "type": "object",
          "properties": {
            "name": {
              "default": "github-actions[bot]",
              "description": "Name to use for release commits.",
              "type": "string"
            },
            "email": {
              "default": "41898282+github-actions[bot]@users.noreply.github.com",
              "description": "Email to use for release commits.",
              "type": "string",
              "format": "email",
              "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
            }
          },
          "additionalProperties": false,
          "description": "Overrides Git author identity ONLY for release commits (does not modify global Git config)."
        },
        "targetBranch": {
          "default": "main",
          "description": "The branch on which to perform versioning operations.",
          "type": "string"
        },
        "add": {
          "default": true,
          "description": "If true, Revola will stage all changes before committing the new version.",
          "type": "boolean"
        },
        "commit": {
          "default": true,
          "description": "If true, Revola will commit the new version.",
          "type": "boolean"
        },
        "commitMessage": {
          "default": "Release {{REVOLA_VERSION}}",
          "type": "string"
        },
        "push": {
          "default": true,
          "description": "If true, Revola will push the new version to the remote repository.",
          "type": "boolean"
        },
        "tag": {
          "default": true,
          "description": "If true, Revola will create a Git tag for the new version (e.g: v1.2.3).",
          "type": "boolean"
        },
        "tagFormat": {
          "default": "v{{REVOLA_VERSION}}",
          "description": "Template for Git tag names.",
          "type": "string"
        },
        "tagAnnotation": {
          "default": "Release {{REVOLA_VERSION}}",
          "description": "The annotation to use for Git tags created by Revola.",
          "type": "string"
        },
        "tagMajor": {
          "default": false,
          "description": "If true, Revola will create a Git tag for major version releases (e.g: v1.2.3 -> v1).",
          "type": "boolean"
        },
        "tagMinor": {
          "default": false,
          "description": "If true, Revola will create a Git tag for minor version releases (e.g: v1.2.3 -> v1.2).",
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "description": "Configuration for Git-related settings in Revola."
    },
    "npm": {
      "default": {
        "publish": true,
        "registry": "https://registry.npmjs.org/",
        "tokenRef": "NPM_TOKEN",
        "packageManager": "npm",
        "tag": "latest",
        "access": "public",
        "provenance": false
      },
      "type": "object",
      "properties": {
        "publish": {
          "default": true,
          "description": "Whether to publish to npm.",
          "type": "boolean"
        },
        "registry": {
          "default": "https://registry.npmjs.org/",
          "description": "The npm registry URL to publish to.",
          "type": "string",
          "format": "uri"
        },
        "tokenRef": {
          "default": "NPM_TOKEN",
          "description": "Environment variable name that holds the registry auth token.",
          "type": "string"
        },
        "packageManager": {
          "default": "npm",
          "description": "The package manager used to invoke the npm publish command.",
          "type": "string",
          "enum": [
            "npm",
            "pnpm",
            "yarn",
            "bun"
          ]
        },
        "tag": {
          "default": "latest",
          "description": "The dist-tag to publish under (e.g. latest, next, beta).",
          "type": "string"
        },
        "access": {
          "default": "public",
          "description": "Package access level on npm.",
          "type": "string",
          "enum": [
            "public",
            "restricted"
          ]
        },
        "provenance": {
          "default": false,
          "description": "Whether to publish with npm provenance (requires CI environment).",
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "description": "npm publish configuration"
    },
    "jsr": {
      "default": {
        "publish": false,
        "tokenRef": "JSR_TOKEN",
        "packageManager": "npx"
      },
      "type": "object",
      "properties": {
        "publish": {
          "default": false,
          "description": "Whether to publish to JSR.",
          "type": "boolean"
        },
        "publishArgs": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "--allow-dirty",
              "--allow-slow-types",
              "--no-provenance"
            ]
          },
          "uniqueItems": true,
          "description": "Additional arguments to pass to the JSR publish command."
        },
        "tokenRef": {
          "default": "JSR_TOKEN",
          "description": "Environment variable name that holds the registry auth token (e.g. \"JSR_TOKEN\").",
          "type": "string"
        },
        "packageManager": {
          "default": "npx",
          "description": "The package manager used to invoke the JSR publish command.",
          "type": "string",
          "enum": [
            "deno",
            "npx"
          ]
        }
      },
      "additionalProperties": false,
      "description": "jsr publish configuration"
    },
    "changelog": {
      "default": {
        "enabled": true,
        "file": "CHANGELOG.md",
        "title": "{{REVOLA_VERSION}} ({{REVOLA_DATE}})",
        "includeTypes": [
          "BREAKING CHANGE",
          "feat",
          "fix",
          "perf",
          "refactor",
          "docs",
          "deps",
          "ci",
          "chore"
        ]
      },
      "type": "object",
      "properties": {
        "enabled": {
          "default": true,
          "description": "Whether to generate/update the changelog.",
          "type": "boolean"
        },
        "file": {
          "default": "CHANGELOG.md",
          "description": "Path to the changelog file.",
          "type": "string"
        },
        "title": {
          "default": "{{REVOLA_VERSION}} ({{REVOLA_DATE}})",
          "description": "Template for release title.",
          "type": "string"
        },
        "includeTypes": {
          "default": [
            "BREAKING CHANGE",
            "feat",
            "fix",
            "perf",
            "refactor",
            "docs",
            "deps",
            "ci",
            "chore"
          ],
          "description": "List of commit types to include in the changelog. If empty or not provided, all commit types are included. The order matters and determines how sections are organized in the final changelog.",
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "feat",
              "fix",
              "docs",
              "style",
              "refactor",
              "perf",
              "test",
              "build",
              "ci",
              "chore",
              "revert",
              "deps",
              "config",
              "security",
              "types",
              "lint",
              "format",
              "release",
              "meta",
              "infra",
              "hotfix",
              "version",
              "workflow",
              "package",
              "workspace",
              "api",
              "BREAKING CHANGE",
              "db",
              "data",
              "ui",
              "ux",
              "accessibility",
              "backend",
              "frontend",
              "logging",
              "monitoring",
              "stability",
              "optimization",
              "dx",
              "tooling",
              "scripts",
              "cleanup",
              "migration",
              "rollback"
            ]
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false,
      "description": "Changelog configuration"
    },
    "hooks": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^(before|after):(init|version|git|publish|changelog)$"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1
          },
          {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      },
      "description": "Shell commands to run at various lifecycle stages. Each key is a lifecycle hook name and the value is the command(s) to run."
    },
    "plugins": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1
      },
      "additionalProperties": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "description": "Defines plugins where each key is a plugin name and the value is its configuration object."
    }
  },
  "additionalProperties": false
}
