{
  "title": "Factorio Mod info.json",
  "$schema": "https://json-schema.org/draft-07/schema",
  "allOf":[
    {
      "$ref": "datainfo.json"
    },
    {
      "type": "object",
      "required":[
        "name", "version", "title", "author", "factorio_version"
      ],
      "defaultSnippets": [
        {
            "label": "mod",
            "body": {
              "name": "$1",
              "title": "$2",
              "description": "$3",
              "version": "${4:0.0.0}",
              "author": "$5",
              "factorio_version": "2.1"
            }
        }
      ],
      "properties": {
        "factorio_version": {
          "default": "2.1"
        },
        "package": {
          "type":"object",
          "description": "Configuration for automatically packaging and publishing this mod [FMTK]",
          "properties": {
            "ignore":{
              "type":"array",
              "description": "Globs to ignore when building zip package",
              "items": {
                "type":"string",
                "format": "glob"
              }
            },
            "extra":{
              "type":"array",
              "description": "Directories containing extra files to include in the zip package",
              "items": {
                "type":"object",
                "required": ["root"],
                "properties":{
                  "root":{
                    "type":"string",
                    "description": "Directory containing extra files to include in the zip package"
                  },
                  "glob":{
                    "type":"string",
                    "description": "Glob for matching files to include from this directory",
                    "default": "**"
                  },
                  "ignore":{
                    "type":"array",
                    "description": "Globs to ignore in this root",
                    "items": {
                      "type":"string",
                      "format": "glob"
                    }
                  }
                }
              }
            },
            "gallery":{
              "type":"array",
              "description": "Globs to sync to gallery",
              "items": {
                "type":"string",
                "format": "glob"
              }
            },
            "prune_gallery": {
              "type":"boolean",
              "description": "Remove unreferenced images from gallery"
            },
            "readme": {
              "type":"string",
              "description": "Markdown file to be uploaded to the portal as long description"
            },
            "faq": {
              "type":"string",
              "description": "Markdown file to be uploaded to the portal as faq"
            },
            "markdown": {
              "type": "object",
              "description": "Options for transforming markdown files uploaded to the portal",
              "properties":{
                "strip_first_header": {
                  "type": "boolean",
                  "description": "Strip the first header",
                  "default": true
                },
                "images": {
                  "default": "gallery",
                  "enum": ["gallery", "url"]
                },
                "links": {
                  "default": "url",
                  "enum": ["url"]
                },
                "base_url": {
                  "type":"string",
                  "format": "uri",
                  "description": "Base url for `url` rewrites. If not set, links will not be rewritten."
                },
                "url_match": {
                  "type": "string",
                  "format": "regex",
                  "default": "^((http(s?)|data):|#)",
                  "description": "Urls matching this regex will *not* be rewritten"
                }
              }
            },
            "datestamp_format": {
              "type": "string",
              "description": "A format string for `datetime` to use when date stamping the changelog. See https://www.npmjs.com/package/dateformat. Named format `factorioDate` for 'dd. mm. yyyy' like factorio's changelog. Default `isoDate`.",
              "examples": [
                "isoDate",
                "factorioDate"
              ],
              "default": "isoDate"
            },
            "no_git_push": {
              "type":"boolean",
              "description": "Don't automatically `git push` in Publish"
            },
            "no_git_tag": {
              "type":"boolean",
              "description": "Don't automatically `git tag` in Publish"
            },
            "git_publish_branch": {
              "type":["string", "null"],
              "description": "Name of branch to Publish from. Defaults to the value of `git config init.defaultBranch` if not present. Set `null` to allow any branch."
            },
            "no_portal_upload": {
              "type":"boolean",
              "description": "Don't automatically upload to the mod portal in Publish"
            },
            "sync_portal_details": {
              "type":"boolean",
              "description": "Automatically update mod details and gallery in Publish"
            },
            "scripts":{
              "type":"object",
              "description": "Additional scripts to run while packaging/publishing mods",
              "additionalProperties": {
                "type":"string",
                "description": "Additional scripts to run with `fmtk run name`"
              },
              "properties": {
                "prepublish": {
                  "type":"string",
                  "description": "Command to run while preparing the pre-publish commit. Files added to git during this command will be included in that commit."
                },
                "datestamp": {
                  "type":"string",
                  "description": "Command to run after datestamping the changelog."
                },
                "prepackage": {
                  "type":"string",
                  "description": "Command to run while preparing the zip package. Files created/changed during this command will be included in the zip."
                },
                "version": {
                  "type":"string",
                  "description": "Command to run after incrementing the version."
                },
                "publish": {
                  "type":"string",
                  "description": "Command to run while preparing the post-publish commit, after incrementing the version. Files added to git during this command will be included in that commit."
                },
                "postpublish": {
                  "type":"string",
                  "description": "Command to run after automatic uploads."
                }
              }
            }
          }
        }
      }
    }
  ]
}
