@pubinfo-pr/cli 0.182.2 → 0.182.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.
@@ -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: {
@@ -11,8 +11,8 @@ function ensureValidIdentifier(value, label) {
11
11
  }
12
12
  function ensureMonorepoAppsDir(root) {
13
13
  const appsDir = resolve(root, "apps");
14
- if (!existsSync(appsDir)) throw new Error("未检测到 apps 目录,请在 pubinfo monorepo 根目录执行该命令");
15
- if (!existsSync(resolve(root, "pnpm-workspace.yaml"))) throw new Error("未找到 pnpm-workspace.yaml,当前目录不是 pubinfo monorepo 工程");
14
+ if (!existsSync(appsDir)) throw new Error("未检测到 apps 目录,请在 pubinfo-pr monorepo 根目录执行该命令");
15
+ if (!existsSync(resolve(root, "pnpm-workspace.yaml"))) throw new Error("未找到 pnpm-workspace.yaml,当前目录不是 pubinfo-pr monorepo 工程");
16
16
  return appsDir;
17
17
  }
18
18
  async function resolvePubinfoVersionFromApps(appsDir) {
@@ -111,7 +111,7 @@ function detectModulesFromPackage(pkg) {
111
111
  return modules;
112
112
  }
113
113
  function detectOpenapiEnabled(pkg) {
114
- return hasDependency(pkg, "@pubinfo/openapi") || hasDependency(pkg, "@pubinfo/preset-openapi") || Boolean(pkg.scripts?.openapi);
114
+ return hasDependency(pkg, "@pubinfo-pr/openapi") || hasDependency(pkg, "@pubinfo-pr/preset-openapi") || Boolean(pkg.scripts?.openapi);
115
115
  }
116
116
  function resolvePubinfoVersionFromPackage(pkg) {
117
117
  return pkg.dependencies?.pubinfo || pkg.devDependencies?.pubinfo;
@@ -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",
@@ -188,14 +188,14 @@ const createPubinfoPkg = (() => {
188
188
  const pkgPath = resolve(dirname(require.resolve("create-pubinfo-pr")), "../package.json");
189
189
  return { version: JSON.parse(readFileSync(pkgPath, "utf8")).version ?? "latest" };
190
190
  } catch {
191
- logger.warn("无法解析 create-pubinfo 版本,将使用最新版本");
191
+ logger.warn("无法解析 create-pubinfo-pr 版本,将使用最新版本");
192
192
  return { version: "latest" };
193
193
  }
194
194
  })();
195
195
  var monorepo_default = defineCommand({
196
196
  meta: {
197
197
  name: "monorepo",
198
- description: "将现有 pubinfo 单体工程转换为 monorepo 结构"
198
+ description: "将现有 pubinfo-pr 单体工程转换为 monorepo 结构"
199
199
  },
200
200
  args: {
201
201
  app: {
@@ -228,7 +228,7 @@ var monorepo_default = defineCommand({
228
228
  const openapi = detectOpenapiEnabled(pkg);
229
229
  const detectedVersion = resolvePubinfoVersionFromPackage(pkg);
230
230
  const resolvedVersion = detectedVersion ?? createPubinfoPkg.version;
231
- if (!detectedVersion) logger.info("未在 package.json 中检测到 pubinfo 依赖,将使用 create-pubinfo 默认版本");
231
+ if (!detectedVersion) logger.info("未在 package.json 中检测到 pubinfo-pr 依赖,将使用 create-pubinfo-pr 默认版本");
232
232
  const tempDir = await mkdtemp(join(tmpdir(), "pubinfo-monorepo-"));
233
233
  try {
234
234
  await generate({
@@ -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",
@@ -17,7 +17,7 @@ const command = defineCommand({
17
17
  ...pkg.peerDependencies
18
18
  };
19
19
  function isPubinfoRelated(name) {
20
- return name === "pubinfo-pr" || name.startsWith("@pubinfo/module-");
20
+ return name === "pubinfo-pr" || name.startsWith("@pubinfo-pr/module-");
21
21
  }
22
22
  const pubinfoDeps = Object.keys(deps).filter(isPubinfoRelated);
23
23
  if (!pubinfoDeps.length) {
@@ -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.182.2",
4
+ "version": "0.182.3",
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.182.2"
21
+ "@pubinfo-pr/vite": "0.182.3"
22
22
  },
23
23
  "dependencies": {
24
- "@pubinfo-pr/commitlint": "0.182.2",
25
- "@pubinfo-pr/shared": "0.182.2",
24
+ "@pubinfo-pr/commitlint": "0.182.3",
25
+ "@pubinfo-pr/shared": "0.182.3",
26
26
  "cheerio": "^1.1.2",
27
27
  "citty": "^0.1.6",
28
- "create-pubinfo-pr": "0.182.2",
28
+ "create-pubinfo-pr": "0.182.3",
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.182.2",
34
+ "@pubinfo-pr/vite": "0.182.3",
35
35
  "@types/node": "^24.0.10"
36
36
  },
37
37
  "scripts": {