{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://schemas.yarnspinner.dev/yarnproject-v3.schema.json",
    "$comment": "Yarn Spinner project file schema, version 3.",
    "version": 3,
    "title": "Yarn Spinner Project",
    "description": "Configuration file for a Yarn Spinner project (.yarnproject)",
    "type": "object",
    "required": [
        "projectFileVersion",
        "sourceFiles",
        "baseLanguage"
    ],
    "properties": {
        "projectFileVersion": {
            "type": "integer",
            "description": "The version of the project file format.",
            "minimum": 2,
            "default": 3
        },
        "sourceFiles": {
            "type": "array",
            "description": "Glob patterns specifying which .yarn files to include. Relative to the .yarnproject location.",
            "items": {
                "type": "string"
            },
            "default": [
                "**/*.yarn"
            ]
        },
        "excludeFiles": {
            "type": "array",
            "description": "Glob patterns specifying files to exclude, even if they match sourceFiles.",
            "items": {
                "type": "string"
            }
        },
        "baseLanguage": {
            "type": "string",
            "description": "The language code for the source language of dialogue in .yarn files (e.g. 'en', 'ja', 'zh-Hans').",
            "default": "en"
        },
        "localisation": {
            "type": "object",
            "description": "Maps language codes to their string tables and asset directories for translation.",
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "strings": {
                        "type": "string",
                        "description": "Path to the CSV file containing translated strings."
                    },
                    "assets": {
                        "type": "string",
                        "description": "Path to the directory containing localized assets."
                    }
                },
                "additionalProperties": false
            }
        },
        "definitions": {
            "description": "Path(s) to .ysls.json definition files for custom commands and functions.",
            "type": "string"
        },
        "compilerOptions": {
            "type": "object",
            "description": "Options that affect compilation. Used by all parts of the Yarn Spinner pipeline.",
            "properties": {
                "allowPreviewFeatures": {
                    "type": "boolean",
                    "description": "If true, enables experimental language features that may change.",
                    "default": false
                },
                "yarnScriptEditor": {
                    "$ref": "yarnscripteditor.schema.json"
                }
            },
            "additionalProperties": true
        }
    },
    "additionalProperties": true
}