@pubinfo-pr/cli 0.1.1 → 0.182.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.
package/dist/index.js CHANGED
@@ -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-cRiwN6UD.js").then(_rDefault)
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";
@@ -182,7 +182,16 @@ async function convertToMonorepo(options) {
182
182
 
183
183
  //#endregion
184
184
  //#region src/commands/monorepo.ts
185
- const createPubinfoPkg = createRequire(import.meta.url)("create-pubinfo-pr/package.json");
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 版本,将使用最新版本");
192
+ return { version: "latest" };
193
+ }
194
+ })();
186
195
  var monorepo_default = defineCommand({
187
196
  meta: {
188
197
  name: "monorepo",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo-pr/cli",
3
3
  "type": "module",
4
- "version": "0.1.1",
4
+ "version": "0.182.2",
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.1.1"
21
+ "@pubinfo-pr/vite": "0.182.2"
22
22
  },
23
23
  "dependencies": {
24
- "@pubinfo-pr/commitlint": "0.1.1",
25
- "@pubinfo-pr/shared": "0.1.1",
24
+ "@pubinfo-pr/commitlint": "0.182.2",
25
+ "@pubinfo-pr/shared": "0.182.2",
26
26
  "cheerio": "^1.1.2",
27
27
  "citty": "^0.1.6",
28
- "create-pubinfo-pr": "0.1.1",
28
+ "create-pubinfo-pr": "0.182.2",
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.1.1",
34
+ "@pubinfo-pr/vite": "0.182.2",
35
35
  "@types/node": "^24.0.10"
36
36
  },
37
37
  "scripts": {