{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "npm",
            "script": "dev",
            "problemMatcher": [],
            "label": "dev server",
            "detail": "start local dev server",
            "presentation": {
                "reveal": "silent",
                "panel": "dedicated",
                "close": true,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiGreen",
                "id": "server-process"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "npm",
            "script": "dev:poa_core",
            "problemMatcher": [],
            "label": "dev server: poa",
            "detail": "start local dev server for POA network",
            "presentation": {
                "reveal": "silent",
                "panel": "dedicated",
                "close": true,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiMagenta",
                "id": "server-process"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "npm",
            "script": "dev:goerli",
            "problemMatcher": [],
            "label": "dev server: goerli",
            "detail": "start local dev server for Goerli network",
            "presentation": {
                "reveal": "silent",
                "panel": "dedicated",
                "close": true,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiMagenta",
                "id": "server-process"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "typescript",
            "label": "tsc build",
            "detail": "compile typescript",
            "tsconfig": "tsconfig.json",
            "problemMatcher": [
                "$tsc"
            ],
            "icon": {
                "color": "terminal.ansiCyan",
                "id": "symbol-type-parameter"
            },
            "presentation": {
                "reveal": "never",
                "panel": "dedicated",
                "close": true,
                "revealProblems": "onProblem",
            },
            "group": "build",
        },
        {
            "type": "npm",
            "script": "lint:eslint:fix",
            "problemMatcher": [],
            "label": "eslint",
            "detail": "run eslint",
            "presentation": {
                "reveal": "silent",
                "panel": "dedicated",
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiYellow",
                "id": "zap"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },

        // PW TESTS
        {
            "type": "shell",
            "command": "${input:pwDebugFlag} yarn test:pw:local ${relativeFileDirname}/${fileBasename} ${input:pwArgs}",
            "problemMatcher": [],
            "label": "pw: local",
            "detail": "run visual components tests for current file",
            "presentation": {
                "reveal": "always",
                "panel": "dedicated",
                "focus": true,
            },
            "icon": {
                "color": "terminal.ansiBlue",
                "id": "beaker"
            },
            "runOptions": {
                "instanceLimit": 1
            },
        },
        {
            "type": "shell",
            "command": "yarn test:pw:docker ${relativeFileDirname}/${fileBasename} ${input:pwArgs}",
            "problemMatcher": [],
            "label": "pw: docker",
            "detail": "run visual components tests for current file",
            "presentation": {
                "reveal": "always",
                "panel": "dedicated",
                "focus": true,
            },
            "icon": {
                "color": "terminal.ansiBlue",
                "id": "beaker"
            },
            "runOptions": {
                "instanceLimit": 1
            },
        },
        {
            "type": "shell",
            "command": "yarn test:pw:docker ${input:pwArgs}",
            "problemMatcher": [],
            "label": "pw: docker all",
            "detail": "run visual components tests",
            "presentation": {
                "reveal": "always",
                "panel": "dedicated",
                "focus": true,
            },
            "icon": {
                "color": "terminal.ansiBlue",
                "id": "beaker"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },

        // JEST TESTS
        {
            "type": "npm",
            "script": "test:jest",
            "problemMatcher": [],
            "label": "jest",
            "detail": "run jest tests",
            "presentation": {
                "reveal": "always",
                "panel": "dedicated",
                "focus": true,
            },
            "icon": {
                "color": "terminal.ansiBlue",
                "id": "beaker"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "npm",
            "script": "test:jest:watch",
            "problemMatcher": [],
            "label": "jest: watch all",
            "detail": "run jest tests in watch mode",
            "presentation": {
                "reveal": "always",
                "panel": "dedicated",
                "close": true,
                "focus": true,
            },
            "icon": {
                "color": "terminal.ansiBlue",
                "id": "beaker"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "shell",
            "command": "yarn test:jest ${relativeFileDirname}/${fileBasename} --watch",
            "problemMatcher": [],
            "label": "jest: watch",
            "detail": "run jest tests in watch mode for current file",
            "presentation": {
                "reveal": "always",
                "panel": "dedicated",
                "focus": true,
            },
            "icon": {
                "color": "terminal.ansiBlue",
                "id": "beaker"
            },
            "runOptions": {
                "instanceLimit": 1
            },
        },

        {
            "type": "npm",
            "script": "build:docker",
            "problemMatcher": [],
            "label": "docker: build",
            "detail": "build docker image",
            "presentation": {
                "reveal": "always",
                "panel": "dedicated",
                "close": true,
                "revealProblems": "onProblem",
                "focus": true,
            },
            "icon": {
                "color": "terminal.ansiRed",
                "id": "symbol-structure"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "npm",
            "script": "start:docker:poa_core",
            "problemMatcher": [],
            "label": "docker: run poa",
            "detail": "run docker container for POA network",
            "presentation": {
                "reveal": "silent",
                "panel": "dedicated",
                "close": true,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiRed",
                "id": "browser"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "npm",
            "script": "format-svg",
            "problemMatcher": [],
            "label": "format svg",
            "detail": "format svg files with svgo",
            "presentation": {
                "reveal": "silent",
                "panel": "dedicated",
                "close": true,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiCyan",
                "id": "combine"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
    ],
    "inputs": [
        {
            "type": "pickString",
            "id": "pwDebugFlag",
            "description": "What debug flag you want to use?",
            "options": [
              "",
              "PWDEBUG=1",
              "DEBUG=pw:browser,pw:api",
              "DEBUG=*",
            ],
            "default": ""
        },
        {
            "type": "pickString",
            "id": "pwArgs",
            "description": "What args you want to pass?",
            "options": [
              "",
              "--update-snapshots",
            ],
            "default": ""
        },
    ],
}