Skip to content

Commit 4ea1b0d

Browse files
author
zhoulixiang
committed
release: 0.17.5
1 parent 8118182 commit 4ea1b0d

File tree

11 files changed

+44
-20
lines changed

11 files changed

+44
-20
lines changed

docs/en/guide/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ interface CodeInspectorOptins {
6969
## injectTo <Badge type="tip" text="0.5.0+" vertical="middle" />
7070

7171
- Optional.
72-
- Type: `string`
73-
- Description: A file used for injecting `client code` related to DOM filtering and click navigation in VSCode. The file must be an absolute path and end with `.js/.ts/.mjs/.mts/.jsx/.tsx`.(typically used for specifying a client-side file in SSR projects).
72+
- Type: `string | string[]`
73+
- Description: A file used for injecting `client code` related to DOM filtering and click navigation in VSCode. The file must be an absolute path and end with `.js/.ts/.mjs/.mts/.jsx/.tsx`.(typically used for specifying a client-side file in SSR projects). The `string[]` type is only supported in `0.17.5` or higher versions.
7474

7575
## dev <Badge type="tip" text="0.5.0+" vertical="middle" />
7676

docs/en/more/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.17.5
4+
5+
- 【perf】The `injectTo` parameter now supports passing an array to allow injecting multiple files simultaneously [#231](https://github.com/zh-lx/code-inspector/pull/231)
6+
- 【feat】Webpack will also inject client code into HTML files to support some MPA-type projects [#230](https://github.com/zh-lx/code-inspector/pull/230)
7+
38
## 0.17.4
49

510
- 【fix】Fixed the issue where it only worked on the first HTML page when used in MPA projects [#229](https://github.com/zh-lx/code-inspector/pull/229)

docs/zh/guide/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ interface CodeInspectorOptins {
6969
## injectTo <Badge type="tip" text="0.5.0+" vertical="middle" />
7070

7171
- 可选项。默认值为 `auto`
72-
- 类型:`string`
73-
- 说明:用于注入 DOM 筛选和点击跳转 vscode 的相关的 `client code` 代码的文件(必须为绝对路径且以 `.js/.ts/.mjs/.mts/.jsx/.tsx` 为结尾的文件)。(通常用于 SSR 项目中指定一个 client 端的文件)。
72+
- 类型:`string | string[]`
73+
- 说明:用于注入 DOM 筛选和点击跳转 vscode 的相关的 `client code` 代码的文件(必须为绝对路径且以 `.js/.ts/.mjs/.mts/.jsx/.tsx` 为结尾的文件)。(通常用于 SSR 项目中指定一个 client 端的文件)。`string[]` 类型仅在 `0.17.5` 及以上版本支持。
7474

7575
## dev <Badge type="tip" text="0.5.0+" vertical="middle" />
7676

docs/zh/more/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# 更新日志
22

3+
## 0.17.5
4+
5+
- 【perf】`injectTo` 参数支持传入数组,以支持同时注入多个文件 [#231](https://github.com/zh-lx/code-inspector/pull/231)
6+
- 【feat】webpack 会像 html 文件也注入 client 代码,以支持部分 MPA 类型的项目 [#230](https://github.com/zh-lx/code-inspector/pull/230)
7+
38
## 0.17.4
49

510
- 【fix】修复了在 MPA 项目中使用时,只会在第一个 html 页面中会生效的问题 [#229](https://github.com/zh-lx/code-inspector/pull/229)

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"pub:beta": "pnpm --filter \"./packages/*\" run pub:beta --no-git-checks",
2626
"version:major": "node ./scripts/version major",
2727
"version:minor": "node ./scripts/version minor",
28-
"version:patch": "node ./scripts/version patch"
28+
"version:patch": "node ./scripts/version patch",
29+
"version:prod": "node ./scripts/version prod",
30+
"version:beta": "node ./scripts/version beta"
2931
},
3032
"private": true,
3133
"main": "index.js",

packages/code-inspector-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "code-inspector-plugin",
3-
"version": "0.17.5-beta.1",
3+
"version": "0.17.5",
44
"main": "./dist/index.js",
55
"module": "./dist/index.mjs",
66
"typings": "./types/index.d.ts",
@@ -64,4 +64,4 @@
6464
"typescript": "^4.9.3",
6565
"vite": "^4.1.0"
6666
}
67-
}
67+
}

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "code-inspector-core",
3-
"version": "0.17.5-beta.1",
3+
"version": "0.17.5",
44
"main": "dist/index.js",
55
"module": "./dist/index.mjs",
66
"types": "types/index.d.ts",
@@ -70,4 +70,4 @@
7070
"vite-plugin-node-stdlib-browser": "^0.2.1",
7171
"volar-service-pug": "^0.0.34"
7272
}
73-
}
73+
}

packages/esbuild-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esbuild-code-inspector-plugin",
3-
"version": "0.17.5-beta.1",
3+
"version": "0.17.5",
44
"main": "./dist/index.js",
55
"module": "./dist/index.mjs",
66
"typings": "./types/index.d.ts",
@@ -51,4 +51,4 @@
5151
"pub": "pnpm publish",
5252
"pub:beta": "pnpm publish --tag beta"
5353
}
54-
}
54+
}

