Skip to content

Commit

Permalink
Merge pull request #48 from zh-lx/release-0.1.12
Browse files Browse the repository at this point in the history
Release 0.1.12
  • Loading branch information
zh-lx authored Sep 20, 2023
2 parents 53e34f2 + b5e058d commit 8fc8d11
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 11 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@

![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)

## 💻 在线体验

<b>vue online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

<b>react online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

## 🚀 安装

```perl
Expand Down
12 changes: 12 additions & 0 deletions docs/README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<b>vue online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

<b>react online demo:</b><br/>
[
![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
Expand Down
4 changes: 4 additions & 0 deletions docs/en/more/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.12

- 【feat】Add parameters: `hideConsole` and `editor`

## 0.1.11

- 【optimize】Optimize dependencies version
Expand Down
4 changes: 4 additions & 0 deletions docs/zh/more/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## 0.1.12

- 【feat】增加 `hideConsole``editor` 参数

## 0.1.11

- 【optimize】优化依赖项版本
Expand Down
12 changes: 12 additions & 0 deletions packages/code-inspector-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@

![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)

## 💻 在线体验

<b>vue online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

<b>react online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

## 🚀 安装

```perl
Expand Down
2 changes: 1 addition & 1 deletion packages/code-inspector-plugin/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 12 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@

![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)

## 💻 在线体验

<b>vue online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

<b>react online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

## 🚀 安装

```perl
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 6 additions & 7 deletions packages/core/src/server/launch-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -262,9 +262,9 @@ function guessEditor(_editor?: Editor) {
}
}

if(_editor) {
if (_editor && !customEditors) {
const editor = getEditorByCustom(_editor);
if(editor) {
if (editor) {
customEditors = editor;
}
}
Expand All @@ -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]];
}
Expand Down Expand Up @@ -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')
Expand All @@ -395,7 +394,7 @@ function launchEditor(
fileName: string,
lineNumber: unknown,
colNumber: unknown,
_editor?: Editor,
_editor?: Editor
) {
if (!fs.existsSync(fileName)) {
return;
Expand Down Expand Up @@ -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')
Expand Down
1 change: 1 addition & 0 deletions packages/core/types/client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export declare class MyElement extends LitElement {
port: number;
showSwitch: boolean;
autoToggle: boolean;
hideConsole: boolean;
position: {
top: number;
left: number;
Expand Down
5 changes: 5 additions & 0 deletions packages/core/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions packages/vite-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@

![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)

## 💻 在线体验

<b>vue online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

<b>react online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

## 🚀 安装

```perl
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 12 additions & 0 deletions packages/webpack-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@

![code-inspector](https://user-images.githubusercontent.com/73059627/227070438-6e40e112-6f1d-4f67-9f26-53986bff77c3.gif)

## 💻 在线体验

<b>vue online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

<b>react online demo:</b><br/>
[
![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)
](https://stackblitz.com/edit/vitejs-vite-4pseos?file=vite.config.ts)

## 🚀 安装

```perl
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 8fc8d11

Please sign in to comment.