diff --git a/README.md b/README.md
index 22133f8..db3796b 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,18 @@
![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)
+## 💻 在线体验
+
+vue online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
+react online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
## 🚀 安装
```perl
diff --git a/docs/README-EN.md b/docs/README-EN.md
index b32763a..f26f03a 100644
--- a/docs/README-EN.md
+++ b/docs/README-EN.md
@@ -21,6 +21,18 @@ Click the element on the page, it can automatically open the code editor and pos
![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)
+## 💻 Try it out online
+
+vue online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
+react online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
## 🚀 Install
```perl
diff --git a/docs/en/more/changelog.md b/docs/en/more/changelog.md
index c43c1b3..453c5ca 100644
--- a/docs/en/more/changelog.md
+++ b/docs/en/more/changelog.md
@@ -1,5 +1,9 @@
# Changelog
+## 0.1.12
+
+- 【feat】Add parameters: `hideConsole` and `editor`
+
## 0.1.11
- 【optimize】Optimize dependencies version
diff --git a/docs/zh/more/changelog.md b/docs/zh/more/changelog.md
index ecd920c..162dd08 100644
--- a/docs/zh/more/changelog.md
+++ b/docs/zh/more/changelog.md
@@ -1,5 +1,9 @@
# 更新日志
+## 0.1.12
+
+- 【feat】增加 `hideConsole` 和 `editor` 参数
+
## 0.1.11
- 【optimize】优化依赖项版本
diff --git a/packages/code-inspector-plugin/README.md b/packages/code-inspector-plugin/README.md
index 35e0621..0087651 100644
--- a/packages/code-inspector-plugin/README.md
+++ b/packages/code-inspector-plugin/README.md
@@ -22,6 +22,18 @@
![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)
+## 💻 在线体验
+
+vue online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
+react online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
## 🚀 安装
```perl
diff --git a/packages/code-inspector-plugin/package.json b/packages/code-inspector-plugin/package.json
index a96766e..b5caea1 100644
--- a/packages/code-inspector-plugin/package.json
+++ b/packages/code-inspector-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "code-inspector-plugin",
- "version": "0.1.11",
+ "version": "0.1.12",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"typings": "./types/index.d.ts",
diff --git a/packages/core/README.md b/packages/core/README.md
index 35e0621..0087651 100644
--- a/packages/core/README.md
+++ b/packages/core/README.md
@@ -22,6 +22,18 @@
![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)
+## 💻 在线体验
+
+vue online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
+react online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
## 🚀 安装
```perl
diff --git a/packages/core/package.json b/packages/core/package.json
index 9329705..11ed0cf 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -1,6 +1,6 @@
{
"name": "code-inspector-core",
- "version": "0.1.11",
+ "version": "0.1.12",
"main": "dist/index.js",
"module": "./dist/index.mjs",
"types": "types/index.d.ts",
diff --git a/packages/core/src/server/launch-editor.ts b/packages/core/src/server/launch-editor.ts
index a2885f0..2cb6508 100644
--- a/packages/core/src/server/launch-editor.ts
+++ b/packages/core/src/server/launch-editor.ts
@@ -249,7 +249,7 @@ function guessEditor(_editor?: Editor) {
// vite
const envPath = path.resolve(process.cwd(), '.env.local');
- if (fs.existsSync(envPath)) {
+ if (fs.existsSync(envPath) && !customEditors) {
const envFile = fs.readFileSync(envPath, 'utf-8');
const envConfig = dotenv.parse(envFile || '');
if (envConfig.CODE_EDITOR) {
@@ -262,9 +262,9 @@ function guessEditor(_editor?: Editor) {
}
}
- if(_editor) {
+ if (_editor && !customEditors) {
const editor = getEditorByCustom(_editor);
- if(editor) {
+ if (editor) {
customEditors = editor;
}
}
@@ -282,7 +282,6 @@ function guessEditor(_editor?: Editor) {
const processName = processNames[i] as keyof typeof COMMON_EDITORS_OSX;
if (output.indexOf(processName) !== -1) {
if (customEditors?.includes(processName)) {
-
// 优先返回用户自定义
return [COMMON_EDITORS_OSX[processName]];
}
@@ -373,7 +372,7 @@ function printInstructions(fileName: any, errorMessage: string | any[] | null) {
chalk.green('.env.local') +
' file in your project folder,' +
' or add ' +
- chalk.green('editor: \"code\"') +
+ chalk.green('editor: "code"') +
' to CodeInspectorPlugin config, ' +
'and then restart the development server. Learn more: ' +
chalk.green('https://goo.gl/MMTaZt')
@@ -395,7 +394,7 @@ function launchEditor(
fileName: string,
lineNumber: unknown,
colNumber: unknown,
- _editor?: Editor,
+ _editor?: Editor
) {
if (!fs.existsSync(fileName)) {
return;
@@ -426,7 +425,7 @@ function launchEditor(
chalk.green('.env.local') +
' file in your project folder,' +
' or add ' +
- chalk.green('editor: \"code\"') +
+ chalk.green('editor: "code"') +
' to CodeInspectorPlugin config, ' +
'and then restart the development server. Learn more: ' +
chalk.green('https://goo.gl/MMTaZt')
diff --git a/packages/core/types/client/index.d.ts b/packages/core/types/client/index.d.ts
index 47e0d04..dd4fe3f 100644
--- a/packages/core/types/client/index.d.ts
+++ b/packages/core/types/client/index.d.ts
@@ -4,6 +4,7 @@ export declare class MyElement extends LitElement {
port: number;
showSwitch: boolean;
autoToggle: boolean;
+ hideConsole: boolean;
position: {
top: number;
left: number;
diff --git a/packages/core/types/index.d.ts b/packages/core/types/index.d.ts
index 0410882..f6d1ddd 100644
--- a/packages/core/types/index.d.ts
+++ b/packages/core/types/index.d.ts
@@ -11,6 +11,11 @@ export type CodeOptions = {
* @en Whether show the switch button of this function on the page
*/
showSwitch?: boolean;
+ /**
+ * @cn 是否隐藏在控制台的按键提示
+ * @en Whether hide the tips of combination keys on console.
+ */
+ hideConsole?: boolean;
/**
* @cn 打开功能开关的情况下,点击触发跳转编辑器时是否自动关闭开关
* @en When opening the function switch, whether automatically close the switch when triggering the jump editor function.
diff --git a/packages/vite-plugin/README.md b/packages/vite-plugin/README.md
index 35e0621..0087651 100644
--- a/packages/vite-plugin/README.md
+++ b/packages/vite-plugin/README.md
@@ -22,6 +22,18 @@
![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)
+## 💻 在线体验
+
+vue online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
+react online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
## 🚀 安装
```perl
diff --git a/packages/vite-plugin/package.json b/packages/vite-plugin/package.json
index dc085f5..fc64498 100644
--- a/packages/vite-plugin/package.json
+++ b/packages/vite-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "vite-code-inspector-plugin",
- "version": "0.1.11",
+ "version": "0.1.12",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"typings": "./types/index.d.ts",
diff --git a/packages/webpack-plugin/README.md b/packages/webpack-plugin/README.md
index 35e0621..0087651 100644
--- a/packages/webpack-plugin/README.md
+++ b/packages/webpack-plugin/README.md
@@ -22,6 +22,18 @@
![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)
+## 💻 在线体验
+
+vue online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
+react online demo:
+[
+![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
+](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)
+
## 🚀 安装
```perl
diff --git a/packages/webpack-plugin/package.json b/packages/webpack-plugin/package.json
index 5a094d0..21ef791 100644
--- a/packages/webpack-plugin/package.json
+++ b/packages/webpack-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "webpack-code-inspector-plugin",
- "version": "0.1.11",
+ "version": "0.1.12",
"main": "./dist/index.umd.js",
"module": "./dist/index.mjs",
"typings": "./types/index.d.ts",