Skip to content

Commit

Permalink
Added Debug configuration for VSCode
Browse files Browse the repository at this point in the history
  • Loading branch information
oskardudycz committed Mar 19, 2021
1 parent 3469388 commit ecb4e32
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [EventSourcing.JS](#eventsourcingjs)
- [Samples](#samples)
- [NodeJS project configuration](#nodejs-project-configuration)
- [VSCode debug configuration](#vscode-debug-configuration)
- [Tasks List](#tasks-list)

## Samples
Expand Down Expand Up @@ -208,10 +209,35 @@
```json
{ "greeting": "Hello World!" }
```
### VSCode debug configuration
To configure VSCode debug you need to add [launch.json](./samples/simple/.vscode/launch.json) file in the [.vscode](./samples/simple/.vscode) folder.
To not need to synchronise two separate configurations, we'll reuse the existing NPM script `dev:start` that starts the application.
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "dev:start", "--", "--inspect-brk=9229"],
"port": 9229
}
]
}
```
As we have TypeScript configured, then we don't need any additional setup. We're reusing the native node debugging capabilities by using the `--inspect-brk=9229` parameter. Read more in the [Node.js documentation](https://nodejs.org/en/docs/guides/debugging-getting-started/)
## Tasks List
- [x] Initial ExpressJS boilerplate configuration [PR](https://github.com/oskardudycz/EventSourcing.JS/pull/1)
- [x] Add VSCode debugging configuration [PR](https://github.com/oskardudycz/EventSourcing.JS/pull/2)
- [ ] Add tests with Jest and Github Actions
- [ ] Start Live Coding on Twitch
- [ ] Add EventStoreDB gRPC client samples with basic streams operations
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eventsourcing.js",
"version": "1.0.0-alpha.1",
"version": "2.0.0",
"description": "Samples of Event Sourcing in JavaScript and TypeScript",
"scripts": {
"lint": "npm run lint:samples:simple",
Expand Down
13 changes: 13 additions & 0 deletions samples/simple/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "dev:start", "--", "--inspect-brk=9229"],
"port": 9229
}
]
}
3 changes: 2 additions & 1 deletion samples/simple/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},

"files.exclude": {
"node_modules/": true
"node_modules/": true,
"dist/": true
}
}

0 comments on commit ecb4e32

Please sign in to comment.