{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "addPanel": { "$ref": "#/$defs/AddPanelConfig" },
    "svgLoader": {
      "description": "Configures how SVG assets load.\nRefer to https://help.codux.com/kb/en/article/kb17934 for more information.",
      "type": "string",
      "default": "asset"
    },
    "boardsPath": {
      "description": "Default directory for new boards, relative to the project root.\nRefer to https://help.codux.com/kb/en/article/kb19337 for more information.",
      "type": "string",
      "default": "src/_codux/boards"
    },
    "scripts": {
      "description": "Configures scripts for project users to run from Codux (triggerable and on demand).\nRefer to https://help.codux.com/kb/en/article/kb30920 for more information.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": { "$ref": "#/$defs/ConfiguredScript" },
          "propertyNames": { "type": "string" }
        }
      ]
    },
    "conditionalClassnamesConfig": {
      "description": "Options for using the classNames utility library, including path to classNames module, and target export.\nRefer to https://help.codux.com/kb/en/article/kb36122 for more information.",
      "oneOf": [{ "$ref": "#/$defs/IClassNamesPluginsOptions" }]
    },
    "boardGlobalSetup": {
      "description": "Path to a file that will be evaluated before each board is rendered,\nUseful for importing global stylesheets and initializing global variables.\nCan be absolute or relative to the project root (in which case it needs to start with './')\nRefer to https://help.codux.com/kb/en/article/kb36623 for more information.",
      "oneOf": [{ "type": "null" }, { "type": "string" }]
    },
    "previewConfiguration": { "$ref": "#/$defs/PreviewConfiguration" },
    "cssCompilation": { "$ref": "#/$defs/ICompilationConfig" },
    "safeRender": { "$ref": "#/$defs/PluggableSafeModeConfig" },
    "httpServerPort": {
      "description": "Port of HTTP server that is used to serve previews and user project itself.",
      "type": "number",
      "default": 0
    },
    "newComponent": { "$ref": "#/$defs/INewComponentConfig" },
    "ignoredSubPaths": { "$ref": "#/$defs/IgnoredSubPaths" },
    "fileNamingConvention": {
      "description": "Configures file-naming convention for new component creation.\nRefer to https://help.codux.com/kb/en/article/kb29627 for more information.\nOptions: \"pascal-case\" | \"camel-case\" | \"kebab-case\"",
      "oneOf": [{ "type": "string" }]
    },
    "resolve": { "$ref": "#/$defs/IResolveConfiguration" },
    "sassCompilation": { "$ref": "#/$defs/SassCompilationProjectConfigEntry" },
    "serverProxyMap": {
      "type": "object",
      "additionalProperties": { "type": "string" },
      "propertyNames": { "type": "string" },
      "description": "Configures proxy servers for Codux to redirect requests to.\nThe key is the path to proxy requests from, and the value is the url to proxy requests to.\nRefer to https://help.codux.com/kb/en/article/kb18137 for more information."
    },
    "styling": {
      "description": "Styling related configuration.\nContains field for styling solution which determines the main styling solution in the user's project.\nRefer to https://help.codux.com/kb/en/article/kb31817 for more information.",
      "type": "object",
      "properties": {
        "solution": {
          "description": "Default file extension to use for component style sheets in the project.\nOptions: \"css\" | \"sass\" | \"css modules\" | \"sass modules\" | \"scss\" | \"scss modules\" | \"stylable\"",
          "oneOf": [{ "type": "string" }]
        }
      }
    },
    "styleFilesConfig": { "$ref": "#/$defs/IStyleFilesConfig" },
    "tailwindcssConfig": { "oneOf": [{ "type": "string" }] },
    "formatting": {
      "description": "Formats code styling in Codux code drawer.\nRefer to https://help.codux.com/kb/en/article/kb21416 for more information.",
      "oneOf": [
        { "type": "null" },
        { "type": "string" },
        { "type": "number" },
        { "type": "array", "items": { "$ref": "#/$defs/Json" } },
        { "type": "object" },
        { "type": "boolean" }
      ]
    },
    "componentsDiscovery": { "$ref": "#/$defs/ComponentsDiscoveryConfig" }
  },
  "$defs": {
    "AddPanelConfig": {
      "description": "Add Panel config.\nCan contain list of libraries installed in the project which provide boards for Codux.",
      "type": "object",
      "properties": {
        "assets": {
          "oneOf": [{ "type": "array", "items": { "type": "string" } }]
        }
      }
    },
    "ConfiguredScript": {
      "description": "The type of configured script users will define in the `codux.config.json`.",
      "oneOf": [
        { "$ref": "#/$defs/ScriptFromConfig" },
        { "$ref": "#/$defs/BatchFromConfig" }
      ]
    },
    "ScriptFromConfig": {
      "description": "Scripts have a `commmand` but not an array of scripts to `run`.",
      "type": "object",
      "properties": {
        "command": {
          "description": "This is the command that the script runs when executed.",
          "type": "string"
        },
        "title": {
          "description": "Script title in the UI.\nWill be available to use from Codux.",
          "oneOf": [{ "type": "string" }]
        },
        "description": {
          "description": "Script description in the UI.",
          "oneOf": [{ "type": "string" }]
        },
        "trigger": {
          "description": "Initiate Git commands in Codux before running the rest of the scripts.\nThe array of triggers may include \"setup\" for when the user opens the project for the first time,\n\"pull\" for when branch commits sync, and \"checkout\" for when switching branches.",
          "oneOf": [{ "type": "array", "items": { "type": "string" } }]
        }
      },
      "required": ["command"]
    },
    "BatchFromConfig": {
      "description": "Batches have a `run` array but not a `commmand`.",
      "type": "object",
      "properties": {
        "run": {
          "description": "The value of this parameter is an array of script objects to include in the batch.",
          "type": "array",
          "items": { "type": "string" }
        },
        "title": {
          "description": "Script title in the UI.\nWill be available to use from Codux.",
          "oneOf": [{ "type": "string" }]
        },
        "description": {
          "description": "Script description in the UI.",
          "oneOf": [{ "type": "string" }]
        },
        "trigger": {
          "description": "Initiate Git commands in Codux before running the rest of the scripts.\nThe array of triggers may include \"setup\" for when the user opens the project for the first time,\n\"pull\" for when branch commits sync, and \"checkout\" for when switching branches.",
          "oneOf": [{ "type": "array", "items": { "type": "string" } }]
        }
      },
      "required": ["run"]
    },
    "IClassNamesPluginsOptions": {
      "type": "object",
      "properties": {
        "classnamesPath": { "type": "string" },
        "classnamesTarget": { "type": "string" }
      },
      "required": ["classnamesPath", "classnamesTarget"]
    },
    "PreviewConfiguration": {
      "description": "Specifies environment variables to use globally across the project.\nRefer to https://help.codux.com/kb/en/article/kb37722 for more information.",
      "type": "object",
      "properties": {
        "environmentVariables": {
          "type": "object",
          "additionalProperties": { "type": "string" },
          "propertyNames": { "type": "string" },
          "description": "variables that are being accessed from process.env"
        }
      },
      "required": ["environmentVariables"]
    },
    "ICompilationConfig": {
      "description": "Enables CSS modules in your project.\nRefer to https://help.codux.com/kb/en/article/kb25813 for more information.",
      "type": "object",
      "properties": {
        "activateCssModules": {
          "description": "Enables or disables the use of CSS modules.",
          "type": "boolean"
        },
        "cssModulesExt": {
          "description": "The extension types for files to load as modules.",
          "type": "array",
          "items": { "type": "string" }
        }
      },
      "required": ["activateCssModules", "cssModulesExt"]
    },
    "PluggableSafeModeConfig": {
      "description": "Configures maximum rendered elements.\nRefer to https://help.codux.com/kb/en/article/kb18414 for more information.",
      "type": "object",
      "properties": {
        "maxInstancesPerComponent": { "oneOf": [{ "type": "number" }] }
      }
    },
    "INewComponentConfig": {
      "description": "Configures default paths for new component and template files.\nRefer to https://help.codux.com/kb/en/article/kb16522 for more information.",
      "type": "object",
      "properties": {
        "componentsPath": {
          "description": "Path where new components and related files will save to.",
          "oneOf": [{ "type": "string" }]
        },
        "templatesPath": {
          "description": "Path where project templates are stored.",
          "oneOf": [{ "type": "string" }]
        }
      }
    },
    "IgnoredSubPaths": {
      "description": "Specifies project folders to exclude from component search.\nRefer to https://help.codux.com/kb/en/article/kb14730 for more information.",
      "oneOf": [{ "type": "array", "items": { "type": "string" } }]
    },
    "IResolveConfiguration": {
      "description": "Includes package assets from additional sources, and creates aliases and fallbacks.\nRefer to https://help.codux.com/kb/en/article/kb18719 for more information.",
      "type": "object",
      "properties": {
        "alias": {
          "description": "Aliases for package requests.\nRecord key is the request to be mapped, value is the new target.\nAlias is attempted before original request.",
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": {
                "oneOf": [{ "type": "string" }, { "type": "boolean" }]
              },
              "propertyNames": { "type": "string" }
            }
          ]
        },
        "fallback": {
          "description": "Fallback for package requests.\nRecord key is the request to be mapped, value is the new target.\nOriginal request is attempted before fallback.",
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": {
                "oneOf": [{ "type": "string" }, { "type": "boolean" }]
              },
              "propertyNames": { "type": "string" }
            }
          ]
        },
        "packageRoots": {
          "description": "Folders to use when searching for packages.",
          "oneOf": [{ "type": "array", "items": { "type": "string" } }]
        },
        "workspaceAlias": {
          "description": "Aliases for all package requests in a monorepo.\nRecord key is the request to be mapped, value is the new target.",
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": { "type": "string" },
              "propertyNames": { "type": "string" }
            }
          ]
        }
      }
    },
    "SassCompilationProjectConfigEntry": {
      "description": "Adds Sass support to compilations.\nRefer to https://help.codux.com/kb/en/article/kb19315 for more information.",
      "type": "object",
      "properties": {
        "modules": {
          "description": "Defines path and module extensions for Sass modules to include and/or ignore.\nInput as an array of glob patterns.",
          "type": "object",
          "properties": {
            "include": {
              "description": "Array of glob patterns to include.",
              "oneOf": [
                { "type": "string" },
                { "type": "array", "items": { "type": "string" } }
              ]
            },
            "ignore": {
              "description": "Array of glob patterns to ignore.",
              "oneOf": [
                { "type": "string" },
                { "type": "array", "items": { "type": "string" } }
              ]
            }
          },
          "required": ["include"]
        },
        "resolveUrls": {
          "description": "Determines whether URLs in Sass files should resolve to absolute file paths before compiling them.",
          "type": "boolean"
        },
        "includePaths": {
          "description": "Array of paths to resolve Sass files from.",
          "oneOf": [{ "type": "array", "items": { "type": "string" } }]
        }
      },
      "required": ["modules", "resolveUrls"]
    },
    "IStyleFilesConfig": {
      "description": "Style files config",
      "type": "object",
      "properties": {
        "commonStyleFilePattern": {
          "description": "ext glob pattern of common style files that are used by other components. Defines common rules category.",
          "oneOf": [{ "type": "string" }]
        }
      }
    },
    "Json": {
      "oneOf": [
        { "type": "null" },
        { "type": "string" },
        { "type": "number" },
        { "type": "array", "items": { "$ref": "#/$defs/Json" } },
        { "type": "object" },
        { "type": "boolean" }
      ]
    },
    "ComponentsDiscoveryConfig": {
      "description": "Scopes component discovery in your project.\nRefer to https://help.codux.com/kb/en/article/kb37113 for more information.",
      "type": "object",
      "properties": {
        "include": {
          "description": "Array of glob patterns to include.",
          "oneOf": [{ "type": "array", "items": { "type": "string" } }]
        },
        "exclude": {
          "description": "Array of glob patterns to exclude.",
          "oneOf": [{ "type": "array", "items": { "type": "string" } }]
        }
      }
    }
  }
}