{
  "$schema": "http://json-schema.org/schema",
  "$id": "worker",
  "title": "Create a Cloudflare Worker Application",
  "description": "Create a Cloudflare Worker Application",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the worker",
      "$default": {
        "$source": "argv",
        "index": 0
      },
      "x-prompt": "What name would you like to use?"
    },
    "js": {
      "type": "boolean",
      "description": "Use JavaScript instead of TypeScript"
    },
    "projectNameAndRootFormat": {
      "description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
      "type": "string",
      "enum": ["as-provided", "derived"]
    },
    "tags": {
      "type": "string",
      "description": "Add tags to the application (used for linting)."
    },
    "frontendProject": {
      "type": "string",
      "description": "Frontend project that needs to access this application. This sets up proxy configuration.",
      "x-priority": "important"
    },
    "unitTestRunner": {
      "type": "string",
      "enum": ["vitest", "none"],
      "description": "Test runner to use for unit tests.",
      "default": "vitest"
    },
    "template": {
      "description": "Generate the initial worker using a template.",
      "type": "string",
      "enum": ["fetch-handler", "scheduled-handler", "hono", "none"],
      "default": "fetch-handler",
      "x-prompt": "Which worker template do you want to use?",
      "x-priority": "important"
    },
    "port": {
      "description": "The port in which the worker will be run on development mode",
      "type": "number",
      "default": 8787
    },
    "accountId": {
      "description": "The Cloudflare account identifier where the worker will be deployed",
      "type": "string"
    },
    "directory": {
      "description": "The directory of the new application.",
      "type": "string",
      "x-priority": "important"
    },
    "rootProject": {
      "description": "Create worker application at the root of the workspace",
      "type": "boolean",
      "default": false,
      "hidden": true,
      "x-priority": "internal"
    },
    "skipFormat": {
      "description": "Skip formatting files.",
      "type": "boolean",
      "default": false
    }
  },
  "required": ["name"]
}
