@tomjs/vite-plugin-vscode 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -5
- package/README.zh_CN.md +19 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
> The [vite](https://cn.vitejs.dev/) plugin for [vscode extension](https://code.visualstudio.com/api), supports `esm` and `cjs`.
|
|
8
8
|
|
|
9
|
-
Inject [@tomjs/vscode-extension-webview](https://github.com/
|
|
9
|
+
Inject [@tomjs/vscode-extension-webview](https://github.com/tomjs/vscode-extension-webview) into vscode extension code and web client code, so that webview can support HMR during the development stage.
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ yarn add @tomjs/vite-plugin-vscode -D
|
|
|
29
29
|
npm i @tomjs/vite-plugin-vscode --save-dev
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
If you use `pnpm` and enable `webview` debugging, you need to additionally install the dependency [@tomjs/vscode-extension-webview](https://github.com/
|
|
32
|
+
If you use `pnpm` and enable `webview` debugging, you need to additionally install the dependency [@tomjs/vscode-extension-webview](https://github.com/tomjs/vscode-extension-webview)
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
pnpm add @tomjs/vscode-extension-webview -D
|
|
@@ -189,7 +189,7 @@ export default defineConfig({
|
|
|
189
189
|
| --- | --- | --- | --- |
|
|
190
190
|
| recommended | `boolean` | `true` | This option is intended to provide recommended default parameters and behavior. |
|
|
191
191
|
| extension | [ExtensionOptions](#ExtensionOptions) | | Configuration options for the vscode extension. |
|
|
192
|
-
| webview | `boolean` | `false` | Inject [@tomjs/vscode-extension-webview](https://github.com/
|
|
192
|
+
| webview | `boolean` | `false` | Inject [@tomjs/vscode-extension-webview](https://github.com/tomjs/vscode-extension-webview) into vscode extension code and web client code, so that webview can support HMR during the development stage. |
|
|
193
193
|
|
|
194
194
|
**Notice**
|
|
195
195
|
|
|
@@ -229,7 +229,7 @@ Based on [Options](https://paka.dev/npm/tsup) of [tsup](https://tsup.egoist.dev/
|
|
|
229
229
|
|
|
230
230
|
## Debug
|
|
231
231
|
|
|
232
|
-
Run `
|
|
232
|
+
Run `Debug Extension` through `vscode` to debug. For debugging tools, refer to [Official Documentation](https://code.visualstudio.com/docs/editor/debugging)
|
|
233
233
|
|
|
234
234
|
`launch.json` is configured as follows:
|
|
235
235
|
|
|
@@ -238,7 +238,7 @@ Run `Run Extension` through `vscode` to debug. For debugging tools, refer to [Of
|
|
|
238
238
|
"version": "0.2.0",
|
|
239
239
|
"configurations": [
|
|
240
240
|
{
|
|
241
|
-
"name": "
|
|
241
|
+
"name": "Debug Extension",
|
|
242
242
|
"type": "extensionHost",
|
|
243
243
|
"request": "launch",
|
|
244
244
|
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
|
|
@@ -287,3 +287,17 @@ Run `Run Extension` through `vscode` to debug. For debugging tools, refer to [Of
|
|
|
287
287
|
]
|
|
288
288
|
}
|
|
289
289
|
```
|
|
290
|
+
|
|
291
|
+
## Examples
|
|
292
|
+
|
|
293
|
+
First execute the following command to install dependencies and generate library files:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
pnpm install
|
|
297
|
+
pnpm build
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Open the [examples](./examples) directory, there are `vue` and `react` examples.
|
|
301
|
+
|
|
302
|
+
- [react](./examples/react)
|
|
303
|
+
- [vue](./examples/vue)
|
package/README.zh_CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
> [vscode extension](https://code.visualstudio.com/api) 的 [vite](https://cn.vitejs.dev/) 插件,支持 `esm` 和 `cjs`。
|
|
8
8
|
|
|
9
|
-
给 vscode 扩展代码和 web 客户端代码中注入 [@tomjs/vscode-extension-webview](https://github.com/
|
|
9
|
+
给 vscode 扩展代码和 web 客户端代码中注入 [@tomjs/vscode-extension-webview](https://github.com/tomjs/vscode-extension-webview),可以让 webview 在开发阶段支持 `HMR`
|
|
10
10
|
|
|
11
11
|
## 特性
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ yarn add @tomjs/vite-plugin-vscode -D
|
|
|
29
29
|
npm i @tomjs/vite-plugin-vscode --save-dev
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
如果使用 `pnpm` 且开启 `webview` 调试,需要额外安装[@tomjs/vscode-extension-webview](https://github.com/
|
|
32
|
+
如果使用 `pnpm` 且开启 `webview` 调试,需要额外安装[@tomjs/vscode-extension-webview](https://github.com/tomjs/vscode-extension-webview) 这个依赖
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
pnpm add @tomjs/vscode-extension-webview -D
|
|
@@ -189,7 +189,7 @@ export default defineConfig({
|
|
|
189
189
|
| --- | --- | --- | --- |
|
|
190
190
|
| recommended | `boolean` | `true` | 这个选项是为了提供推荐的默认参数和行为 |
|
|
191
191
|
| extension | [ExtensionOptions](#ExtensionOptions) | | vscode extension 可选配置 |
|
|
192
|
-
| webview | `boolean` | `false` | 在vscode扩展代码和Web客户端代码中注入[@tomjs/vscode-extension-webview](https://github.com/
|
|
192
|
+
| webview | `boolean` | `false` | 在vscode扩展代码和Web客户端代码中注入[@tomjs/vscode-extension-webview](https://github.com/tomjs/vscode-extension-webview),以便webview在开发阶段可以支持HMR。 |
|
|
193
193
|
|
|
194
194
|
**Notice**
|
|
195
195
|
|
|
@@ -228,7 +228,7 @@ export default defineConfig({
|
|
|
228
228
|
|
|
229
229
|
## Debug
|
|
230
230
|
|
|
231
|
-
通过 `vscode` 运行 `
|
|
231
|
+
通过 `vscode` 运行 `Debug Extension` 调试,调试工具参考 [官方文档](https://code.visualstudio.com/docs/editor/debugging)
|
|
232
232
|
|
|
233
233
|
`launch.json` 配置如下:
|
|
234
234
|
|
|
@@ -237,7 +237,7 @@ export default defineConfig({
|
|
|
237
237
|
"version": "0.2.0",
|
|
238
238
|
"configurations": [
|
|
239
239
|
{
|
|
240
|
-
"name": "
|
|
240
|
+
"name": "Debug Extension",
|
|
241
241
|
"type": "extensionHost",
|
|
242
242
|
"request": "launch",
|
|
243
243
|
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
|
|
@@ -286,3 +286,17 @@ export default defineConfig({
|
|
|
286
286
|
]
|
|
287
287
|
}
|
|
288
288
|
```
|
|
289
|
+
|
|
290
|
+
## 示例
|
|
291
|
+
|
|
292
|
+
先执行以下命令安装依赖,并生成库文件:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
pnpm install
|
|
296
|
+
pnpm build
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
打开 [examples](./examples) 目录,有 `vue` 和 `react` 示例。
|
|
300
|
+
|
|
301
|
+
- [react](./examples/react)
|
|
302
|
+
- [vue](./examples/vue)
|
package/dist/index.d.mts
CHANGED
|
@@ -37,7 +37,7 @@ interface PluginOptions {
|
|
|
37
37
|
*/
|
|
38
38
|
recommended?: boolean;
|
|
39
39
|
/**
|
|
40
|
-
* Inject [@tomjs/vscode-extension-webview](https://github.com/
|
|
40
|
+
* Inject [@tomjs/vscode-extension-webview](https://github.com/tomjs/vscode-extension-webview) into vscode extension code and web client code, so that webview can support HMR during the development stage.
|
|
41
41
|
*
|
|
42
42
|
* * extension: Inject `import getDevWebviewHtml from '@tomjs/vscode-extension-webview';` above the file that calls the `getDevWebviewHtml` method
|
|
43
43
|
* * web: Add `<script>` tag to index.html and inject `@tomjs/vscode-extension-webview/client` code
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ interface PluginOptions {
|
|
|
37
37
|
*/
|
|
38
38
|
recommended?: boolean;
|
|
39
39
|
/**
|
|
40
|
-
* Inject [@tomjs/vscode-extension-webview](https://github.com/
|
|
40
|
+
* Inject [@tomjs/vscode-extension-webview](https://github.com/tomjs/vscode-extension-webview) into vscode extension code and web client code, so that webview can support HMR during the development stage.
|
|
41
41
|
*
|
|
42
42
|
* * extension: Inject `import getDevWebviewHtml from '@tomjs/vscode-extension-webview';` above the file that calls the `getDevWebviewHtml` method
|
|
43
43
|
* * web: Add `<script>` tag to index.html and inject `@tomjs/vscode-extension-webview/client` code
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/vite-plugin-vscode",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "The vite plugin for vscode extension, supports esm and cjs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
41
|
-
"url": "git+https://github.com/
|
|
41
|
+
"url": "git+https://github.com/tomjs/vite-plugin-vscode.git"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@tomjs/vscode-extension-webview": "^1.0.
|
|
44
|
+
"@tomjs/vscode-extension-webview": "^1.0.3",
|
|
45
45
|
"dayjs": "^1.11.10",
|
|
46
46
|
"kolorist": "^1.8.0",
|
|
47
47
|
"lodash.clonedeep": "^4.5.0",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@commitlint/cli": "^18.4.3",
|
|
53
|
-
"@tomjs/commitlint": "^2.
|
|
54
|
-
"@tomjs/eslint": "^1.1
|
|
55
|
-
"@tomjs/prettier": "^1.
|
|
56
|
-
"@tomjs/stylelint": "^2.
|
|
57
|
-
"@tomjs/tsconfig": "^1.1
|
|
53
|
+
"@tomjs/commitlint": "^2.1.1",
|
|
54
|
+
"@tomjs/eslint": "^1.2.1",
|
|
55
|
+
"@tomjs/prettier": "^1.1.1",
|
|
56
|
+
"@tomjs/stylelint": "^2.1.1",
|
|
57
|
+
"@tomjs/tsconfig": "^1.2.1",
|
|
58
58
|
"@types/lodash.clonedeep": "^4.5.9",
|
|
59
59
|
"@types/lodash.merge": "^4.6.9",
|
|
60
60
|
"@types/node": "^18.19.3",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"prettier": "^3.1.1",
|
|
68
68
|
"rimraf": "^5.0.5",
|
|
69
69
|
"stylelint": "^16.0.2",
|
|
70
|
-
"tsx": "^4.
|
|
70
|
+
"tsx": "^4.7.0",
|
|
71
71
|
"typescript": "~5.3.3"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|