code-inspector-plugin 0.6.1 → 0.6.2

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.
Files changed (2) hide show
  1. package/README.md +204 -16
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  <p align="center">
5
5
  <h2>code-inspector</h2>
6
- <span>English Doc</span> | <a href="https://github.com/zh-lx/code-inspector/blob/main/docs/README-ZH.md">中文文档</a> | <a href="https://inspector.fe-dev.cn/en">Read Docs for More</a>
6
+ <span>English Docs</span> | <a href="https://github.com/zh-lx/code-inspector/blob/main/docs/README-ZH.md">中文文档</a> | <a href="https://inspector.fe-dev.cn/en">Documentation Site</a>
7
7
  </p>
8
8
 
9
9
  [![NPM version](https://img.shields.io/npm/v/code-inspector-plugin.svg)](https://www.npmjs.com/package/code-inspector-plugin)
@@ -28,20 +28,6 @@ Click the element on the page, it can automatically open the code editor and pos
28
28
  - [solid online demo](https://stackblitz.com/edit/solidjs-templates-6u76jn?file=vite.config.ts)
29
29
  - [svelte online demo](https://stackblitz.com/edit/vitejs-vite-zoncqr?file=vite.config.ts)
30
30
 
31
- ## 🚀 Install
32
-
33
- ```perl
34
- npm i code-inspector-plugin -D
35
- # or
36
- yarn add code-inspector-plugin -D
37
- # or
38
- pnpm add code-inspector-plugin -D
39
- ```
40
-
41
- ## 🌈 Usage
42
-
43
- Please check here for complete access and usage information: [code-inspector-plugin configuration](https://en.inspector.fe-dev.cn/guide/start.html#configuration)
44
-
45
31
  ## 🎨 Support
46
32
 
47
33
  The following are which compilers, web frameworks and editors we supported now:
@@ -49,7 +35,8 @@ The following are which compilers, web frameworks and editors we supported now:
49
35
  - The following bundlers are currently supported:<br />
50
36
  ✅ webpack<br />
51
37
  ✅ vite<br />
52
- ✅ rspack
38
+ ✅ rspack<br />
39
+ ✅ nextjs / nuxt / umijs eg.<br />
53
40
  - The following Web frameworks are currently supported:<br />
54
41
  ✅ vue2<br />
55
42
  ✅ vue3<br />
@@ -60,6 +47,207 @@ The following are which compilers, web frameworks and editors we supported now:
60
47
  - The following code editors are currently supported:<br />
61
48
  [VSCode](https://code.visualstudio.com/) | [Visual Studio Code - Insiders](https://code.visualstudio.com/insiders/) | [WebStorm](https://www.jetbrains.com/webstorm/) | [Atom](https://atom.io/) | [HBuilderX](https://www.dcloud.io/hbuilderx.html) | [PhpStorm](https://www.jetbrains.com/phpstorm/) | [PyCharm](https://www.jetbrains.com/pycharm/) | [IntelliJ IDEA](https://www.jetbrains.com/idea/)
62
49
 
50
+ ## 🚀 Install
51
+
52
+ ```perl
53
+ npm i code-inspector-plugin -D
54
+ # or
55
+ yarn add code-inspector-plugin -D
56
+ # or
57
+ pnpm add code-inspector-plugin -D
58
+ ```
59
+
60
+ ## 🌈 Usage
61
+
62
+ Please check here for more usage information: [code-inspector-plugin configuration](https://en.inspector.fe-dev.cn/guide/start.html#configuration)
63
+
64
+ - 1.Configuring Build Tools
65
+
66
+ <details>
67
+ <summary>Click to expand configuration about: <b>webpack</b></summary>
68
+
69
+ ```js
70
+ // webpack.config.js
71
+ const { codeInspectorPlugin } = require('code-inspector-plugin');
72
+
73
+ module.exports = () => ({
74
+ plugins: [
75
+ codeInspectorPlugin({
76
+ bundler: 'webpack',
77
+ }),
78
+ ],
79
+ });
80
+ ```
81
+
82
+ </details>
83
+
84
+ <details>
85
+ <summary>Click to expand configuration about: <b>vite</b></summary>
86
+
87
+ ```js
88
+ // vite.config.js
89
+ import { defineConfig } from 'vite';
90
+ import { codeInspectorPlugin } from 'code-inspector-plugin';
91
+
92
+ export default defineConfig({
93
+ plugins: [
94
+ codeInspectorPlugin({
95
+ bundler: 'vite',
96
+ }),
97
+ ],
98
+ });
99
+ ```
100
+
101
+ </details>
102
+
103
+ <details>
104
+ <summary>Click to expand configuration about: <b>rspack</b></summary>
105
+
106
+ ```js
107
+ // rspack.config.js
108
+ const { codeInspectorPlugin } = require('code-inspector-plugin');
109
+
110
+ module.exports = {
111
+ // other config...
112
+ plugins: [
113
+ codeInspectorPlugin({
114
+ bundler: 'rspack',
115
+ }),
116
+ // other plugins...
117
+ ],
118
+ };
119
+ ```
120
+
121
+ </details>
122
+
123
+ <details>
124
+ <summary>Click to expand configuration about: <b>vue-cli</b></summary>
125
+
126
+ ```js
127
+ // vue.config.js
128
+ const { codeInspectorPlugin } = require('code-inspector-plugin');
129
+
130
+ module.exports = {
131
+ // ...other code
132
+ chainWebpack: (config) => {
133
+ config.plugin('code-inspector-plugin').use(
134
+ codeInspectorPlugin({
135
+ bundler: 'webpack',
136
+ })
137
+ );
138
+ },
139
+ };
140
+ ```
141
+
142
+ </details>
143
+
144
+ <details>
145
+ <summary>Click to expand configuration about: <b>nuxt</b></summary>
146
+
147
+ For nuxt3.x :
148
+
149
+ ```js
150
+ // nuxt.config.js
151
+ import { codeInspectorPlugin } from 'code-inspector-plugin';
152
+
153
+ // https://nuxt.com/docs/api/configuration/nuxt-config
154
+ export default defineNuxtConfig({
155
+ vite: {
156
+ plugins: [codeInspectorPlugin({ bundler: 'vite' })],
157
+ },
158
+ });
159
+ ```
160
+
161
+ For nuxt2.x :
162
+
163
+ ```js
164
+ // nuxt.config.js
165
+ import { codeInspectorPlugin } from 'code-inspector-plugin';
166
+
167
+ export default {
168
+ build: {
169
+ extend(config) {
170
+ config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }));
171
+ return config;
172
+ },
173
+ },
174
+ };
175
+ ```
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary>Click to expand configuration about: <b>next.js</b></summary>
181
+
182
+ ```js
183
+ // next.config.js
184
+ const { codeInspectorPlugin } = require('code-inspector-plugin');
185
+
186
+ const nextConfig = {
187
+ webpack: (config, { dev, isServer }) => {
188
+ config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }));
189
+ return config;
190
+ },
191
+ };
192
+
193
+ module.exports = nextConfig;
194
+ ```
195
+
196
+ </details>
197
+
198
+ <details>
199
+ <summary>Click to expand configuration about: <b>umi.js</b></summary>
200
+
201
+ ```js
202
+ // umi.config.js or umirc.js
203
+ import { defineConfig } from '@umijs/max';
204
+ import { codeInspectorPlugin } from 'code-inspector-plugin';
205
+
206
+ export default defineConfig({
207
+ chainWebpack(memo) {
208
+ memo.plugin('code-inspector-plugin').use(
209
+ codeInspectorPlugin({
210
+ bundler: 'webpack',
211
+ })
212
+ );
213
+ },
214
+ // other config
215
+ });
216
+ ```
217
+
218
+ </details>
219
+
220
+ - 2.Configuring VSCode Command Line Tool
221
+
222
+ > **Tip:** Skip for Windows or other IDEs <br />
223
+ > This step is only required for Mac with vscode as IDE. Skip this step if your computer is Windows or if you use another IDE.
224
+
225
+ In VSCode, press `command + shift + p`, search for and click `Shell Command: Install 'code' command in PATH`:
226
+
227
+ <img src="https://s3.bmp.ovh/imgs/2021/08/a99ec7b8e93f55fd.png" width="400px" />
228
+
229
+ If you see the dialog box below, the configuration was successful:
230
+
231
+ <img src="https://s3.bmp.ovh/imgs/2021/08/c3d00a8efbb20feb.png" width="300px" />
232
+
233
+ - 3.Enjoy using it
234
+
235
+ When pressing the combination keys on the page, moving the mouse over the page will display a mask layer on the DOM with relevant information. Clicking will automatically open the IDE and position the cursor to the corresponding code location. (The default combination keys for Mac are `Option + Shift`; for Windows, it's `Alt + Shift`, and the browser console will output related combination key prompts)
236
+
237
+ <img src="https://github.com/zh-lx/code-inspector/assets/73059627/a6c72278-d312-45b2-ab76-076a9837439e" width="700px" />
238
+
239
+ ## 👨‍💻 Contributors
240
+
241
+ Special thanks to the contributors of this project:<br />
242
+ <img src="https://contrib.rocks/image?repo=zh-lx/code-inspector" />
243
+
63
244
  ## 📧 Communication and Feedback
64
245
 
65
246
  For any usage issues, please leave a message below my [Twitter](https://twitter.com/zhulxing312147) post or [submit an issue](https://github.com/zh-lx/code-inspector/issues) on Github.
247
+
248
+ For Chinese users, you can you can join the QQ group `769748484` add the author's WeiXin account `zhoulx1688888` for consultation and feedback:
249
+
250
+ <div style="display: flex; column-gap: 16px; row-gap: 16px; flex-wrap: wrap;">
251
+ <img src="https://github.com/zh-lx/code-inspector/assets/73059627/6f0c8197-21e3-48d7-b9db-ffeb0e0d4ba7" width="200" height="272" />
252
+ <img src="https://github.com/zh-lx/code-inspector/assets/73059627/28ebb97a-a114-4598-a6f2-0e45103284cc" width="200" height="272" />
253
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-inspector-plugin",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./types/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "homepage": "https://inspector.fe-dev.cn/en",
27
- "description": "点击页面上的元素,将自动打开你的代码编辑器并将光标定位到元素对应的代码位置。",
27
+ "description": "Click the dom on the page, it will open your IDE and position the cursor to the source code location of the dom.",
28
28
  "keywords": [
29
29
  "webpack",
30
30
  "vite",
@@ -39,9 +39,9 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "chalk": "4.1.1",
42
- "code-inspector-core": "0.6.1",
43
- "webpack-code-inspector-plugin": "0.6.1",
44
- "vite-code-inspector-plugin": "0.6.1"
42
+ "code-inspector-core": "0.6.2",
43
+ "vite-code-inspector-plugin": "0.6.2",
44
+ "webpack-code-inspector-plugin": "0.6.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "^16.0.1",