{
    // 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": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "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": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiMagenta",
                "id": "server-process"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "shell",
            "command": "NEXT_PUBLIC_API_HOST=${input:goerliApiHost} yarn dev:goerli",
            "problemMatcher": [],
            "label": "dev server: goerli",
            "detail": "start local dev server for Goerli network",
            "presentation": {
                "reveal": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiMagenta",
                "id": "server-process"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "shell",
            "command": "NEXT_PUBLIC_L1_BASE_URL=https://${input:goerliApiHost} yarn dev:goerli:optimism",
            "problemMatcher": [],
            "label": "dev server: goerli optimism",
            "detail": "start local dev server for Goerli Optimism network",
            "presentation": {
                "reveal": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "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": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "group": "build",
        },
        {
            "type": "npm",
            "script": "lint:eslint:fix",
            "problemMatcher": [],
            "label": "eslint",
            "detail": "run eslint",
            "presentation": {
                "reveal": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "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": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "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": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "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": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiBlue",
                "id": "beaker"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },
        {
            "type": "shell",
            "command": "npx playwright show-report",
            "problemMatcher": [],
            "label": "pw: report",
            "detail": "serve test report",
            "presentation": {
                "reveal": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "icon": {
                "color": "terminal.ansiBlue",
                "id": "output"
            },
            "runOptions": {
                "instanceLimit": 1
            }
        },

        // JEST TESTS
        {
            "type": "npm",
            "script": "test:jest",
            "problemMatcher": [],
            "label": "jest",
            "detail": "run jest tests",
            "presentation": {
                "reveal": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "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": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "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": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "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": "shared",
                "focus": true,
                "close": false,
                "revealProblems": "onProblem",
            },
            "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": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "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": "always",
                "panel": "shared",
                "focus": true,
                "close": false,
                "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",
              "--ui",
            ],
            "default": ""
        },
        {
            "type": "pickString",
            "id": "goerliApiHost",
            "description": "Choose API host:",
            "options": [
              "blockscout-main.test.aws-k8s.blockscout.com",
              "eth-goerli.blockscout.com",
            ],
            "default": ""
        },
    ],
}