code-inspector-plugin 0.1.0 → 0.1.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.
package/README.md CHANGED
@@ -89,16 +89,7 @@ pnpm add code-inspector-plugin -D
89
89
  });
90
90
  ```
91
91
 
92
- ### 2. 使用代码审查
93
-
94
- 目前使用代码审查功能的方式有两种:
95
-
96
- 1. 【推荐】同时持续按住组合键进行代码审查。 (Mac 系统默认组合键是 `Option + Shift`;Window 的默认组合键是 `Alt + Shift`)
97
- 2. 点击页面上的 Code Inspector 开关按钮。当开关的颜色变成彩色时,表示代码审查模式打开 <img src="https://github.com/zh-lx/code-inspector/assets/73059627/842c3e88-dca7-4743-854c-d61093d3d34f" width="20" />;当开关颜色变成黑白时,表示代码审查模式关闭 <img src="https://user-images.githubusercontent.com/73059627/230129864-e2813188-8d49-4a8e-a6bc-dda19c79b491.png" width="20" />。(Code Inspector 开关按钮 <img src="https://github.com/zh-lx/code-inspector/assets/73059627/842c3e88-dca7-4743-854c-d61093d3d34f" width="20" /> 默认隐藏,需要配置 `showSwitch: true` 才会在页面显示。)
98
-
99
- 当代码审查模式打开时,点击页面上的元素,将自动打开你的代码编辑器并将光标定位到元素对应的代码位置。
100
-
101
- ### 3. 配置命令行工具(仅当 Mac + Vscode 需要配置此步)
92
+ ### 2. 配置命令行工具(仅当 Mac + Vscode 需要配置此步)
102
93
 
103
94
  如果你的编辑器是 VSCode 且系统为 MacOS,需要进行如下配置:
104
95
 
@@ -110,6 +101,16 @@ pnpm add code-inspector-plugin -D
110
101
 
111
102
  <img src="https://s3.bmp.ovh/imgs/2021/08/c3d00a8efbb20feb.png" width="40%" />
112
103
 
104
+ ### 3. 使用代码审查
105
+
106
+ 目前使用代码审查功能的方式有两种:
107
+
108
+ 1. 【推荐】按住组合键时,即可进行代码审查。 (Mac 系统默认组合键是 `Option + Shift`;Window 的默认组合键是 `Alt + Shift`,浏览器控制台会输出相关提示)
109
+ ![image](https://github.com/zh-lx/code-inspector/assets/73059627/9b47c40f-6380-40d0-b0ec-4283d35a1f2d)
110
+ 2. 点击页面上的 Code Inspector 开关按钮。当开关的颜色变成彩色时,表示代码审查模式打开 <img src="https://github.com/zh-lx/code-inspector/assets/73059627/842c3e88-dca7-4743-854c-d61093d3d34f" width="20" />;当开关颜色变成黑白时,表示代码审查模式关闭 <img src="https://user-images.githubusercontent.com/73059627/230129864-e2813188-8d49-4a8e-a6bc-dda19c79b491.png" width="20" />。(Code Inspector 开关按钮 <img src="https://github.com/zh-lx/code-inspector/assets/73059627/842c3e88-dca7-4743-854c-d61093d3d34f" width="20" /> 默认隐藏,需要配置 `showSwitch: true` 才会在页面显示。)
111
+
112
+ 当代码审查模式打开时,点击页面上的元素,将自动打开你的代码编辑器并将光标定位到元素对应的代码位置。
113
+
113
114
  ## 🎨 可选配置
114
115
 
115
116
  | 参数 | 描述 | 是否必传 | 类型 | 可选值 | 默认值 |
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vite-code-inspector-plugin");function u(e){if(!(e!=null&&e.bundler)){console.error("Please specify the bundler in the options of CodeInspectorPlugin.");return}if(e.bundler==="webpack"){const r=require("webpack-code-inspector-plugin");return new r(e)}else return n.ViteCodeInspectorPlugin(e)}exports.CodeInspectorPlugin=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vite-code-inspector-plugin"),u=require("chalk");function c(e){if(!(e!=null&&e.bundler)){console.log(u.red("Please specify the bundler in the options of code-inspector-plugin."));return}if(e.bundler==="webpack"){const r=require("webpack-code-inspector-plugin");return new r(e)}else return n.ViteCodeInspectorPlugin(e)}exports.CodeInspectorPlugin=c;
package/dist/index.mjs CHANGED
@@ -1,8 +1,11 @@
1
1
  import { ViteCodeInspectorPlugin as n } from "vite-code-inspector-plugin";
2
- function c(e) {
2
+ import c from "chalk";
3
+ function t(e) {
3
4
  if (!(e != null && e.bundler)) {
4
- console.error(
5
- "Please specify the bundler in the options of CodeInspectorPlugin."
5
+ console.log(
6
+ c.red(
7
+ "Please specify the bundler in the options of code-inspector-plugin."
8
+ )
6
9
  );
7
10
  return;
8
11
  }
@@ -13,5 +16,5 @@ function c(e) {
13
16
  return n(e);
14
17
  }
15
18
  export {
16
- c as CodeInspectorPlugin
19
+ t as CodeInspectorPlugin
17
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-inspector-plugin",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./types/index.d.ts",
@@ -38,9 +38,10 @@
38
38
  "url": "https://github.com/zh-lx/code-inspector/issues"
39
39
  },
40
40
  "dependencies": {
41
- "vite-code-inspector-plugin": "0.1.0",
42
- "code-inspector-core": "0.1.0",
43
- "webpack-code-inspector-plugin": "0.1.0"
41
+ "chalk": "4.1.1",
42
+ "code-inspector-core": "0.1.2",
43
+ "vite-code-inspector-plugin": "0.1.2",
44
+ "webpack-code-inspector-plugin": "0.1.2"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@types/node": "^16.0.1",
package/types/index.d.ts CHANGED
@@ -1,15 +1,6 @@
1
- import type WebpackCodeInspectorPlugin from 'webpack-code-inspector-plugin/types/index';
2
- import { ViteCodeInspectorPlugin } from 'vite-code-inspector-plugin';
3
1
  import { CodeOptions } from 'code-inspector-core';
4
2
  export interface CodeInspectorPluginOptions extends CodeOptions {
5
- framework?: 'vue';
6
3
  bundler: 'vite' | 'webpack';
4
+ catch?: boolean;
7
5
  }
8
- export interface CodeInspectorPluginVite extends CodeInspectorPluginOptions {
9
- bundler: 'vite';
10
- }
11
- export interface CodeInspectorPluginWebpack extends CodeInspectorPluginOptions {
12
- bundler: 'webpack';
13
- }
14
- export declare function CodeInspectorPlugin(options: CodeInspectorPluginVite): ReturnType<typeof ViteCodeInspectorPlugin>;
15
- export declare function CodeInspectorPlugin(options: CodeInspectorPluginWebpack): WebpackCodeInspectorPlugin;
6
+ export declare function CodeInspectorPlugin(options: CodeInspectorPluginOptions): any;