@pubinfo-pr/cli 0.1.1 → 0.171.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.
package/dist/commit-r-63XXfJ.js
CHANGED
|
@@ -11,7 +11,7 @@ function isGitRepository() {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* `pubinfo commit` 子命令:
|
|
14
|
+
* `pubinfo-pr commit` 子命令:
|
|
15
15
|
* 统一封装项目级提交体验,复用 `@pubinfo-pr/commitlint` 的核心能力。
|
|
16
16
|
* 功能概述:
|
|
17
17
|
* 1. 交互式生成符合规范的提交信息(中文 + 可选 emoji)。
|
|
@@ -35,7 +35,7 @@ var commit_default = {
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
run: async ({ args }) => {
|
|
38
|
-
if (!isGitRepository()) console.error("[pubinfo commit] 未检测到 Git 仓库。请在已初始化的 Git 项目中运行,或执行 `git init` 后重试。");
|
|
38
|
+
if (!isGitRepository()) console.error("[pubinfo-pr commit] 未检测到 Git 仓库。请在已初始化的 Git 项目中运行,或执行 `git init` 后重试。");
|
|
39
39
|
else {
|
|
40
40
|
const { createCzConfig, createGitMessage, runCzConfig, runNpx, runSimpleGitHooks, runGitMessage, lintMessage, runPrompt, isCommitlintEnabled, configureGitHooksPath } = await import("@pubinfo-pr/commitlint");
|
|
41
41
|
const commitlintEnabled = await isCommitlintEnabled();
|
|
@@ -43,10 +43,10 @@ var commit_default = {
|
|
|
43
43
|
const cwd$1 = process.cwd();
|
|
44
44
|
if (!commitlintEnabled) {
|
|
45
45
|
const removedDefault = runSimpleGitHooks("pubinfo-commit", cwd$1, false);
|
|
46
|
-
const removedCli = runSimpleGitHooks("pubinfo commit", cwd$1, false);
|
|
46
|
+
const removedCli = runSimpleGitHooks("pubinfo-pr commit", cwd$1, false);
|
|
47
47
|
const disabledHooks = configureGitHooksPath(false, cwd$1);
|
|
48
|
-
if (removedDefault || removedCli || disabledHooks) console.log("[pubinfo commit] 检测到 pubinfo.config 中已关闭 commitlint,已停用 git hooks。");
|
|
49
|
-
else console.log("[pubinfo commit] 检测到 pubinfo.config 中已关闭 commitlint,跳过初始化。");
|
|
48
|
+
if (removedDefault || removedCli || disabledHooks) console.log("[pubinfo-pr commit] 检测到 pubinfo.config 中已关闭 commitlint,已停用 git hooks。");
|
|
49
|
+
else console.log("[pubinfo-pr commit] 检测到 pubinfo.config 中已关闭 commitlint,跳过初始化。");
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
configureGitHooksPath(true, cwd$1);
|
|
@@ -55,7 +55,7 @@ var commit_default = {
|
|
|
55
55
|
const gitMessageStatus = createGitMessage();
|
|
56
56
|
const czConfigStatus = createCzConfig(pubinfoDir);
|
|
57
57
|
const gitHookStatus = runGitMessage();
|
|
58
|
-
const simpleGitHooks = runSimpleGitHooks("pubinfo commit");
|
|
58
|
+
const simpleGitHooks = runSimpleGitHooks("pubinfo-pr commit");
|
|
59
59
|
const czConfig = runCzConfig(".pubinfo/cz.config.cjs");
|
|
60
60
|
const npxStatus = runNpx();
|
|
61
61
|
console.log("[pubinfo-commit] 初始化结果:");
|
|
@@ -75,17 +75,17 @@ var commit_default = {
|
|
|
75
75
|
try {
|
|
76
76
|
const raw = fs.readFileSync(String(args.edit), "utf8").trim();
|
|
77
77
|
if (!raw) {
|
|
78
|
-
console.error("[pubinfo commit] 空的 commit message");
|
|
78
|
+
console.error("[pubinfo-pr commit] 空的 commit message");
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
await lintMessage(raw);
|
|
82
82
|
} catch (e) {
|
|
83
|
-
console.error("[pubinfo commit] 读取 --edit 文件失败", e);
|
|
83
|
+
console.error("[pubinfo-pr commit] 读取 --edit 文件失败", e);
|
|
84
84
|
}
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
if (!commitlintEnabled) {
|
|
88
|
-
console.log("[pubinfo commit] commitlint 已关闭,交互模式不可用。");
|
|
88
|
+
console.log("[pubinfo-pr commit] commitlint 已关闭,交互模式不可用。");
|
|
89
89
|
configureGitHooksPath(false, process.cwd());
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
@@ -15,7 +15,7 @@ const fallbackVersion = createPubinfoPkg.version;
|
|
|
15
15
|
var generate_default = defineCommand({
|
|
16
16
|
meta: {
|
|
17
17
|
name: "generate",
|
|
18
|
-
description: "在 monorepo apps 目录下创建新的 pubinfo 应用"
|
|
18
|
+
description: "在 monorepo apps 目录下创建新的 pubinfo-pr 应用"
|
|
19
19
|
},
|
|
20
20
|
args: {
|
|
21
21
|
name: {
|
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-pr/cli";
|
|
6
|
-
var version = "2.1.
|
|
6
|
+
var version = "2.1.4";
|
|
7
7
|
var description = "CLI for Pubinfo";
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
@@ -18,7 +18,7 @@ const commands = {
|
|
|
18
18
|
icon: () => import("./icon-B2EyVw8p.js").then(_rDefault),
|
|
19
19
|
upgrade: () => import("./upgrade-B-Zl5nkj.js").then(_rDefault),
|
|
20
20
|
generate: () => import("./generate-9OAGGbjc.js").then(_rDefault),
|
|
21
|
-
monorepo: () => import("./monorepo-
|
|
21
|
+
monorepo: () => import("./monorepo-BY87UC9C.js").then(_rDefault)
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
//#endregion
|
|
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
import { cp, mkdir, mkdtemp, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
5
5
|
import { dirname, join, relative, resolve } from "node:path";
|
|
6
|
-
import { existsSync } from "node:fs";
|
|
6
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
import { logger } from "@pubinfo-pr/shared";
|
|
8
8
|
import { generate } from "create-pubinfo-pr";
|
|
9
9
|
import { globby } from "globby";
|
|
@@ -159,7 +159,7 @@ async function convertToMonorepo(options) {
|
|
|
159
159
|
const templatePkg = JSON.parse(await readFile(resolve(templateRoot, "package.json"), "utf8"));
|
|
160
160
|
templatePkg.name = buildWorkspacePackageName(rootPackageJson.name);
|
|
161
161
|
templatePkg.packageManager = packageManager || templatePkg.packageManager;
|
|
162
|
-
templatePkg.description = rootPackageJson.description || templatePkg.description || `Workspace for ${rootPackageJson.name ?? "pubinfo app"}`;
|
|
162
|
+
templatePkg.description = rootPackageJson.description || templatePkg.description || `Workspace for ${rootPackageJson.name ?? "pubinfo-pr app"}`;
|
|
163
163
|
preserveFields(templatePkg, rootPackageJson, [
|
|
164
164
|
"license",
|
|
165
165
|
"author",
|
|
@@ -182,11 +182,20 @@ async function convertToMonorepo(options) {
|
|
|
182
182
|
|
|
183
183
|
//#endregion
|
|
184
184
|
//#region src/commands/monorepo.ts
|
|
185
|
-
const
|
|
185
|
+
const require = createRequire(import.meta.url);
|
|
186
|
+
const createPubinfoPkg = (() => {
|
|
187
|
+
try {
|
|
188
|
+
const pkgPath = resolve(dirname(require.resolve("create-pubinfo-pr")), "../package.json");
|
|
189
|
+
return { version: JSON.parse(readFileSync(pkgPath, "utf8")).version ?? "latest" };
|
|
190
|
+
} catch {
|
|
191
|
+
logger.warn("无法解析 create-pubinfo-pr 版本,将使用最新版本");
|
|
192
|
+
return { version: "latest" };
|
|
193
|
+
}
|
|
194
|
+
})();
|
|
186
195
|
var monorepo_default = defineCommand({
|
|
187
196
|
meta: {
|
|
188
197
|
name: "monorepo",
|
|
189
|
-
description: "将现有 pubinfo 单体工程转换为 monorepo 结构"
|
|
198
|
+
description: "将现有 pubinfo-pr 单体工程转换为 monorepo 结构"
|
|
190
199
|
},
|
|
191
200
|
args: {
|
|
192
201
|
app: {
|
|
@@ -219,7 +228,7 @@ var monorepo_default = defineCommand({
|
|
|
219
228
|
const openapi = detectOpenapiEnabled(pkg);
|
|
220
229
|
const detectedVersion = resolvePubinfoVersionFromPackage(pkg);
|
|
221
230
|
const resolvedVersion = detectedVersion ?? createPubinfoPkg.version;
|
|
222
|
-
if (!detectedVersion) logger.info("未在 package.json 中检测到 pubinfo 依赖,将使用 create-pubinfo 默认版本");
|
|
231
|
+
if (!detectedVersion) logger.info("未在 package.json 中检测到 pubinfo-pr 依赖,将使用 create-pubinfo-pr 默认版本");
|
|
223
232
|
const tempDir = await mkdtemp(join(tmpdir(), "pubinfo-monorepo-"));
|
|
224
233
|
try {
|
|
225
234
|
await generate({
|
package/dist/setup-BdawX0W3.js
CHANGED
|
@@ -13,7 +13,7 @@ function writeTsconfig(filePath) {
|
|
|
13
13
|
if (existsSync(filePath)) unlinkSync(filePath);
|
|
14
14
|
writeFileSync(filePath, `/* eslint-disable */
|
|
15
15
|
/* prettier-ignore */
|
|
16
|
-
// Generated by pubinfo
|
|
16
|
+
// Generated by pubinfo-pr
|
|
17
17
|
{
|
|
18
18
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
19
19
|
"display": "Base",
|
package/dist/vite-bwhDbW7x.js
CHANGED
|
@@ -8,7 +8,7 @@ async function writeViteConfig(targetPath, configFile) {
|
|
|
8
8
|
await writeFile(targetPath, `
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
/* prettier-ignore */
|
|
11
|
-
// Generated by pubinfo
|
|
11
|
+
// Generated by pubinfo-pr
|
|
12
12
|
import pubinfoConfig from '${configFile}';
|
|
13
13
|
|
|
14
14
|
export default pubinfoConfig.vite
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo-pr/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.171.1",
|
|
5
5
|
"description": "CLI for Pubinfo",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./bin/pubinfo.mjs"
|
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
"node": "^20.19.0 || >=22.12.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@pubinfo-pr/vite": "0.
|
|
21
|
+
"@pubinfo-pr/vite": "0.171.1"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@pubinfo-pr/commitlint": "0.
|
|
25
|
-
"@pubinfo-pr/shared": "0.
|
|
24
|
+
"@pubinfo-pr/commitlint": "0.171.1",
|
|
25
|
+
"@pubinfo-pr/shared": "0.171.1",
|
|
26
26
|
"cheerio": "^1.1.2",
|
|
27
27
|
"citty": "^0.1.6",
|
|
28
|
-
"create-pubinfo-pr": "0.
|
|
28
|
+
"create-pubinfo-pr": "0.171.1",
|
|
29
29
|
"execa": "^9.6.0",
|
|
30
30
|
"globby": "^14.1.0",
|
|
31
31
|
"pkg-types": "^2.3.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@pubinfo-pr/vite": "0.
|
|
34
|
+
"@pubinfo-pr/vite": "0.171.1",
|
|
35
35
|
"@types/node": "^24.0.10"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|