@quiteer/scripts 0.1.5 → 0.1.6
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/dist/index.d.mts +1 -5
- package/dist/index.mjs +8 -10
- package/package.json +2 -3
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import enquirer from "enquirer";
|
|
|
12
12
|
import { versionBump } from "bumpp";
|
|
13
13
|
|
|
14
14
|
//#region package.json
|
|
15
|
-
var version = "0.1.
|
|
15
|
+
var version = "0.1.6";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/locales/changelog.ts
|
|
@@ -1136,23 +1136,21 @@ async function gitCommitVerifyTz(lang = "zh-cn", ignores = []) {
|
|
|
1136
1136
|
const commitMsg = readFileSync(path.join(gitPath, ".git", "COMMIT_EDITMSG"), "utf8").trim();
|
|
1137
1137
|
if (ignores.some((regExp) => regExp.test(commitMsg))) return;
|
|
1138
1138
|
const REG_EXP = /^(?<type>[a-z-]+)(?:\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)$/i;
|
|
1139
|
-
const VERSION_REG_EXP = /^v\d
|
|
1139
|
+
const VERSION_REG_EXP = /^v\d+(?:\.\d+)*(-[a-z0-9]+)?$/;
|
|
1140
1140
|
const match = commitMsg.match(REG_EXP);
|
|
1141
1141
|
if (!match) {
|
|
1142
1142
|
const errorMsg = locales[lang].gitCommitVerify;
|
|
1143
1143
|
throw new Error(errorMsg);
|
|
1144
1144
|
}
|
|
1145
|
-
const {
|
|
1146
|
-
if (
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
throw new Error(errorMsg);
|
|
1150
|
-
}
|
|
1145
|
+
const { scope } = match.groups || {};
|
|
1146
|
+
if (!scope || !VERSION_REG_EXP.test(scope)) {
|
|
1147
|
+
const errorMsg = lang === "zh-cn" ? `[校验失败]: 当提交类型为 'fix' 时,scope 必须是符合规范的版本号 (例如: v1、v1.2、v1.2.3 或 v1.2.3-patch)` : `[Verify Failed]: When commit type is 'fix', scope must be a valid version (e.g., v1, v1.2, v1.2.3 or v1.2.3-patch)`;
|
|
1148
|
+
throw new Error(errorMsg);
|
|
1151
1149
|
}
|
|
1152
1150
|
}
|
|
1153
1151
|
|
|
1154
1152
|
//#endregion
|
|
1155
|
-
//#region src/
|
|
1153
|
+
//#region src/bin.ts
|
|
1156
1154
|
async function setupCli() {
|
|
1157
1155
|
/**
|
|
1158
1156
|
* 初始化并注册 CLI
|
|
@@ -1223,4 +1221,4 @@ async function setupCli() {
|
|
|
1223
1221
|
setupCli();
|
|
1224
1222
|
|
|
1225
1223
|
//#endregion
|
|
1226
|
-
export {
|
|
1224
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quiteer/scripts",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"homepage": "https://quiteerjs.github.io/web/cli/scripts.html",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -43,8 +43,7 @@
|
|
|
43
43
|
"rimraf": "6.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"tsdown": "^0.16.1"
|
|
47
|
-
"tsx": "^4.20.6"
|
|
46
|
+
"tsdown": "^0.16.1"
|
|
48
47
|
},
|
|
49
48
|
"scripts": {
|
|
50
49
|
"dev": "tsdown -w",
|