@pubinfo/cli 2.0.8-beta.1 → 2.0.8-beta.2
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,13 +27,24 @@ var commit_default = {
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
run: async ({ args }) => {
|
|
30
|
-
const { createCzConfig, createGitMessage, runCzConfig, runNpx, runSimpleGitHooks, runGitMessage, lintMessage, runPrompt, isInsideGitRepo } = await import("@pubinfo/commitlint");
|
|
30
|
+
const { createCzConfig, createGitMessage, runCzConfig, runNpx, runSimpleGitHooks, runGitMessage, lintMessage, runPrompt, isInsideGitRepo, isCommitlintEnabled } = await import("@pubinfo/commitlint");
|
|
31
31
|
if (!isInsideGitRepo()) {
|
|
32
32
|
console.error("[pubinfo commit] 未检测到 Git 仓库。请在已初始化的 Git 项目中运行,或执行 `git init` 后重试。");
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
+
const commitlintEnabled = await isCommitlintEnabled();
|
|
35
36
|
if (args.init) {
|
|
36
|
-
const
|
|
37
|
+
const cwd = process.cwd();
|
|
38
|
+
if (!commitlintEnabled) {
|
|
39
|
+
const removedDefault = runSimpleGitHooks("pubinfo-commit", cwd, false);
|
|
40
|
+
const removedCli = runSimpleGitHooks("pubinfo commit", cwd, false);
|
|
41
|
+
if (removedDefault || removedCli) {
|
|
42
|
+
runNpx(cwd);
|
|
43
|
+
console.log("[pubinfo commit] 检测到 pubinfo.config 中已关闭 commitlint,已清理 simple-git-hooks 配置。");
|
|
44
|
+
} else console.log("[pubinfo commit] 检测到 pubinfo.config 中已关闭 commitlint,跳过初始化。");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const pubinfoDir = `${cwd}/.pubinfo`;
|
|
37
48
|
if (!fs.existsSync(pubinfoDir)) fs.mkdirSync(pubinfoDir);
|
|
38
49
|
const gitMessageStatus = createGitMessage();
|
|
39
50
|
const czConfigStatus = createCzConfig(pubinfoDir);
|
|
@@ -51,6 +62,7 @@ var commit_default = {
|
|
|
51
62
|
return;
|
|
52
63
|
}
|
|
53
64
|
if (args.edit) {
|
|
65
|
+
if (!commitlintEnabled) return;
|
|
54
66
|
try {
|
|
55
67
|
const raw = fs.readFileSync(String(args.edit), "utf8").trim();
|
|
56
68
|
if (!raw) {
|
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.2";
|
|
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-pv8f_E9i.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.2",
|
|
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.2"
|
|
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.2"
|
|
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.2"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"dev": "tsdown --watch",
|