@deepseek-ai/dsh-host-webserver 0.1.2-alpha.3 → 0.1.2-alpha.4
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/README.i18n.yaml +2 -2
- package/README.md +1 -0
- package/README.zh.md +1 -0
- package/package.json +3 -10
- package/lib/invariant.js +0 -50
- package/lib/types/invariant.d.ts +0 -16
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/host/webserver/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: df1881a3a16b69f61127956127c7806c70793f91
|
|
6
|
+
README.zh.md: ccbf15ff76da653ba04cdc7395aa174343e7753a
|
package/README.md
CHANGED
|
@@ -75,6 +75,7 @@ The package is a plain route registry with no harness vocabulary: `WebServer` ex
|
|
|
75
75
|
| File | Role |
|
|
76
76
|
|---|---|
|
|
77
77
|
| [`src/index.ts`](src/index.ts) | `WebServer` service: route tables, fallback seat, index rendering, matching, lifecycle |
|
|
78
|
+
| — | No runtime invariant companion is published; route registration and disposal mutate one route table through the same service, so a register/dispose probe only re-executes the implementation. Real routing and HMR tests own the behavior. |
|
|
78
79
|
| [`src/injections.ts`](src/injections.ts) | Structured `IndexInjection` rows and `renderIndexInjections` row rendering |
|
|
79
80
|
|
|
80
81
|
</details>
|
package/README.zh.md
CHANGED
|
@@ -75,6 +75,7 @@ index 启动输入分两层。`collectIndexInjections()` 收集一张全新的
|
|
|
75
75
|
| 文件 | 职责 |
|
|
76
76
|
|---|---|
|
|
77
77
|
| [`src/index.ts`](src/index.ts) | `WebServer` 服务:路由表、回退席位、index 渲染、匹配、生命周期 |
|
|
78
|
+
| — | 不发布运行时不变式伴生入口;路由注册与释放通过同一服务修改同一张路由表,register/dispose 探针只会重复执行实现。真实路由与 HMR 测试负责该行为。 |
|
|
78
79
|
| [`src/injections.ts`](src/injections.ts) | 结构化 `IndexInjection` 行与 `renderIndexInjections` 行渲染 |
|
|
79
80
|
|
|
80
81
|
</details>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-host-webserver",
|
|
3
3
|
"description": "Web route-registration plugin: HTTP and upgrade routes, index transform taps, and static dist fallback; knows no harness concepts",
|
|
4
|
-
"version": "0.1.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,22 +18,16 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
21
|
"./src/*": "./src/*",
|
|
26
22
|
"./package.json": "./package.json"
|
|
27
23
|
},
|
|
28
24
|
"files": [
|
|
29
25
|
"lib/index.js",
|
|
30
|
-
"lib/invariant.js",
|
|
31
26
|
"lib/types/**/*.d.ts"
|
|
32
27
|
],
|
|
33
28
|
"license": "MIT",
|
|
34
29
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/cordis": "^4.0.2"
|
|
36
|
-
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3"
|
|
30
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
37
31
|
},
|
|
38
32
|
"dependencies": {
|
|
39
33
|
"compression": "^1.8.1",
|
|
@@ -43,7 +37,6 @@
|
|
|
43
37
|
"devDependencies": {
|
|
44
38
|
"@types/compression": "^1.8.1",
|
|
45
39
|
"@types/negotiator": "^0.6.5",
|
|
46
|
-
"@deepseek-ai/cordis": "^4.0.2"
|
|
47
|
-
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3"
|
|
40
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
48
41
|
}
|
|
49
42
|
}
|
package/lib/invariant.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-host-webserver`.
|
|
4
|
-
* @module @deepseek-ai/dsh-host-webserver/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-host-webserver";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "host-webserver-invariant";
|
|
9
|
-
/** Service required before the companion can register. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* Owned relation: HTTP and upgrade route registrations and their disposers must stay
|
|
13
|
-
* symmetric — after the owning fiber of a registered route unloads, the
|
|
14
|
-
* route table must no longer answer for its path (a stale route would keep
|
|
15
|
-
* serving a disposed plugin's handler). Checked on every fiber teardown
|
|
16
|
-
* (cordis 'internal/plugin'): the service's own registry state is compared
|
|
17
|
-
* against the set of live fibers' registrations indirectly, by probing that
|
|
18
|
-
* dispose really removed the entry — the register() disposer contract.
|
|
19
|
-
*/
|
|
20
|
-
const install = (ctx, fail) => {
|
|
21
|
-
ctx.on("internal/plugin", () => {
|
|
22
|
-
const server = ctx.get("webServer");
|
|
23
|
-
if (server === void 0) return;
|
|
24
|
-
const probe = {
|
|
25
|
-
kind: "exact",
|
|
26
|
-
path: "/__dsh_invariant_probe__",
|
|
27
|
-
handler: () => {}
|
|
28
|
-
};
|
|
29
|
-
try {
|
|
30
|
-
server.register(probe)();
|
|
31
|
-
server.register(probe)();
|
|
32
|
-
const upgradeProbe = {
|
|
33
|
-
path: "/__dsh_invariant_upgrade_probe__",
|
|
34
|
-
handler: () => {}
|
|
35
|
-
};
|
|
36
|
-
server.registerUpgrade(upgradeProbe)();
|
|
37
|
-
server.registerUpgrade(upgradeProbe)();
|
|
38
|
-
} catch {
|
|
39
|
-
fail("webServer route disposer left a route registered — route tables and fiber lifecycles diverged");
|
|
40
|
-
}
|
|
41
|
-
}, { global: true });
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Register this package's invariant companion.
|
|
45
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
46
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
47
|
-
*/
|
|
48
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
49
|
-
//#endregion
|
|
50
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-host-webserver`.
|
|
3
|
-
* @module @deepseek-ai/dsh-host-webserver/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "host-webserver-invariant";
|
|
8
|
-
/** Service required before the companion can register. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
-
//# sourceMappingURL=invariant.d.ts.map
|