1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-08 16:17:37 +00:00

Merge pull request #34 from thanhtdt/master

add attach debug configuration
This commit is contained in:
Bowden Kelly
2017-07-30 18:54:56 -07:00
committed by GitHub
4 changed files with 16 additions and 3 deletions

6
.vscode/launch.json vendored
View File

@@ -4,6 +4,12 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229
},
{
"type": "node",
"request": "launch",

View File

@@ -299,6 +299,11 @@ Now just set your breakpoints and go!
VS Code will try to launch on the same port and error out.
Likewise be sure to stop the debugger before returning to your normal `npm start` process.
#### Using attach debug configuration
VS Code debuggers also support attaching to an already running program. The `Attach` configuration has already configured, everything you need to do is change `Debug Configuration` to `Attach` and hit `F5`.
> Tips! Instead of running `npm start`, using `npm run debug` and `Attach Configuration` that make you don't need to stop running project to debug.
## Testing
For this project, I chose [Jest](https://facebook.github.io/jest/) as our test framework.
While Mocha is probably more common, Mocha seems to be looking for a new maintainer and setting up TypeScript testing in Jest is wicked simple.

1
package-lock.json generated
View File

@@ -2,7 +2,6 @@
"name": "express-typescript-starter",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/async": {
"version": "2.0.40",

View File

@@ -19,7 +19,10 @@
"build-sass": "node-sass src/public/css/main.scss dist/public/css/main.css",
"watch-sass": "node-sass -w src/public/css/main.scss dist/public/css/main.css",
"tslint": "tslint -c tslint.json -p tsconfig.json",
"copy-static-assets": "node copyStaticAssets.js"
"copy-static-assets": "node copyStaticAssets.js",
"debug": "npm run build && npm run watch-debug",
"serve-debug": "nodemon --inspect dist/server.js",
"watch-debug": "concurrently -k -p \"[{name}]\" -n \"Sass,TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run serve-debug\""
},
"jest": {
"globals": {
@@ -93,4 +96,4 @@
"tslint": "^5.0.0",
"typescript": "^2.4.0"
}
}
}