@pubinfo/cli 2.0.8-beta.2 → 2.0.8-beta.3
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.
|
@@ -27,7 +27,7 @@ var commit_default = {
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
run: async ({ args }) => {
|
|
30
|
-
const { createCzConfig, createGitMessage, runCzConfig, runNpx, runSimpleGitHooks, runGitMessage, lintMessage, runPrompt, isInsideGitRepo, isCommitlintEnabled } = await import("@pubinfo/commitlint");
|
|
30
|
+
const { createCzConfig, createGitMessage, runCzConfig, runNpx, runSimpleGitHooks, runGitMessage, lintMessage, runPrompt, isInsideGitRepo, isCommitlintEnabled, configureGitHooksPath } = await import("@pubinfo/commitlint");
|
|
31
31
|
if (!isInsideGitRepo()) {
|
|
32
32
|
console.error("[pubinfo commit] 未检测到 Git 仓库。请在已初始化的 Git 项目中运行,或执行 `git init` 后重试。");
|
|
33
33
|
return;
|
|
@@ -38,12 +38,12 @@ var commit_default = {
|
|
|
38
38
|
if (!commitlintEnabled) {
|
|
39
39
|
const removedDefault = runSimpleGitHooks("pubinfo-commit", cwd, false);
|
|
40
40
|
const removedCli = runSimpleGitHooks("pubinfo commit", cwd, false);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} else console.log("[pubinfo commit] 检测到 pubinfo.config 中已关闭 commitlint,跳过初始化。");
|
|
41
|
+
const disabledHooks = configureGitHooksPath(false, cwd);
|
|
42
|
+
if (removedDefault || removedCli || disabledHooks) console.log("[pubinfo commit] 检测到 pubinfo.config 中已关闭 commitlint,已停用 git hooks。");
|
|
43
|
+
else console.log("[pubinfo commit] 检测到 pubinfo.config 中已关闭 commitlint,跳过初始化。");
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
46
|
+
configureGitHooksPath(true, cwd);
|
|
47
47
|
const pubinfoDir = `${cwd}/.pubinfo`;
|
|
48
48
|
if (!fs.existsSync(pubinfoDir)) fs.mkdirSync(pubinfoDir);
|
|
49
49
|
const gitMessageStatus = createGitMessage();
|
|
@@ -62,7 +62,10 @@ var commit_default = {
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
if (args.edit) {
|
|
65
|
-
if (!commitlintEnabled)
|
|
65
|
+
if (!commitlintEnabled) {
|
|
66
|
+
configureGitHooksPath(false, process.cwd());
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
66
69
|
try {
|
|
67
70
|
const raw = fs.readFileSync(String(args.edit), "utf8").trim();
|
|
68
71
|
if (!raw) {
|
|
@@ -75,6 +78,11 @@ var commit_default = {
|
|
|
75
78
|
}
|
|
76
79
|
return;
|
|
77
80
|
}
|
|
81
|
+
if (!commitlintEnabled) {
|
|
82
|
+
console.log("[pubinfo commit] commitlint 已关闭,交互模式不可用。");
|
|
83
|
+
configureGitHooksPath(false, process.cwd());
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
78
86
|
const result = await runPrompt();
|
|
79
87
|
if (!result) {
|
|
80
88
|
console.error("[pubinfo-commit] 未找到 cz-git 或交互被中断");
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@pubinfo/cli";
|
|
6
6
|
var type = "module";
|
|
7
|
-
var version = "2.0.8-beta.
|
|
7
|
+
var version = "2.0.8-beta.3";
|
|
8
8
|
var description = "CLI for Pubinfo";
|
|
9
9
|
var exports = { ".": "./bin/pubinfo.mjs" };
|
|
10
10
|
var types = "./dist/index.d.ts";
|
|
@@ -53,7 +53,7 @@ const commands = {
|
|
|
53
53
|
build: () => import("./build-CE20dL_r.js").then(_rDefault),
|
|
54
54
|
preview: () => import("./preview-W9XnXXss.js").then(_rDefault),
|
|
55
55
|
setup: () => import("./setup-CYXOtkPr.js").then(_rDefault),
|
|
56
|
-
commit: () => import("./commit-
|
|
56
|
+
commit: () => import("./commit-DOMxp7V0.js").then(_rDefault),
|
|
57
57
|
icon: () => import("./icon-DWczAqmo.js").then(_rDefault),
|
|
58
58
|
upgrade: () => import("./upgrade-CIZMqC7-.js").then(_rDefault)
|
|
59
59
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.8-beta.
|
|
4
|
+
"version": "2.0.8-beta.3",
|
|
5
5
|
"description": "CLI for Pubinfo",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./bin/pubinfo.mjs"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"node": "^20.19.0 || >=22.12.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@pubinfo/vite": "2.0.8-beta.
|
|
21
|
+
"@pubinfo/vite": "2.0.8-beta.3"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"cheerio": "^1.1.2",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"globby": "^14.1.0",
|
|
27
27
|
"pkg-types": "^2.3.0",
|
|
28
28
|
"unconfig": "^7.3.2",
|
|
29
|
-
"@pubinfo/commitlint": "2.0.8-beta.
|
|
29
|
+
"@pubinfo/commitlint": "2.0.8-beta.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^24.0.10",
|
|
33
|
-
"@pubinfo/vite": "2.0.8-beta.
|
|
33
|
+
"@pubinfo/vite": "2.0.8-beta.3"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"dev": "tsdown --watch",
|