add attach debug configuration

- Attach debug configuration
- Scripts: debug, serve-debug, watch-debug
- Readme
This commit is contained in:
ThanhTDT 2017-07-27 21:09:17 +07:00
Родитель 26706d08d5
Коммит f8141a0b06
4 изменённых файлов: 16 добавлений и 3 удалений

6
.vscode/launch.json поставляемый
Просмотреть файл

@ -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",

Просмотреть файл

@ -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`.
> Tip! Instead of running `npm start`, using `npm run debug` and `Attach Configuration` that make you don't need to stop running project.
## 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 сгенерированный
Просмотреть файл

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

Просмотреть файл

@ -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"
}
}
}