diff --git a/.gitignore b/.gitignore index fca2f1dd6..36aa8d61c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ .DS_Store +#Visual Studio Code files +.vscode/* +!.vscode/launch.example.json + #Bundled files bundle/ diff --git a/.vscode/launch.example.json b/.vscode/launch.example.json new file mode 100644 index 000000000..f43818f11 --- /dev/null +++ b/.vscode/launch.example.json @@ -0,0 +1,50 @@ +{ + // Use IntelliSense to learn about possible Node.js debug attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Electron Main", + "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", + "program": "${workspaceRoot}/src/ts/main.ts", + "protocol": "inspector", + "sourceMaps": true, + "cwd": "${workspaceRoot}", + "outFiles": [ + "${workspaceRoot}/bundle/main.js" + ] + }, + { + "name": "Electron Renderer", + "type": "chrome", + "request": "launch", + "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", + "windows": { + "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd" + }, + "runtimeArgs": [ + "${workspaceRoot}/bundle/main.js", + "--remote-debugging-port=9222" + ], + "port": 9222, + "webRoot": "${workspaceRoot}" + }, + { + "type": "node", + "request": "launch", + "name": "Jest Tests", + "program": "${workspaceRoot}/node_modules/jest/bin/jest", + "args": [ + "--runInBand", + "--config", + "jest.json", + "src/tests" + ], + "console": "internalConsole", + "internalConsoleOptions": "neverOpen", + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index b63ae1806..7077a1acd 100644 --- a/README.md +++ b/README.md @@ -331,11 +331,9 @@ $ yarn start > For debugging you need Visual Studio Code -Run the app in one of these debug modes: - -* Electron Main -* Electron Renderer -* Jest tests +1. Go to `.vscode` folder +2. Make a copy of `launch.example.json` and rename it to `launch.json` +3. Select one of the preconfigured debug modes and start debugging ### Run tests