@morlay/dsh-client-modules 0.2.9 → 0.2.11-alpha.0
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/client.cjs +17334 -2
- package/dist/client.d.cts +2 -4
- package/dist/client.d.mts +2 -4
- package/dist/client.mjs +3 -2
- package/dist/index.cjs +17 -16
- package/dist/index.d.mts +10 -3
- package/dist/index.mjs +17 -17
- package/package.json +9 -8
- package/src/__tests__/watch.spec.ts +35 -0
- package/src/client/index.ts +8 -1
- package/src/index.ts +12 -3
package/dist/client.d.cts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
//#region src/client/index.d.ts
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* 浏览器侧的根插件。
|
|
5
4
|
*
|
|
6
5
|
* @param ctx - 浏览器侧根上下文。
|
|
7
6
|
*/
|
|
8
|
-
export declare function apply(ctx: Context): void;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare function apply(ctx: Context): void;
|
package/dist/client.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
//#region src/client/index.d.ts
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* 浏览器侧的根插件。
|
|
5
4
|
*
|
|
6
5
|
* @param ctx - 浏览器侧根上下文。
|
|
7
6
|
*/
|
|
8
|
-
export declare function apply(ctx: Context): void;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare function apply(ctx: Context): void;
|
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { apply as apply$1 } from "@morlay/dsh-client-ui-primitives/client";
|
|
2
|
+
// src/client/index.ts
|
|
2
3
|
/** 恒 `undefined` 的可订阅快照(`useSyncExternalStore` 的入参形状)。 */
|
|
3
4
|
const NO_RELEASE_CHANGE = {
|
|
4
5
|
getSnapshot: () => void 0,
|
|
@@ -10,6 +11,7 @@ const NO_RELEASE_CHANGE = {
|
|
|
10
11
|
* @param ctx - 浏览器侧根上下文。
|
|
11
12
|
*/
|
|
12
13
|
function apply(ctx) {
|
|
14
|
+
apply$1(ctx);
|
|
13
15
|
ctx.reflect.provide("modules", {
|
|
14
16
|
entries: {
|
|
15
17
|
releaseChange: NO_RELEASE_CHANGE,
|
|
@@ -52,5 +54,4 @@ function installTerminalRecovery(ctx) {
|
|
|
52
54
|
};
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
|
-
//#endregion
|
|
56
57
|
export { apply };
|
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ let node_crypto = require("node:crypto");
|
|
|
8
8
|
let _morlay_dsh_cordis_assets_styles = require("@morlay/dsh-cordis-assets/styles");
|
|
9
9
|
let rolldown = require("rolldown");
|
|
10
10
|
let vite = require("vite");
|
|
11
|
-
|
|
11
|
+
// src/trace.ts
|
|
12
12
|
/**
|
|
13
13
|
* 诊断细节(逐包预编译、逐请求那一类)的具名 logger。
|
|
14
14
|
*
|
|
@@ -29,8 +29,7 @@ function traceOf(ctx, name) {
|
|
|
29
29
|
logger.debug(format, ...args);
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
//#region src/config.ts
|
|
32
|
+
// src/config.ts
|
|
34
33
|
/**
|
|
35
34
|
* dev 形态的分流配置:profile 的 `dsh.dev.exclude` 点名的包**不算开发模块**。
|
|
36
35
|
*
|
|
@@ -87,8 +86,7 @@ async function devExcluded(profileDir) {
|
|
|
87
86
|
function isAggregated(name, patterns) {
|
|
88
87
|
return patterns.some((pattern) => pattern.test(name));
|
|
89
88
|
}
|
|
90
|
-
|
|
91
|
-
//#region src/resolve.ts
|
|
89
|
+
// src/resolve.ts
|
|
92
90
|
/** 路由前缀(沿用上游的 `/plugins`,页面上不改 URL 形态)。 */
|
|
93
91
|
const PLUGIN_ROUTE = "/plugins";
|
|
94
92
|
/** `@deepseek-ai/dsh-x` → `@deepseek-ai+dsh-x`:包名里的 `/` 在 URL 段里要转义。 */
|
|
@@ -343,8 +341,7 @@ async function clientHalfOf(root, subpath) {
|
|
|
343
341
|
const conventional = (0, node_path.join)(root, "src", "client", "index.ts");
|
|
344
342
|
return await exists(conventional) ? conventional : void 0;
|
|
345
343
|
}
|
|
346
|
-
|
|
347
|
-
//#region src/bundle.ts
|
|
344
|
+
// src/bundle.ts
|
|
348
345
|
/**
|
|
349
346
|
* 客户端资源的**联邦式**产出:一个包一份产物,三方的与我们的**没有本质区别**。
|
|
350
347
|
*
|
|
@@ -784,8 +781,7 @@ async function packageJsonNear(file) {
|
|
|
784
781
|
directory = parent;
|
|
785
782
|
}
|
|
786
783
|
}
|
|
787
|
-
|
|
788
|
-
//#region src/dirs.ts
|
|
784
|
+
// src/dirs.ts
|
|
789
785
|
/** 本包自己的根(页面的骨架、`node-stub` 与依赖解析的兜底基准都从它推)。 */
|
|
790
786
|
function packageRoot() {
|
|
791
787
|
return (0, node_path.dirname)((0, node_url.fileURLToPath)(new URL("../package.json", require("url").pathToFileURL(__filename).href)));
|
|
@@ -984,8 +980,7 @@ function dshClientRowsPlugin(options) {
|
|
|
984
980
|
}
|
|
985
981
|
};
|
|
986
982
|
}
|
|
987
|
-
|
|
988
|
-
//#region src/serve-vite.ts
|
|
983
|
+
// src/serve-vite.ts
|
|
989
984
|
function rowsOf(source) {
|
|
990
985
|
return source.rows();
|
|
991
986
|
}
|
|
@@ -1085,8 +1080,7 @@ async function startViteDev(ctx, options) {
|
|
|
1085
1080
|
hmr: options.httpServer !== void 0
|
|
1086
1081
|
};
|
|
1087
1082
|
}
|
|
1088
|
-
|
|
1089
|
-
//#region src/index.ts
|
|
1083
|
+
// src/index.ts
|
|
1090
1084
|
const name = "client-modules";
|
|
1091
1085
|
const inject = ["loader", "webServer"];
|
|
1092
1086
|
/**
|
|
@@ -1127,10 +1121,17 @@ async function clientRowsOf(loader) {
|
|
|
1127
1121
|
}
|
|
1128
1122
|
return [...found.values()];
|
|
1129
1123
|
}
|
|
1130
|
-
/**
|
|
1124
|
+
/**
|
|
1125
|
+
* 打包器指纹的输入集:**只与包有关、与出口无关**(缓存按包聚合,rev 跟着出口变就等于永不命中)。
|
|
1126
|
+
*
|
|
1127
|
+
* 上游包的 `lib/` 也是打包输入:`exports` 的 `./typert` / `./remote` / `./client/typert` 指向
|
|
1128
|
+
* `lib/typert.*.ts`(`just vendor prebuild` 生成的),只盯 `src/` 时重新生成 typert 产物不会让缓存失效,
|
|
1129
|
+
* 浏览器会继续拿旧的 descriptor——例如 `terminal/retain` 仍按旧的 `workspaceFileScopeId` 发参数,宿主
|
|
1130
|
+
* 按新 descriptor 拒掉(`missing "sessionId"`)。
|
|
1131
|
+
*/
|
|
1131
1132
|
function watchOf(root, entry) {
|
|
1132
1133
|
if (root === void 0) return [entry];
|
|
1133
|
-
return root.includes("node_modules") ? [(0, node_path.join)(root, "package.json")] : [(0, node_path.join)(root, "src")];
|
|
1134
|
+
return root.includes("node_modules") ? [(0, node_path.join)(root, "package.json")] : [(0, node_path.join)(root, "src"), (0, node_path.join)(root, "lib")];
|
|
1134
1135
|
}
|
|
1135
1136
|
function apply(ctx) {
|
|
1136
1137
|
const trace = traceOf(ctx, "federation");
|
|
@@ -1439,7 +1440,7 @@ function apply(ctx) {
|
|
|
1439
1440
|
handler: serve
|
|
1440
1441
|
}), "client-modules: /plugins route");
|
|
1441
1442
|
}
|
|
1442
|
-
//#endregion
|
|
1443
1443
|
exports.apply = apply;
|
|
1444
1444
|
exports.inject = inject;
|
|
1445
1445
|
exports.name = name;
|
|
1446
|
+
exports.watchOf = watchOf;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
//#region src/index.d.ts
|
|
3
2
|
export declare const name = "client-modules";
|
|
4
3
|
export declare const inject: string[];
|
|
5
4
|
/** 一行 client 声明:包名与它的 client 半源文件。 */
|
|
@@ -9,5 +8,13 @@ export interface ClientRow {
|
|
|
9
8
|
/** 包版本:联邦地址(`@client-modules/<pkg>@<version>/<file>`)的组成部分。 */
|
|
10
9
|
version: string;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* 打包器指纹的输入集:**只与包有关、与出口无关**(缓存按包聚合,rev 跟着出口变就等于永不命中)。
|
|
13
|
+
*
|
|
14
|
+
* 上游包的 `lib/` 也是打包输入:`exports` 的 `./typert` / `./remote` / `./client/typert` 指向
|
|
15
|
+
* `lib/typert.*.ts`(`just vendor prebuild` 生成的),只盯 `src/` 时重新生成 typert 产物不会让缓存失效,
|
|
16
|
+
* 浏览器会继续拿旧的 descriptor——例如 `terminal/retain` 仍按旧的 `workspaceFileScopeId` 发参数,宿主
|
|
17
|
+
* 按新 descriptor 拒掉(`missing "sessionId"`)。
|
|
18
|
+
*/
|
|
19
|
+
export declare function watchOf(root: string | undefined, entry: string): string[];
|
|
20
|
+
export declare function apply(ctx: Context): void;
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { createHash } from "node:crypto";
|
|
|
7
7
|
import { cssInlinePlugins } from "@morlay/dsh-cordis-assets/styles";
|
|
8
8
|
import { rolldown } from "rolldown";
|
|
9
9
|
import { createServer, esmExternalRequirePlugin } from "vite";
|
|
10
|
-
|
|
10
|
+
// src/trace.ts
|
|
11
11
|
/**
|
|
12
12
|
* 诊断细节(逐包预编译、逐请求那一类)的具名 logger。
|
|
13
13
|
*
|
|
@@ -28,8 +28,7 @@ function traceOf(ctx, name) {
|
|
|
28
28
|
logger.debug(format, ...args);
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
//#region src/config.ts
|
|
31
|
+
// src/config.ts
|
|
33
32
|
/**
|
|
34
33
|
* dev 形态的分流配置:profile 的 `dsh.dev.exclude` 点名的包**不算开发模块**。
|
|
35
34
|
*
|
|
@@ -86,8 +85,7 @@ async function devExcluded(profileDir) {
|
|
|
86
85
|
function isAggregated(name, patterns) {
|
|
87
86
|
return patterns.some((pattern) => pattern.test(name));
|
|
88
87
|
}
|
|
89
|
-
|
|
90
|
-
//#region src/resolve.ts
|
|
88
|
+
// src/resolve.ts
|
|
91
89
|
/** 路由前缀(沿用上游的 `/plugins`,页面上不改 URL 形态)。 */
|
|
92
90
|
const PLUGIN_ROUTE = "/plugins";
|
|
93
91
|
/** `@deepseek-ai/dsh-x` → `@deepseek-ai+dsh-x`:包名里的 `/` 在 URL 段里要转义。 */
|
|
@@ -342,8 +340,7 @@ async function clientHalfOf(root, subpath) {
|
|
|
342
340
|
const conventional = join(root, "src", "client", "index.ts");
|
|
343
341
|
return await exists(conventional) ? conventional : void 0;
|
|
344
342
|
}
|
|
345
|
-
|
|
346
|
-
//#region src/bundle.ts
|
|
343
|
+
// src/bundle.ts
|
|
347
344
|
/**
|
|
348
345
|
* 客户端资源的**联邦式**产出:一个包一份产物,三方的与我们的**没有本质区别**。
|
|
349
346
|
*
|
|
@@ -783,8 +780,7 @@ async function packageJsonNear(file) {
|
|
|
783
780
|
directory = parent;
|
|
784
781
|
}
|
|
785
782
|
}
|
|
786
|
-
|
|
787
|
-
//#region src/dirs.ts
|
|
783
|
+
// src/dirs.ts
|
|
788
784
|
/** 本包自己的根(页面的骨架、`node-stub` 与依赖解析的兜底基准都从它推)。 */
|
|
789
785
|
function packageRoot() {
|
|
790
786
|
return dirname(fileURLToPath(new URL("../package.json", import.meta.url)));
|
|
@@ -983,8 +979,7 @@ function dshClientRowsPlugin(options) {
|
|
|
983
979
|
}
|
|
984
980
|
};
|
|
985
981
|
}
|
|
986
|
-
|
|
987
|
-
//#region src/serve-vite.ts
|
|
982
|
+
// src/serve-vite.ts
|
|
988
983
|
function rowsOf(source) {
|
|
989
984
|
return source.rows();
|
|
990
985
|
}
|
|
@@ -1084,8 +1079,7 @@ async function startViteDev(ctx, options) {
|
|
|
1084
1079
|
hmr: options.httpServer !== void 0
|
|
1085
1080
|
};
|
|
1086
1081
|
}
|
|
1087
|
-
|
|
1088
|
-
//#region src/index.ts
|
|
1082
|
+
// src/index.ts
|
|
1089
1083
|
const name = "client-modules";
|
|
1090
1084
|
const inject = ["loader", "webServer"];
|
|
1091
1085
|
/**
|
|
@@ -1126,10 +1120,17 @@ async function clientRowsOf(loader) {
|
|
|
1126
1120
|
}
|
|
1127
1121
|
return [...found.values()];
|
|
1128
1122
|
}
|
|
1129
|
-
/**
|
|
1123
|
+
/**
|
|
1124
|
+
* 打包器指纹的输入集:**只与包有关、与出口无关**(缓存按包聚合,rev 跟着出口变就等于永不命中)。
|
|
1125
|
+
*
|
|
1126
|
+
* 上游包的 `lib/` 也是打包输入:`exports` 的 `./typert` / `./remote` / `./client/typert` 指向
|
|
1127
|
+
* `lib/typert.*.ts`(`just vendor prebuild` 生成的),只盯 `src/` 时重新生成 typert 产物不会让缓存失效,
|
|
1128
|
+
* 浏览器会继续拿旧的 descriptor——例如 `terminal/retain` 仍按旧的 `workspaceFileScopeId` 发参数,宿主
|
|
1129
|
+
* 按新 descriptor 拒掉(`missing "sessionId"`)。
|
|
1130
|
+
*/
|
|
1130
1131
|
function watchOf(root, entry) {
|
|
1131
1132
|
if (root === void 0) return [entry];
|
|
1132
|
-
return root.includes("node_modules") ? [join(root, "package.json")] : [join(root, "src")];
|
|
1133
|
+
return root.includes("node_modules") ? [join(root, "package.json")] : [join(root, "src"), join(root, "lib")];
|
|
1133
1134
|
}
|
|
1134
1135
|
function apply(ctx) {
|
|
1135
1136
|
const trace = traceOf(ctx, "federation");
|
|
@@ -1438,5 +1439,4 @@ function apply(ctx) {
|
|
|
1438
1439
|
handler: serve
|
|
1439
1440
|
}), "client-modules: /plugins route");
|
|
1440
1441
|
}
|
|
1441
|
-
|
|
1442
|
-
export { apply, inject, name };
|
|
1442
|
+
export { apply, inject, name, watchOf };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morlay/dsh-client-modules",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11-alpha.0",
|
|
4
4
|
"description": "Dev-form web layer for dsh: serves the page, the app entry and every client resource through an in-process vite dev server (middleware mode) — the node-side counterpart of upstream @deepseek-ai/dsh-client-modules, with the module table replaced by vite's resolver, dependency prebundling and HMR.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -36,26 +36,27 @@
|
|
|
36
36
|
"./locale/*.json": "./locale/*.json"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@deepseek-ai/dsh-client-ui-theme": "^0.2.
|
|
40
|
-
"@deepseek-ai/dsh-host-webserver": "^0.2.
|
|
41
|
-
"@morlay/dsh-
|
|
39
|
+
"@deepseek-ai/dsh-client-ui-theme": "^0.2.2-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-host-webserver": "^0.2.2-alpha.2",
|
|
41
|
+
"@morlay/dsh-client-ui-primitives": "0.0.14-alpha.0",
|
|
42
|
+
"@morlay/dsh-cordis-assets": "0.2.10-alpha.0",
|
|
42
43
|
"@oxc-project/runtime": "^0.153.0",
|
|
43
44
|
"lightningcss": "^1.30.0",
|
|
44
45
|
"vite": "^8.3.1"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
48
|
+
"@deepseek-ai/cordis": "^4.0.6-alpha.1",
|
|
48
49
|
"@local/devkit": "0.1.0",
|
|
49
50
|
"@types/node": "^26.5.0"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
53
|
+
"@deepseek-ai/cordis": "^4.0.6-alpha.1",
|
|
53
54
|
"react": "^18.3.1",
|
|
54
55
|
"rolldown": "^1.2.14"
|
|
55
56
|
},
|
|
56
57
|
"engines": {
|
|
57
|
-
"
|
|
58
|
-
"
|
|
58
|
+
"dsh": ">= 0.2.2-alpha.2 < 0.2.3",
|
|
59
|
+
"node": ">=24.11.0"
|
|
59
60
|
},
|
|
60
61
|
"dsh": {
|
|
61
62
|
"client": {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 预编译缓存指纹的输入集:上游包的 `lib/`(typert 产物)与 `src/` 都是打包输入。
|
|
3
|
+
*
|
|
4
|
+
* 现场:`just vendor prebuild` 重新生成 `lib/typert.*.ts` 后,指纹只盯 `src/` 时会继续命中旧缓存,
|
|
5
|
+
* 浏览器拿到的还是旧 descriptor(`terminal/retain` 仍发 `workspaceFileScopeId`,宿主按新 descriptor
|
|
6
|
+
* 拒掉 `missing "sessionId"`)。
|
|
7
|
+
*/
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { expect, test } from "vitest";
|
|
10
|
+
import { watchOf } from "../index.ts";
|
|
11
|
+
|
|
12
|
+
test("上游包(非 node_modules):指纹看 src 与 lib", () => {
|
|
13
|
+
const root = join(process.cwd(), "vendor", "deepseek-harness", "packages", "api", "demo");
|
|
14
|
+
expect(watchOf(root, join(root, "src", "index.ts"))).toEqual([
|
|
15
|
+
join(root, "src"),
|
|
16
|
+
join(root, "lib"),
|
|
17
|
+
]);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("node_modules 里的三方包:只看 package.json(版本已进缓存目录名)", () => {
|
|
21
|
+
const root = join(
|
|
22
|
+
process.cwd(),
|
|
23
|
+
"node_modules",
|
|
24
|
+
".pnpm",
|
|
25
|
+
"react@18.3.1",
|
|
26
|
+
"node_modules",
|
|
27
|
+
"react",
|
|
28
|
+
);
|
|
29
|
+
expect(watchOf(root, join(root, "index.js"))).toEqual([join(root, "package.json")]);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("没有包根时退到入口文件", () => {
|
|
33
|
+
const entry = join(process.cwd(), "dist", "index.js");
|
|
34
|
+
expect(watchOf(undefined, entry)).toEqual([entry]);
|
|
35
|
+
});
|
package/src/client/index.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
// client
|
|
1
|
+
// client 半:三件事——把上游那条链缺的面补上,并给内联的 UI 基础面一个唯一装配点。
|
|
2
|
+
//
|
|
3
|
+
// 0. UI 基础面(`@morlay/dsh-client-ui-primitives`)的装配:它是内联库(不是装配行),
|
|
4
|
+
// 字典 / 字段槽 / 按行配置页只能装一次;由本行(客户端装配的根)统一调用,消费方不再各自调用
|
|
5
|
+
// (多份副本同时注册会撞 `locale namespace "settings.schema-form" already has locale "zh"`)。
|
|
2
6
|
//
|
|
3
7
|
// 1. `modules` 服务面:上游 `ui-settings-general` 的 client 插件 inject 它(有它就忽略 peer),
|
|
4
8
|
// 我们的装配停用了上游 `client-modules` 行,所以这里补一个最小实现(见文件头注释与 README)。
|
|
@@ -8,6 +12,7 @@
|
|
|
8
12
|
// 已失效的 id 一直带回来,`TerminalView` 的 `createWhenMissing` 只在「没有 saved id」时才分配新终端
|
|
9
13
|
// —— 于是面板永远停在"此终端已不存在,请新建终端",点"新建终端"复用的还是它。
|
|
10
14
|
import type { Context } from "@deepseek-ai/cordis";
|
|
15
|
+
import { apply as installUiPrimitives } from "@morlay/dsh-client-ui-primitives/client";
|
|
11
16
|
|
|
12
17
|
/** 恒 `undefined` 的可订阅快照(`useSyncExternalStore` 的入参形状)。 */
|
|
13
18
|
const NO_RELEASE_CHANGE = {
|
|
@@ -21,6 +26,8 @@ const NO_RELEASE_CHANGE = {
|
|
|
21
26
|
* @param ctx - 浏览器侧根上下文。
|
|
22
27
|
*/
|
|
23
28
|
export function apply(ctx: Context): void {
|
|
29
|
+
// 内联库的唯一装配点:`apply` 自己等依赖到齐,并在服务已在场时让位。
|
|
30
|
+
installUiPrimitives(ctx);
|
|
24
31
|
ctx.reflect.provide("modules", {
|
|
25
32
|
entries: {
|
|
26
33
|
releaseChange: NO_RELEASE_CHANGE,
|
package/src/index.ts
CHANGED
|
@@ -131,10 +131,19 @@ async function clientRowsOf(loader: { entries(): Generator<LoaderEntry> }): Prom
|
|
|
131
131
|
return [...found.values()];
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
/**
|
|
135
|
-
|
|
134
|
+
/**
|
|
135
|
+
* 打包器指纹的输入集:**只与包有关、与出口无关**(缓存按包聚合,rev 跟着出口变就等于永不命中)。
|
|
136
|
+
*
|
|
137
|
+
* 上游包的 `lib/` 也是打包输入:`exports` 的 `./typert` / `./remote` / `./client/typert` 指向
|
|
138
|
+
* `lib/typert.*.ts`(`just vendor prebuild` 生成的),只盯 `src/` 时重新生成 typert 产物不会让缓存失效,
|
|
139
|
+
* 浏览器会继续拿旧的 descriptor——例如 `terminal/retain` 仍按旧的 `workspaceFileScopeId` 发参数,宿主
|
|
140
|
+
* 按新 descriptor 拒掉(`missing "sessionId"`)。
|
|
141
|
+
*/
|
|
142
|
+
export function watchOf(root: string | undefined, entry: string): string[] {
|
|
136
143
|
if (root === undefined) return [entry];
|
|
137
|
-
return root.includes("node_modules")
|
|
144
|
+
return root.includes("node_modules")
|
|
145
|
+
? [join(root, "package.json")]
|
|
146
|
+
: [join(root, "src"), join(root, "lib")];
|
|
138
147
|
}
|
|
139
148
|
|
|
140
149
|
export function apply(ctx: Context): void {
|