@koishi-ce/client 1.2.2 → 1.2.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.
package/lib/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as build } from "./src-dERcS8wI.mjs";
2
+ import { t as build } from "./src-DkHXW-Bk.mjs";
3
3
  import { existsSync } from "node:fs";
4
4
  import { resolve } from "node:path";
5
5
  //#endregion
@@ -16,7 +16,7 @@ import { resolve } from "node:path";
16
16
  const { version } = {
17
17
  name: "@koishi-ce/client",
18
18
  description: "Koishi Console Client",
19
- version: "1.2.2",
19
+ version: "1.2.3",
20
20
  type: "module",
21
21
  main: "client/index.ts",
22
22
  exports: {
package/lib/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as createServer, t as build } from "./src-dERcS8wI.mjs";
1
+ import { n as createServer, t as build } from "./src-DkHXW-Bk.mjs";
2
2
  export { build, createServer };
@@ -15,7 +15,12 @@ import * as vite from "vite";
15
15
  */
16
16
  async function collectWorkspaceAliases() {
17
17
  const repoRoot = resolve(import.meta.dir, "../../../..").replace(/\\/g, "/");
18
- const manifest = await Bun.file(`${repoRoot}/package.json`).json();
18
+ let manifest;
19
+ try {
20
+ manifest = await Bun.file(`${repoRoot}/package.json`).json();
21
+ } catch {
22
+ return {};
23
+ }
19
24
  const aliases = {};
20
25
  for (const pattern of manifest.workspaces ?? []) {
21
26
  const files = new Bun.Glob(`${pattern}/package.json`).scanSync({ cwd: repoRoot });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@koishi-ce/client",
3
3
  "description": "Koishi Console Client",
4
- "version": "1.2.2",
4
+ "version": "1.2.3",
5
5
  "type": "module",
6
6
  "main": "client/index.ts",
7
7
  "exports": {
@@ -65,7 +65,7 @@
65
65
  "vue-router": "^5.2.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@koishi-ce/koishi": "^1.0.11",
68
+ "@koishi-ce/koishi": "^1.0.14",
69
69
  "@koishi-ce/plugin-console": "^1.3.1"
70
70
  }
71
71
  }
package/src/index.ts CHANGED
@@ -35,14 +35,20 @@ interface BuildResult {
35
35
  async function collectWorkspaceAliases(): Promise<
36
36
  Record<string, string>
37
37
  > {
38
- // 源码形态(src/)与产物形态(lib/)都在包根下一级,上跳四级到仓库根一致
38
+ // 源码形态(src/)与产物形态(lib/)都在包根下一级,上跳四级到仓库根一致
39
39
  const repoRoot = resolve(
40
40
  import.meta.dir,
41
41
  "../../../..",
42
42
  ).replace(/\\/g, "/");
43
- const manifest = await Bun.file(
44
- `${repoRoot}/package.json`,
45
- ).json();
43
+ let manifest: { workspaces?: string[] };
44
+ try {
45
+ manifest = await Bun.file(`${repoRoot}/package.json`).json();
46
+ } catch {
47
+ // 下游 npm 安装形态(.bun 嵌套布局或根提升布局)四级上跳不落在
48
+ // 任何仓库根:读不到清单即没有 workspace 源码可映射,空表即正确
49
+ // 语义(本函数在模块顶层 await 执行,抛出会拖垮整个 client 加载)
50
+ return {};
51
+ }
46
52
  const aliases: Record<string, string> = {};
47
53
  for (const pattern of manifest.workspaces ?? []) {
48
54
  // scanSync 产出的相对路径在 Windows 上是反斜杠,统一归一化为正斜杠