{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/monospace-yml/latest.json",
  "title": "monospace.yml",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/software-t-rex/monospace/main/apps/monospace/schemas/monospace.schema.json",
    "sourceSha256": "ed7b85e2c7aaf842a880eb6402b1681626f99236be82502281db18f5b629dda5",
    "fileMatch": [
      "monospace.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "$ref": "#/$defs/RootSchema",
  "$defs": {
    "RootSchema": {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string",
          "default": "https://raw.githubusercontent.com/software-t-rex/monospace/main/apps/monospace/schemas/monospace.schema.json"
        },
        "js_package_manager": {
          "title": "monospace.yml: js_package_manager",
          "description": "specify the package manager to use in js/ts projects. It use the same syntax as package.json package_manager",
          "type": "string",
          "default": "pnpm@10.11.0"
        },
        "go_mod_prefix": {
          "title": "monospace.yml: go_mod_prefix",
          "description": "Default namespace to use for your go modules",
          "type": "string",
          "default": "example.com"
        },
        "preferred_output_mode": {
          "title": "monospace.yml: preferred_output_mode",
          "$ref": "#/$defs/output_mode"
        },
        "projects": {
          "title": "monospace.yml: projects",
          "description": "Key value pair where keys are path to the project in the monospace and values are either: 'internal', 'local', or a git repo url",
          "type": "object",
          "$ref": "#/$defs/ProjectSchema"
        },
        "projects_aliases": {
          "title": "monospace.yml: projects_aliases",
          "description": "Aliases for projects, it allows you to define shorter names to use in commands that point to projects. (can't be 'root' as it is a reserved alias)",
          "type": "object",
          "propertyNames": {
            "pattern": "^(?!root$)[A-Za-z0-9_-]+$"
          },
          "patternProperties": {
            "^[A-Za-z0-9_-]+$": {
              "description": "This must be the name of a project defined in projects",
              "type": "string",
              "pattern": "^[A-Za-z0-9./_-]+$"
            }
          }
        },
        "pipeline": {
          "title": "monospace.yml: pipeline",
          "description": "An object representing the task dependency graph of your monospace",
          "type": "object",
          "default": {},
          "additionalProperties": {
            "$ref": "#/$defs/TaskSchema",
            "description": "Name of a task that can be executed by monospace run.\nIt is in the form \"projectName#taskName\" where projectName can be:\n - a project name defined in the 'projects' section\n - an alias defined in the 'projects_aliases' section\n - 'root' to refer to the root of the monospace\n - '*' to define a tasks that will execute on all projects\n - if only a taskName is given it is considered to be prefixed by '*' so 'task' = '*#task'"
          }
        }
      },
      "required": [
        "projects"
      ],
      "additionalProperties": false
    },
    "ProjectSchema": {
      "title": "monospace.yml: projects",
      "type": "object",
      "propertyNames": {
        "pattern": "^(?!root$)[A-Za-z0-9./_-]+$"
      },
      "patternProperties": {
        "^[A-Za-z0-9./_-]+$": {
          "type": "string",
          "default": "internal",
          "description": "Keys are path to the project in the monospace (can't be 'root' as it is a reserved word).\nValues are either:'internal', 'local' or a git repository url ending with .git",
          "pattern": "^internal|^local|.git$"
        }
      }
    },
    "TaskSchema": {
      "title": "monospace.yml: pipeline[task]",
      "type": "object",
      "properties": {
        "cmd": {
          "title": "monospace.yml: pipeline[task].cmd",
          "description": "By default task will be looked up in the package.json script properties.\nYou can override this behavior by providing the command to execute. It must be an array of string ie: [ls, -l].\nThis can also be useful for projects that don't have a package.json at all.\n----\nℹ: This is not a shell command, so you can't use shell features like pipes, redirections, etc...\nEither use an external script for this or something like [/bin/sh, -c, \"command1 && command2\"]\nAdditionally .monospace/bin will be added to your path and can be used to store utility commands to ship with your monospace.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "dependsOn": {
          "title": "monospace.yml: pipeline[task].dependsOn",
          "description": "The list of tasks that this task depends on.\nDependencies should be listed in the form 'projectName#taskName', if prefix 'projectName#' is ommited then it is considered to point to a task of the same project.\n\nFor example given the following pipeline:\n  myproject#test: \n    dependsOn: [build, myotherProject#test]\n  myproject#build:{}\n  myotherProject#test:{}\n\nthe test task of myproject will depend on the build task of myproject and the test task of myotherProject",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "title": "monospace.yml: pipeline[task].description",
          "description": "An optional description of the task.",
          "type": "string",
          "default": ""
        },
        "persistent": {
          "title": "monospace.yml: pipeline[task].persistent",
          "description": "Persistent tasks are long-running process such as server, or watchers that will not exit unless manually stopped.\nIt is important to mark such tasks as persistent, doing so monospace will prevent other tasks to depend on them and will inform you of configuration problem when running in check mode",
          "type": "boolean",
          "default": false
        },
        "output_mode": {
          "title": "monospace.yml: pipeline[task].output_mode",
          "$ref": "#/$defs/output_mode"
        }
      },
      "additionalProperties": false
    },
    "output_mode": {
      "description": "Default output mode to use for run and exec commands.\n\n- none: no output from tasks\n- interleaved: print prefixed output from tasks as they arrive\n- grouped: print combined output of tasks as they complete.\n- status-only: display running status summary\n- errors-only: is like interleaved output but displaying only what comes on stderr\n\nDefaults:\n- preferred_output_mode: grouped\n- pipeline[task].output_mode: inherits from preferred_output_mode",
      "type": "string",
      "enum": [
        "grouped",
        "interleaved",
        "errors-only",
        "status-only",
        "none"
      ],
      "default": "grouped"
    }
  }
}