packages/vite-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-code-inspector-plugin",
3-
"version": "0.17.5-beta.1",
3+
"version": "0.17.5",
44
"main": "./dist/index.js",
55
"module": "./dist/index.mjs",
66
"typings": "./types/index.d.ts",
@@ -51,4 +51,4 @@
5151
"pub": "pnpm publish",
5252
"pub:beta": "pnpm publish --tag beta"
5353
}
54-
}
54+
}

packages/webpack-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack-code-inspector-plugin",
3-
"version": "0.17.5-beta.1",
3+
"version": "0.17.5",
44
"main": "./dist/index.umd.js",
55
"module": "./dist/index.mjs",
66
"typings": "./types/index.d.ts",
@@ -54,4 +54,4 @@
5454
"typescript": "^4.9.3",
5555
"vite": "^4.3.9"
5656
}
57-
}
57+
}

scripts/version.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ const fs = require('fs');
22
const path = require('path');
33

44
// 获取命令行参数
5-
const [,, updateType] = process.argv;
5+
const [,, updateType, tagType] = process.argv;
66

7-
if (!['major', 'minor', 'patch'].includes(updateType)) {
8-
console.error('Invalid argument. Please use "major"、 "minor" or "patch".');
7+
if (!['major', 'minor', 'patch', 'prod', 'beta'].includes(updateType)) {
8+
console.error('Invalid argument. Please use "major"、 "minor"、 "patch"、 "prod" or "beta".');
99
process.exit(1);
1010
}
1111

@@ -31,9 +31,17 @@ fs.readdir(packagesDir, (err, files) => {
3131

3232
try {
3333
const packageJson = JSON.parse(data);
34-
const versionParts = packageJson.version.split('.').map(Number);
34+
const [version, tagParts] = packageJson.version.split('-'); // 兼容 x.x.x-beta.x
35+
const versionParts = version.split('.').map(Number);
3536

36-
if (updateType === 'major') {
37+
let [tagName, tagVersion] = (tagParts || 'beta.0').split('.');
38+
39+
if (updateType === 'prod') {
40+
// 删除 tag
41+
} else if (updateType === 'beta') {
42+
// 仅升级 tag 版本
43+
tagVersion = (Number(tagVersion) + 1);
44+
} else if (updateType === 'major') {
3745
versionParts[0] += 1;
3846
versionParts[1] = 0;
3947
versionParts[2] = 0;
@@ -46,6 +54,10 @@ fs.readdir(packagesDir, (err, files) => {
4654

4755
packageJson.version = versionParts.join('.');
4856

57+
if (tagType || updateType === 'beta') {
58+
packageJson.version = `${packageJson.version}-${tagType || tagName}.${tagVersion}`;
59+
}
60+
4961
// 写回更新后的 package.json 文件
5062
fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8', err => {
5163
if (err) {

0 commit comments

Comments
 (0)