From 3793c734a8bab02e9d416b6948d75035a730e49f Mon Sep 17 00:00:00 2001 From: waiting <1661926154@qq.com> Date: Sun, 2 Jun 2019 16:52:34 +0800 Subject: [PATCH 1/2] chore(vsc): update settings.json --- hackernews-async-ts-di/.vscode/settings.json | 35 +++++++++++++++- hackernews-async-ts/.vscode/settings.json | 43 +++++++++++++++++++- 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/hackernews-async-ts-di/.vscode/settings.json b/hackernews-async-ts-di/.vscode/settings.json index db221e0..70074b4 100644 --- a/hackernews-async-ts-di/.vscode/settings.json +++ b/hackernews-async-ts-di/.vscode/settings.json @@ -5,9 +5,40 @@ "when": "$(basename).ts" }, "**/*.map": true, + "**/*.swp": true, + "**/.git": true, + "**/.DS_Store": true, + ".vscode": true, + ".git": true, + ".build": true, + ".githooks": true, + ".sourcemaps": true, "run": true, "logs": true, "out": true, - "node_modules": true - } + "node_modules": true, + "node_modules*": true, + "coverage": true, + "dist": true, + "platforms": true + }, + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/node_modules/**": true, + "**/node_modules*/**": true, + "coverage/**": true, + "dist/**": true + }, + "files.trimTrailingWhitespace": true, + "search.exclude": { + "**/node_modules": true, + ".vscode/**": true, + ".build/**": true, + "out/**": true, + "i18n/**": true + }, + "[markdown]": { + "files.trimTrailingWhitespace": false + }, + "typescript.format.enable": true } diff --git a/hackernews-async-ts/.vscode/settings.json b/hackernews-async-ts/.vscode/settings.json index 25fa621..70074b4 100644 --- a/hackernews-async-ts/.vscode/settings.json +++ b/hackernews-async-ts/.vscode/settings.json @@ -1,3 +1,44 @@ { - "typescript.tsdk": "node_modules/typescript/lib" + "files.exclude": { + "USE_GITIGNORE": true, + "**/*.js": { + "when": "$(basename).ts" + }, + "**/*.map": true, + "**/*.swp": true, + "**/.git": true, + "**/.DS_Store": true, + ".vscode": true, + ".git": true, + ".build": true, + ".githooks": true, + ".sourcemaps": true, + "run": true, + "logs": true, + "out": true, + "node_modules": true, + "node_modules*": true, + "coverage": true, + "dist": true, + "platforms": true + }, + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/node_modules/**": true, + "**/node_modules*/**": true, + "coverage/**": true, + "dist/**": true + }, + "files.trimTrailingWhitespace": true, + "search.exclude": { + "**/node_modules": true, + ".vscode/**": true, + ".build/**": true, + "out/**": true, + "i18n/**": true + }, + "[markdown]": { + "files.trimTrailingWhitespace": false + }, + "typescript.format.enable": true } From 2d3527740aa5273baba8a5c8370b7978289443a6 Mon Sep 17 00:00:00 2001 From: waiting <1661926154@qq.com> Date: Sun, 2 Jun 2019 17:05:53 +0800 Subject: [PATCH 2/2] feat(vsc): vscode debug with watching .ts file change 1. debug with vscode 2. background watching .ts file changes without additional running `tsc -w` 3. Ctrl+Shift+B to run build --- hackernews-async-ts-di/.vscode/launch.json | 34 +++++++++++++++ hackernews-async-ts-di/.vscode/tasks.json | 50 ++++++++++++++++++++++ hackernews-async-ts/.vscode/launch.json | 34 +++++++++++++++ hackernews-async-ts/.vscode/tasks.json | 50 ++++++++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 hackernews-async-ts-di/.vscode/launch.json create mode 100644 hackernews-async-ts-di/.vscode/tasks.json create mode 100644 hackernews-async-ts/.vscode/launch.json create mode 100644 hackernews-async-ts/.vscode/tasks.json diff --git a/hackernews-async-ts-di/.vscode/launch.json b/hackernews-async-ts-di/.vscode/launch.json new file mode 100644 index 0000000..893ddad --- /dev/null +++ b/hackernews-async-ts-di/.vscode/launch.json @@ -0,0 +1,34 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Egg Debug", + "type": "node", + "autoAttachChildProcesses": true, + "console": "integratedTerminal", + "env": { + "NODE_ENV": "local" + }, + "port": 9229, + "preLaunchTask": "watch", + "protocol": "auto", + "request": "launch", + "restart": true, + "runtimeArgs": [ + "run", + "debug", + "--", + "--inspect-brk" + ], + "runtimeExecutable": "npm", + "skipFiles": [ + // "${workspaceFolder}/node_modules/**/*.js", + "${workspaceFolder}/node_modules/rxjs/**/*.js", + "/**/*.js" + ] + } + ] +} diff --git a/hackernews-async-ts-di/.vscode/tasks.json b/hackernews-async-ts-di/.vscode/tasks.json new file mode 100644 index 0000000..95684c9 --- /dev/null +++ b/hackernews-async-ts-di/.vscode/tasks.json @@ -0,0 +1,50 @@ +{ + // 有关 tasks.json 格式的文档,请参见 + // https://go.microsoft.com/fwlink/?LinkId=733558 + "version": "2.0.0", + "tasks": [ + { + "label": "TypeScript compile", + "command": "tsc", + "args": [ + "-p", + "." + ], + "problemMatcher": [ + "$tsc" + ], + "type": "shell" + }, + { + "label": "watch", + "command": "tsc", + "args": [ + "-w", + "-p", + "." + ], + "isBackground": true, + "problemMatcher": [ + "$tsc-watch" + ], + "type": "shell" + }, + { + // Ctrl+Shift+B + "type": "npm", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "silent" + }, + "problemMatcher": [ + "$eslint-stylish", + "$tsc", + "$tslint5" + ], + "script": "build" + } + ] +} diff --git a/hackernews-async-ts/.vscode/launch.json b/hackernews-async-ts/.vscode/launch.json new file mode 100644 index 0000000..893ddad --- /dev/null +++ b/hackernews-async-ts/.vscode/launch.json @@ -0,0 +1,34 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Egg Debug", + "type": "node", + "autoAttachChildProcesses": true, + "console": "integratedTerminal", + "env": { + "NODE_ENV": "local" + }, + "port": 9229, + "preLaunchTask": "watch", + "protocol": "auto", + "request": "launch", + "restart": true, + "runtimeArgs": [ + "run", + "debug", + "--", + "--inspect-brk" + ], + "runtimeExecutable": "npm", + "skipFiles": [ + // "${workspaceFolder}/node_modules/**/*.js", + "${workspaceFolder}/node_modules/rxjs/**/*.js", + "/**/*.js" + ] + } + ] +} diff --git a/hackernews-async-ts/.vscode/tasks.json b/hackernews-async-ts/.vscode/tasks.json new file mode 100644 index 0000000..95684c9 --- /dev/null +++ b/hackernews-async-ts/.vscode/tasks.json @@ -0,0 +1,50 @@ +{ + // 有关 tasks.json 格式的文档,请参见 + // https://go.microsoft.com/fwlink/?LinkId=733558 + "version": "2.0.0", + "tasks": [ + { + "label": "TypeScript compile", + "command": "tsc", + "args": [ + "-p", + "." + ], + "problemMatcher": [ + "$tsc" + ], + "type": "shell" + }, + { + "label": "watch", + "command": "tsc", + "args": [ + "-w", + "-p", + "." + ], + "isBackground": true, + "problemMatcher": [ + "$tsc-watch" + ], + "type": "shell" + }, + { + // Ctrl+Shift+B + "type": "npm", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "silent" + }, + "problemMatcher": [ + "$eslint-stylish", + "$tsc", + "$tslint5" + ], + "script": "build" + } + ] +}