@koishi-ce/client 1.2.1 → 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 +2 -2
- package/lib/index.mjs +1 -1
- package/lib/{src-D1GR_-AS.mjs → src-DkHXW-Bk.mjs} +12 -2
- package/package.json +3 -3
- package/src/index.ts +23 -6
package/lib/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as build } from "./src-
|
|
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.
|
|
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-
|
|
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
|
-
|
|
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 });
|
|
@@ -175,7 +180,12 @@ async function createServer(baseDir, config = {}) {
|
|
|
175
180
|
"xss",
|
|
176
181
|
"reggol"
|
|
177
182
|
],
|
|
178
|
-
exclude: [
|
|
183
|
+
exclude: [
|
|
184
|
+
"@koishi-ce/client",
|
|
185
|
+
"@koishi-ce/components",
|
|
186
|
+
"schemastery-vue",
|
|
187
|
+
"schemastery-vue/client"
|
|
188
|
+
]
|
|
179
189
|
},
|
|
180
190
|
build: { rollupOptions: { input: `${root}/index.html` } }
|
|
181
191
|
}, config));
|
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.
|
|
4
|
+
"version": "1.2.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "client/index.ts",
|
|
7
7
|
"exports": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"build"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@koishi-ce/components": "^1.0.
|
|
51
|
+
"@koishi-ce/components": "^1.0.4",
|
|
52
52
|
"@satorijs/protocol": "^1.7.0",
|
|
53
53
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
54
54
|
"@vueuse/core": "^14.4.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"vue-router": "^5.2.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@koishi-ce/koishi": "^1.0.
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 上是反斜杠,统一归一化为正斜杠
|
|
@@ -363,14 +369,25 @@ export async function createServer(
|
|
|
363
369
|
"reggol",
|
|
364
370
|
],
|
|
365
371
|
// 宿主与组件库以 TS 源码 + .yml 词典的形态发布,必须走
|
|
366
|
-
// dev transform
|
|
372
|
+
// dev transform 管线逐文件服务(yaml 插件在此生效);
|
|
367
373
|
// 一旦落入依赖预打包,rolldown 会把 .yml 当 JS 解析,
|
|
368
374
|
// 直接报 PARSE_ERROR。工作区内两者经工作区别名映射为
|
|
369
375
|
// 绝对路径、天然不进 optimizer;下游 npm 安装形态下别名
|
|
370
|
-
//
|
|
376
|
+
// 表为空、以裸包名参与解析,须在此显式排除。
|
|
377
|
+
// schemastery-vue 同理(裸名与 form 所用的 /client 子路径
|
|
378
|
+
// 都要排除):它以 TS 源码 + .vue 发布,optimizer 对其
|
|
379
|
+
// 预打包会产出指向不存在产物的引用(server 控制台报
|
|
380
|
+
// does not exist ... deps/schemastery-vue.js),而 /client
|
|
381
|
+
// 子路径经 alias 预打包成功时又会把整套 cosmokit 以另一
|
|
382
|
+
// 份实例内联进 deps 产物——组件库入口的 star 导出因此在
|
|
383
|
+
// 浏览器端被判 conflicting star exports,全部 webui 插件
|
|
384
|
+
// 前端加载失败(侧栏空白)。排除后统一走源码 transform,
|
|
385
|
+
// cosmokit 全链单实例单 URL。
|
|
371
386
|
exclude: [
|
|
372
387
|
"@koishi-ce/client",
|
|
373
388
|
"@koishi-ce/components",
|
|
389
|
+
"schemastery-vue",
|
|
390
|
+
"schemastery-vue/client",
|
|
374
391
|
],
|
|
375
392
|
},
|
|
376
393
|
build: {
|