{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cbsshekhawat18-lab.github.io/karni/assets/karni-recipe.schema.json",
  "title": "recipe.toml",
  "description": "Experimental. What a Karni recipe is: a ready-made karni.yaml and when to start from it. Generated by python -m karni_cli.recipes. Never edit it by hand.",
  "$defs": {
    "RecipeRoute": {
      "additionalProperties": false,
      "description": "Experimental. A ``[[routes]]`` entry: a path of the React app and the recipe's page for it.",
      "properties": {
        "path": {
          "description": "The route, as TanStack Router writes it: /cart, /shop/$slug.",
          "pattern": "^/([A-Za-z0-9_.-]+|\\$[a-z][A-Za-z0-9_]*)(/([A-Za-z0-9_.-]+|\\$[a-z][A-Za-z0-9_]*))*$",
          "type": "string"
        },
        "page": {
          "description": "The page that serves it: a file of the recipe's files/frontend/src/, without .tsx (pages/store/cart), whose default export is the page.",
          "pattern": "^[a-z0-9_-]+(/[a-z0-9_-]+)*$",
          "type": "string"
        },
        "public": {
          "default": false,
          "description": "true: a visitor sees the page without signing in (staticData.public). Default: the app's sign-in guard applies.",
          "type": "boolean"
        },
        "data": {
          "description": "More staticData of the route for the recipe's own layout to read, e.g. {area = \"store\"}. The recipe declares their types (StaticDataRouteOption).",
          "patternProperties": {
            "^[a-z][A-Za-z0-9]*$": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "type": "object"
        }
      },
      "required": [
        "path",
        "page"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "name": {
      "description": "The recipe's name: its folder's name, or its entry point's. Lowercase letters, digits, - and _. blank is taken by the blank start.",
      "pattern": "^[a-z][a-z0-9_-]*$",
      "type": "string"
    },
    "title": {
      "description": "A short human name, e.g. Online shop.",
      "minLength": 1,
      "pattern": "^[^\\n]+$",
      "type": "string"
    },
    "purpose": {
      "description": "What the app does, in one line of at most 80 characters.",
      "maxLength": 80,
      "minLength": 1,
      "pattern": "^[^\\n]+$",
      "type": "string"
    },
    "use_when": {
      "description": "Plain phrases of what someone asks for when this recipe fits, e.g. [\"online shop\", \"sell products\", \"checkout\"]. karni recipes list --match ranks recipes by the words a request shares with them.",
      "items": {
        "minLength": 1,
        "pattern": "^[^\\n]+$",
        "type": "string"
      },
      "minItems": 1,
      "type": "array"
    },
    "usually_changed": {
      "description": "What people usually change in the spec after starting from it, in plain words, e.g. [\"the product fields\", \"the currency\"].",
      "items": {
        "minLength": 1,
        "pattern": "^[^\\n]+$",
        "type": "string"
      },
      "type": "array"
    },
    "version": {
      "anyOf": [
        {
          "pattern": "^\\d+(\\.\\d+){0,2}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Experimental. The recipe's own version, e.g. 1.0.0, recorded when a project adds it and compared by karni recipes upgrade. Default: karni-cli's version."
    },
    "requires": {
      "description": "Experimental. Core contracts and modules the recipe needs, each with an optional version range: [\"people>=1\", \"events>=1\", \"storage\"]. Adding the recipe switches each contract on and lists each module.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "conflicts": {
      "description": "Experimental. Recipes and modules the recipe cannot share a project with.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "routes": {
      "description": "The React pages of the recipe's files and their paths: the first karni build registers each in frontend/src/routes.tsx.",
      "items": {
        "$ref": "#/$defs/RecipeRoute"
      },
      "type": "array"
    }
  },
  "required": [
    "name",
    "title",
    "purpose",
    "use_when"
  ],
  "type": "object"
}
