@pubinfo/cli 2.1.2 → 2.1.3-beta.1
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.
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
3
4
|
|
|
4
5
|
//#region src/commands/commit.ts
|
|
6
|
+
function isGitRepository() {
|
|
7
|
+
try {
|
|
8
|
+
return spawnSync("git", ["rev-parse", "--is-inside-work-tree"], { stdio: "ignore" }).status === 0;
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
5
13
|
/**
|
|
6
14
|
* `pubinfo commit` 子命令:
|
|
7
15
|
* 统一封装项目级提交体验,复用 `@pubinfo/commitlint` 的核心能力。
|
|
@@ -27,9 +35,9 @@ var commit_default = {
|
|
|
27
35
|
}
|
|
28
36
|
},
|
|
29
37
|
run: async ({ args }) => {
|
|
30
|
-
|
|
31
|
-
if (!isInsideGitRepo()) console.error("[pubinfo commit] 未检测到 Git 仓库。请在已初始化的 Git 项目中运行,或执行 `git init` 后重试。");
|
|
38
|
+
if (!isGitRepository()) console.error("[pubinfo commit] 未检测到 Git 仓库。请在已初始化的 Git 项目中运行,或执行 `git init` 后重试。");
|
|
32
39
|
else {
|
|
40
|
+
const { createCzConfig, createGitMessage, runCzConfig, runNpx, runSimpleGitHooks, runGitMessage, lintMessage, runPrompt, isCommitlintEnabled, configureGitHooksPath } = await import("@pubinfo/commitlint");
|
|
33
41
|
const commitlintEnabled = await isCommitlintEnabled();
|
|
34
42
|
if (args.init) {
|
|
35
43
|
const cwd$1 = process.cwd();
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@pubinfo/cli";
|
|
6
|
-
var version = "2.1.
|
|
6
|
+
var version = "2.1.3-beta.1";
|
|
7
7
|
var description = "CLI for Pubinfo";
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
@@ -14,9 +14,9 @@ const commands = {
|
|
|
14
14
|
build: () => import("./build-CBpkrIHc.js").then(_rDefault),
|
|
15
15
|
preview: () => import("./preview-CL5eJUy5.js").then(_rDefault),
|
|
16
16
|
setup: () => import("./setup-tGwcxPxN.js").then(_rDefault),
|
|
17
|
-
commit: () => import("./commit-
|
|
17
|
+
commit: () => import("./commit-BsodnARP.js").then(_rDefault),
|
|
18
18
|
icon: () => import("./icon-Dp4dXbYT.js").then(_rDefault),
|
|
19
|
-
upgrade: () => import("./upgrade-
|
|
19
|
+
upgrade: () => import("./upgrade-R63l7RcU.js").then(_rDefault)
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.3-beta.1",
|
|
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.1.
|
|
21
|
+
"@pubinfo/vite": "2.1.3-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"cheerio": "^1.1.2",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"execa": "^9.6.0",
|
|
27
27
|
"globby": "^14.1.0",
|
|
28
28
|
"pkg-types": "^2.3.0",
|
|
29
|
-
"@pubinfo/commitlint": "2.1.
|
|
30
|
-
"@pubinfo/shared": "2.1.
|
|
29
|
+
"@pubinfo/commitlint": "2.1.3-beta.1",
|
|
30
|
+
"@pubinfo/shared": "2.1.3-beta.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^24.0.10",
|
|
34
|
-
"@pubinfo/vite": "2.1.
|
|
34
|
+
"@pubinfo/vite": "2.1.3-beta.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "tsdown --watch",
|