-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
110 changed files
with
3,992 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# Change Log | ||
|
||
## 0.4.4 | ||
- feat: add Iceworks debug. | ||
|
||
## 0.4.3 | ||
|
||
- fix: build error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Iceworks Debug | ||
|
||
[简体中文]((./debug.md)) | English | ||
|
||
Use VS Code and Chrome to debug the source code. | ||
|
||
![debug-demo](https://img.alicdn.com/tfs/TB1vCixhP39YK4jSZPcXXXrUFXa-1200-695.gif) | ||
|
||
Click the debug button in the upper right corner of the file to start debugging. Will insert .vscode/launch.json and .vscode/tasks.json in your project directory, and start VS Code Debug. | ||
|
||
PS: You can add the .vscode directory to the .gitignore config. | ||
|
||
## launch.json | ||
|
||
It is automatically injected by Iceworks and is a standard VS Code debugging configuration. For more configuration, please refer to [VS Code debug document](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations). | ||
|
||
The default config is as follows: | ||
|
||
```json | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "chrome", // Use 'Debugger for Chrome' preview. | ||
"request": "launch", // Debugging will start a new Chrome instance, replace 'attach' can select the current Chrome instance, but Chrome needs to be restarted | ||
"name": "Iceworks Debug", | ||
"url": "http://localhost:3333", // Project debugging service address | ||
"urlFilter": "http://localhost:3333/**/*", // Monitor all URLs of the project debugging service | ||
"webRoot": "${workspaceFolder}", | ||
"userDataDir": "${workspaceFolder}/.vscode/chrome-debug-user-data", // Used to save Chrome user data (such as installed browser extensions) | ||
"preLaunchTask": "Iceworks Start Background Tasks", | ||
"postDebugTask": "Iceworks Stop Background Tasks" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## tasks.json | ||
|
||
It is automatically injected by Iceworks and is a standard VS Code debugging configuration. For more configuration, please refer to [VS Code tasks document]( https://code.visualstudio.com/docs/editor/tasks#vscode). | ||
|
||
The default config is as follows: | ||
|
||
```json | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Iceworks Start Background Tasks", | ||
"type": "npm", | ||
"script": "start", | ||
"isBackground": true, | ||
"problemMatcher": { | ||
"pattern": { | ||
"regexp": "ERROR in .*" // build-scirpt log | ||
}, | ||
"background": { | ||
"beginsPattern": ".*(@alib/build-scripts|ice\\.js|rax\\.js).*", // build-scirpt log | ||
"endsPattern": ".*http://localhost:3333.*" // build-scirpt log | ||
} | ||
} | ||
}, | ||
{ | ||
"label": "Iceworks Stop Background Tasks", | ||
"type": "process", | ||
"command": [ | ||
"${command:workbench.action.tasks.terminate}", // VS Code built-in command | ||
"${command:workbench.action.acceptSelectedQuickOpenItem}" // VS Code built-in command | ||
] | ||
} | ||
] | ||
} | ||
|
||
``` | ||
|
||
## Change dev url | ||
If the project dev url is not `http://localhost:3333`, you can modify the url address configured by `url` and `urlFilter` in launch.json, and `endsPattern` in tasks.json with the new dev url. | ||
|
||
## Chrome | ||
|
||
A new instance of Chrome is opened for debugging. The first time you start Chrome without data (no user mode, no extensions), the data operated during the debugging process will be saved (history, installed extensions ...). | ||
|
||
Rax project,Recommended to install [Guan Extension](https://chrome.google.com/webstore/detail/guan-extension/jfalnandddhgfnmejfgjgfbfnnkhljog)。 | ||
|
||
If you want to use your own Chrome, you can switch the request configuration in launch.json to `attach`. You must close the current Chrome. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Iceworks Debug | ||
|
||
简体中文 | [English](./debug.en.md) | ||
|
||
使用 VS Code 和 Chrome 对源码进行调试。 | ||
|
||
![debug-demo](https://img.alicdn.com/tfs/TB1vCixhP39YK4jSZPcXXXrUFXa-1200-695.gif) | ||
|
||
点击文件右上角的 debug 按钮启动调试。 会在您的工程目录中插入 .vscode/launch.json 和 .vscode/tasks.json ,并启动 VS Code Debug。 | ||
|
||
PS: 可将 .vscode 目录添加至 .gitignore 配置中。 | ||
|
||
## launch.json | ||
|
||
由 Iceworks 自动注入,为标准的 VS Code 调试配置。更多配置可参考 [VS Code debug 文档](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations)。默认配置如下: | ||
|
||
```json | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "chrome", // 通过 'Debugger for Chrome' 扩展启动 Chrome 预览。 | ||
"request": "launch", // 调试会启动新的 Chrome 实例,替换 attach 可选取当前 Chrome 实例,但需要重启 Chrome。 | ||
"name": "Iceworks Debug", | ||
"url": "http://localhost:3333", // 当前工程调试服务地址 | ||
"urlFilter": "http://localhost:3333/**/*", // 监听当前工程调试服务所有的 url | ||
"webRoot": "${workspaceFolder}", | ||
"userDataDir": "${workspaceFolder}/.vscode/chrome-debug-user-data", // 用于存放 Chrome 的用户数据(安装的浏览器插件等) | ||
"preLaunchTask": "Iceworks Start Background Tasks", | ||
"postDebugTask": "Iceworks Stop Background Tasks" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## tasks.json | ||
|
||
由 Iceworks 自动注入,为标准的 VS Code 调试配置。更多配置可参考 [VS Code tasks 文档]( https://code.visualstudio.com/docs/editor/tasks#vscode)。默认配置如下: | ||
|
||
```json | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Iceworks Start Background Tasks", | ||
"type": "npm", | ||
"script": "start", | ||
"isBackground": true, | ||
"problemMatcher": { | ||
"pattern": { | ||
"regexp": "ERROR in .*" // build-scirpt 日志 | ||
}, | ||
"background": { | ||
"beginsPattern": ".*(@alib/build-scripts|ice\\.js|rax\\.js).*", // build-scirpt 日志 | ||
"endsPattern": ".*http://localhost:3333.*" // build-scirpt 日志 | ||
} | ||
} | ||
}, | ||
{ | ||
"label": "Iceworks Stop Background Tasks", | ||
"type": "process", | ||
"command": [ | ||
"${command:workbench.action.tasks.terminate}", // VS Code 内置命令 | ||
"${command:workbench.action.acceptSelectedQuickOpenItem}" // VS Code 内置命令 | ||
] | ||
} | ||
] | ||
} | ||
|
||
``` | ||
|
||
## 更改端口号 | ||
若需要 debug 的工程调试链接不为 `http://localhost:3333` 时,可以修改 launch.json 中的 `url` 和 `urlFilter` 配置的地址链接,以及 tasks.json 中的 `endsPattern` 为新的调试地址即可。 | ||
|
||
## Chrome 实例 | ||
|
||
默认开启新的 Chrome 实例进行调试。首次启动为无数据 Chrome (无用户态,无插件),在调试过程操作的数据将得以保存(历史,安装插件等)。 | ||
|
||
Rax 项目,推荐安装 [Guan Extension](https://chrome.google.com/webstore/detail/guan-extension/jfalnandddhgfnmejfgjgfbfnnkhljog)。 | ||
|
||
### 其他 | ||
|
||
如果想使用常用登录态的 Chrome 进行提示,可切换 launch.json 中的 request 配置为 `attach`,且必须关闭当前 Chrome。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.