@deepseek-ai/dsh-client-hmr 0.2.0-rc.2 → 0.2.1-alpha.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/package.json +7 -13
- package/lib/invariant.js +0 -48
- package/lib/types/invariant.d.ts +0 -16
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-hmr",
|
|
3
3
|
"description": "Web client graph synchronization and rebuilt-bundle reload transport",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,10 +18,6 @@
|
|
|
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
|
"./client": {
|
|
26
22
|
"types": "./lib/types/client/index.d.ts",
|
|
27
23
|
"default": "./lib/client.js"
|
|
@@ -40,21 +36,19 @@
|
|
|
40
36
|
},
|
|
41
37
|
"license": "MIT",
|
|
42
38
|
"dependencies": {
|
|
43
|
-
"@deepseek-ai/schemastery": "~3.18.
|
|
39
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1"
|
|
44
40
|
},
|
|
45
41
|
"peerDependencies": {
|
|
46
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
42
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1"
|
|
47
43
|
},
|
|
48
44
|
"devDependencies": {
|
|
49
|
-
"@deepseek-ai/cordis-plugin-loader": "~1.0.
|
|
50
|
-
"@deepseek-ai/dsh-client-modules": "0.2.
|
|
51
|
-
"@deepseek-ai/dsh-host-webserver": "0.2.
|
|
52
|
-
"@deepseek-ai/
|
|
53
|
-
"@deepseek-ai/cordis": "~4.0.4"
|
|
45
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-client-modules": "0.2.1-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.1-alpha.2",
|
|
48
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1"
|
|
54
49
|
},
|
|
55
50
|
"files": [
|
|
56
51
|
"lib/index.js",
|
|
57
|
-
"lib/invariant.js",
|
|
58
52
|
"lib/client.js",
|
|
59
53
|
"lib/types/**/*.d.ts"
|
|
60
54
|
]
|
package/lib/invariant.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-client-hmr`.
|
|
4
|
-
* @module @deepseek-ai/dsh-client-hmr/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-client-hmr";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "client-hmr-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/** Live fs.watchFile pollers (this package is the composition's only stat-poll user). */
|
|
12
|
-
function statWatchers() {
|
|
13
|
-
return process.getActiveResourcesInfo().filter((kind) => kind === "StatWatcher").length;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Owned relation: every bundle stat watcher the node half starts must die
|
|
17
|
-
* with its fiber — a surviving poller would keep re-hashing bundles for a
|
|
18
|
-
* torn-down dev chain forever. Checked as a baseline delta: the StatWatcher
|
|
19
|
-
* count observed at fiber creation must be restored once disposal has drained
|
|
20
|
-
* the fiber's effects (`internal/plugin` fires at dispose start; the microtask
|
|
21
|
-
* hop lets the disposer queue its unload before `fiber.await()` joins it).
|
|
22
|
-
* SSE-connection and listener teardown live inside the same ctx.effect
|
|
23
|
-
* disposers, so the watcher count is the relation's observable proxy.
|
|
24
|
-
*/
|
|
25
|
-
const install = (ctx, fail) => {
|
|
26
|
-
const baselines = /* @__PURE__ */ new WeakMap();
|
|
27
|
-
ctx.on("internal/plugin", async (fiber) => {
|
|
28
|
-
if (fiber.name !== "client-hmr") return;
|
|
29
|
-
if (fiber.uid !== null) {
|
|
30
|
-
baselines.set(fiber, statWatchers());
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const baseline = baselines.get(fiber);
|
|
34
|
-
if (baseline === void 0) return;
|
|
35
|
-
await Promise.resolve();
|
|
36
|
-
await fiber.await();
|
|
37
|
-
const remaining = statWatchers();
|
|
38
|
-
if (remaining > baseline) fail(`client-hmr fiber disposed but ${remaining - baseline} bundle stat watcher(s) survived teardown`);
|
|
39
|
-
}, { global: true });
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Register this package's invariant companion.
|
|
43
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
44
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
45
|
-
*/
|
|
46
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
47
|
-
//#endregion
|
|
48
|
-
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-client-hmr`.
|
|
3
|
-
* @module @deepseek-ai/dsh-client-hmr/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "client-hmr-invariant";
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
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
|