{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "CodeComponentConfig": {
            "properties": {
                "componentImportPath": {
                    "type": "string"
                },
                "displayName": {
                    "type": "string"
                },
                "helper": {
                    "properties": {
                        "importPath": {
                            "type": "string"
                        },
                        "name": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "importPath",
                        "name"
                    ],
                    "type": "object"
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            },
            "required": [
                "componentImportPath",
                "displayName",
                "id",
                "name"
            ],
            "type": "object"
        },
        "CodeConfig": {
            "properties": {
                "lang": {
                    "description": "Language to generate code in",
                    "enum": [
                        "js",
                        "ts"
                    ],
                    "type": "string"
                },
                "reactRuntime": {
                    "enum": [
                        "automatic",
                        "classic"
                    ],
                    "type": "string"
                },
                "scheme": {
                    "description": "The default code generation scheme. Each component can override the scheme.",
                    "enum": [
                        "blackbox"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "lang",
                "reactRuntime",
                "scheme"
            ],
            "type": "object"
        },
        "ComponentConfig": {
            "properties": {
                "componentType": {
                    "enum": [
                        "component",
                        "page"
                    ],
                    "type": "string"
                },
                "cssFilePath": {
                    "description": "The file path for the component css file, relative to srcDir.",
                    "type": "string"
                },
                "id": {
                    "description": "Component ID",
                    "type": "string"
                },
                "importSpec": {
                    "$ref": "#/definitions/ImportSpec",
                    "description": "How to import this Component from another component file"
                },
                "name": {
                    "description": "Javascript name of component",
                    "type": "string"
                },
                "path": {
                    "description": "Page path if the component is a page",
                    "type": "string"
                },
                "plumeType": {
                    "description": "Plume type if component is a Plume component",
                    "type": "string"
                },
                "projectId": {
                    "description": "Plasmic project that this component belongs in",
                    "type": "string"
                },
                "renderModuleFilePath": {
                    "description": "The file path for the blackbox render module, relative to srcDir.",
                    "type": "string"
                },
                "rsc": {
                    "description": "RSC metadata for this component. The structure of the config changes when this is set:\nrenderModuleFilePath points to the client blackbox render module.\nimportSpec points to the server skeleton file.",
                    "properties": {
                        "clientModulePath": {
                            "description": "The client skeleton file",
                            "type": "string"
                        },
                        "serverModulePath": {
                            "description": "The server blackbox render module",
                            "type": "string"
                        }
                    },
                    "required": [
                        "clientModulePath",
                        "serverModulePath"
                    ],
                    "type": "object"
                },
                "scheme": {
                    "description": "Code generation scheme used for this component",
                    "enum": [
                        "blackbox",
                        "direct"
                    ],
                    "type": "string"
                },
                "type": {
                    "description": "Whether this component is managed by Plasmic -- with Plasmic* files generated -- or mapped to an external library",
                    "enum": [
                        "managed",
                        "mapped"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "componentType",
                "cssFilePath",
                "id",
                "importSpec",
                "name",
                "projectId",
                "renderModuleFilePath",
                "scheme",
                "type"
            ],
            "type": "object"
        },
        "CustomFunctionConfig": {
            "properties": {
                "defaultExport": {
                    "type": "boolean"
                },
                "id": {
                    "type": "string"
                },
                "importPath": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "namespace": {
                    "type": [
                        "null",
                        "string"
                    ]
                }
            },
            "required": [
                "defaultExport",
                "id",
                "importPath",
                "name"
            ],
            "type": "object"
        },
        "FontConfig": {
            "properties": {
                "scheme": {
                    "description": "\"import\" generates `@import url(...)`\n\n\"none\" doesn't generate anything; you need to load the font yourself.",
                    "enum": [
                        "import",
                        "none"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "scheme"
            ],
            "type": "object"
        },
        "GlobalVariantGroupConfig": {
            "properties": {
                "contextFilePath": {
                    "description": "File path for the global variant group React context definition, relative to srcDir",
                    "type": "string"
                },
                "id": {
                    "description": "ID of the global variant group",
                    "type": "string"
                },
                "name": {
                    "description": "Javascript name of the global variant group",
                    "type": "string"
                },
                "projectId": {
                    "description": "Plasmic project this global variant group belongs to",
                    "type": "string"
                }
            },
            "required": [
                "contextFilePath",
                "id",
                "name",
                "projectId"
            ],
            "type": "object"
        },
        "GlobalVariantsConfig": {
            "properties": {
                "variantGroups": {
                    "items": {
                        "$ref": "#/definitions/GlobalVariantGroupConfig"
                    },
                    "type": "array"
                }
            },
            "required": [
                "variantGroups"
            ],
            "type": "object"
        },
        "I18NConfig": {
            "properties": {
                "keyScheme": {
                    "description": "For localization, whether the extracted strings are keyed by its content,\nor by a hash of its content, or by where the string is found (\"path\")",
                    "enum": [
                        "content",
                        "hash",
                        "path"
                    ],
                    "type": "string"
                },
                "tagPrefix": {
                    "description": "For localization, rich text with embedded tags are exported as\n\"Hello <0>there</0>, I am <1>here</1>\".  Some frameworks, like\nreact-intl, doesn't work with numbers as tag names, so you can\nspecify a prefix. For example, a tagPrefix of \"n\" turns the above\ninto \"Hello <n0>there</n0>, I am <n1>here</n1>\".",
                    "type": "string"
                }
            },
            "required": [
                "keyScheme"
            ],
            "type": "object"
        },
        "IconConfig": {
            "properties": {
                "id": {
                    "description": "ID of icon",
                    "type": "string"
                },
                "moduleFilePath": {
                    "description": "The file path for the React component file for this icon, relative to srcDir.",
                    "type": "string"
                },
                "name": {
                    "description": "Javascript name of the React component for this icon",
                    "type": "string"
                }
            },
            "required": [
                "id",
                "moduleFilePath",
                "name"
            ],
            "type": "object"
        },
        "ImageConfig": {
            "properties": {
                "filePath": {
                    "description": "File path for the image file, relative to srcDir",
                    "type": "string"
                },
                "id": {
                    "description": "ID of image",
                    "type": "string"
                },
                "name": {
                    "description": "name of image",
                    "type": "string"
                }
            },
            "required": [
                "filePath",
                "id",
                "name"
            ],
            "type": "object"
        },
        "ImagesConfig": {
            "properties": {
                "publicDir": {
                    "description": "The folder where \"public\" static files are stored. Plasmic-managed image files will be stored as \"plasmic/project-name/image-name\" under this folder.  Relative to srcDir; for example, \"../public\"",
                    "type": "string"
                },
                "publicUrlPrefix": {
                    "description": "The url prefix where \"public\" static files are stored.  For example, if publicDir is \"public\", publicUrlPrefix is \"/static\", then a file at public/test.png will be served at /static/test.png.",
                    "type": "string"
                },
                "scheme": {
                    "description": "How image files should be referenced from generated React components. The choices are:\n* \"files\" - imported as relative files, like \"import img from './image.png'\". Not all bundlers support this.\n* \"public-files\" - images are stored in a public folder, and referenced from some url prefix, like `<img src=\"/static/image.png\"/>`.\n* \"inlined\" - inlined directly into React files and css files as base64-encoded data-URIs.\n* \"cdn\" - images are served from Plasmic's CDN.  Allows for dynamic resizing of images for\n  serving the optimal file size given browser viewport.",
                    "enum": [
                        "cdn",
                        "files",
                        "inlined",
                        "public-files"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "scheme"
            ],
            "type": "object"
        },
        "ImportSpec": {
            "description": "Describes how to import a Component",
            "properties": {
                "exportName": {
                    "description": "If the Component is a named export of the module, then this is the name.  If the Component\nis the default export, then this is undefined.",
                    "type": "string"
                },
                "modulePath": {
                    "description": "The import path to use to instantiate this Component.  The modulePath can be:\n* An external npm module, like \"antd/lib/button\"\n* A local file, like \"components/Button.tsx\" (path is relative to srcDir, and file extension is fully specified).  If local file is specified, then the module is imported via relative path.\n\nFor this to be an external npm module, the ComponentConfig.type must be \"mapped\".",
                    "type": "string"
                }
            },
            "required": [
                "modulePath"
            ],
            "type": "object"
        },
        "ProjectConfig": {
            "properties": {
                "codeComponents": {
                    "items": {
                        "$ref": "#/definitions/CodeComponentConfig"
                    },
                    "type": "array"
                },
                "components": {
                    "description": "Metadata for each synced component in this project.",
                    "items": {
                        "$ref": "#/definitions/ComponentConfig"
                    },
                    "type": "array"
                },
                "cssFilePath": {
                    "description": "File location for the project-wide css styles. Relative to srcDir",
                    "type": "string"
                },
                "customFunctions": {
                    "items": {
                        "$ref": "#/definitions/CustomFunctionConfig"
                    },
                    "type": "array"
                },
                "dataTokensFilePath": {
                    "description": "File location for the project-wide data tokens provider. Relative to srcDir",
                    "type": "string"
                },
                "globalContextsFilePath": {
                    "description": "File location for the project-wide global contexts. Relative to srcDir",
                    "type": "string"
                },
                "icons": {
                    "description": "Metadata for each synced icon in this project",
                    "items": {
                        "$ref": "#/definitions/IconConfig"
                    },
                    "type": "array"
                },
                "images": {
                    "description": "Metadata for each synced image in this project",
                    "items": {
                        "$ref": "#/definitions/ImageConfig"
                    },
                    "type": "array"
                },
                "indirect": {
                    "description": "True if the project was installed indirectly (as a dependency); if set,\ncodegen will not generate pages.",
                    "type": "boolean"
                },
                "projectApiToken": {
                    "description": "Project API token. Grants read-only sync access to just this specific project and its dependencies.",
                    "type": "string"
                },
                "projectBranchName": {
                    "description": "Project branch to be synced",
                    "type": "string"
                },
                "projectId": {
                    "description": "Project ID",
                    "type": "string"
                },
                "projectModuleFilePath": {
                    "description": "File location for the project-wide plasmic.ts file. Relative to srcDir",
                    "type": "string"
                },
                "projectName": {
                    "description": "Project name synced down from Studio",
                    "type": "string"
                },
                "splitsProviderFilePath": {
                    "description": "File location for the project-wide splits provider. Relative to srcDir",
                    "type": "string"
                },
                "styleTokensProviderFilePath": {
                    "description": "File location for the project-wide style tokens provider. Relative to srcDir",
                    "type": "string"
                },
                "version": {
                    "description": "A version range for syncing this project. Can be:\n* \"latest\" - always syncs down whatever has been saved in the project.\n* \">0\" - always syncs down the latest published version of the project.\n* any other semver string you'd like",
                    "type": "string"
                }
            },
            "required": [
                "components",
                "cssFilePath",
                "dataTokensFilePath",
                "globalContextsFilePath",
                "icons",
                "images",
                "indirect",
                "projectId",
                "projectModuleFilePath",
                "projectName",
                "splitsProviderFilePath",
                "styleTokensProviderFilePath",
                "version"
            ],
            "type": "object"
        },
        "StyleConfig": {
            "properties": {
                "defaultStyleCssFilePath": {
                    "description": "File location for global css styles shared by all components. Relative to srcDir",
                    "type": "string"
                },
                "scheme": {
                    "description": "Styling framework to use",
                    "enum": [
                        "css",
                        "css-modules"
                    ],
                    "type": "string"
                },
                "skipGlobalCssImport": {
                    "type": "boolean"
                }
            },
            "required": [
                "defaultStyleCssFilePath",
                "scheme"
            ],
            "type": "object"
        },
        "TokensConfig": {
            "properties": {
                "scheme": {
                    "enum": [
                        "theo"
                    ],
                    "type": "string"
                },
                "tokensFilePath": {
                    "type": "string"
                }
            },
            "required": [
                "scheme",
                "tokensFilePath"
            ],
            "type": "object"
        }
    },
    "properties": {
        "cliVersion": {
            "description": "The version of cli when this file was written",
            "type": "string"
        },
        "code": {
            "$ref": "#/definitions/CodeConfig",
            "description": "Config for code generation"
        },
        "defaultPlasmicDir": {
            "description": "The default folder where Plasmic-managed files will be stored. These include\nblackbox component files, svg component files, style files, etc.  The path\nis relative to the srcDir.",
            "type": "string"
        },
        "fontOpts": {
            "$ref": "#/definitions/FontConfig",
            "description": "Config for fonts import"
        },
        "gatsbyConfig": {
            "description": "Gatsby-specific config",
            "properties": {
                "pagesDir": {
                    "description": "The folder containing page components source files.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "globalVariants": {
            "$ref": "#/definitions/GlobalVariantsConfig",
            "description": "Metadata for global variant groups"
        },
        "i18n": {
            "$ref": "#/definitions/I18NConfig",
            "description": "Configuration for localization"
        },
        "images": {
            "$ref": "#/definitions/ImagesConfig",
            "description": "Config for pictures"
        },
        "nextjsConfig": {
            "description": "Next.js specific config",
            "properties": {
                "pagesDir": {
                    "description": "The folder containing page components source files.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "packageManager": {
            "description": "Package manager to use when installing or upgrading required\npackages. If not specified, then it is best-effort automatically\nderived.",
            "enum": [
                "npm",
                "pnpm",
                "yarn",
                "yarn2"
            ],
            "type": "string"
        },
        "platform": {
            "description": "Target platform to generate code for",
            "enum": [
                "gatsby",
                "nextjs",
                "react",
                "tanstack"
            ],
            "type": "string"
        },
        "postSyncCommands": {
            "description": "Arbitrary command to run after `plasmic sync` has run; useful for linting and code formatting synced files",
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "preserveJsImportExtensions": {
            "description": "Whether to preserve js / ts / jsx / tsx file extensions in import statements",
            "type": "boolean"
        },
        "projects": {
            "description": "Metadata for each project that has been synced",
            "items": {
                "$ref": "#/definitions/ProjectConfig"
            },
            "type": "array"
        },
        "srcDir": {
            "description": "The folder containing the component source files; this is the default place where\nall files are generated and stored.",
            "type": "string"
        },
        "style": {
            "$ref": "#/definitions/StyleConfig",
            "description": "Config for style generation"
        },
        "tanstackConfig": {
            "description": "Tanstack-specific config",
            "properties": {
                "pagesDir": {
                    "description": "The folder containing page components source files.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "tokens": {
            "$ref": "#/definitions/TokensConfig",
            "description": "Config for style tokens"
        },
        "wrapPagesWithGlobalContexts": {
            "description": "Wether we should wrap the pages with the project global contexts or not",
            "type": "boolean"
        }
    },
    "required": [
        "code",
        "defaultPlasmicDir",
        "globalVariants",
        "images",
        "platform",
        "preserveJsImportExtensions",
        "projects",
        "srcDir",
        "style",
        "tokens",
        "wrapPagesWithGlobalContexts"
    ],
    "type": "object"
}

