@lingfan-engine/stories-build 0.3.1 → 0.3.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingfan-engine/stories-build",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Stories 创作链编译包:把 Stories.src 的多目录原生 TS 源编译成 Resources/Stories/** + project.json,并产出 cell 注册生成物",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
],
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@lingfan-engine/core": "^0.3.
|
|
32
|
-
"@lingfan-engine/editor": "^0.3.
|
|
31
|
+
"@lingfan-engine/core": "^0.3.2",
|
|
32
|
+
"@lingfan-engine/editor": "^0.3.2",
|
|
33
33
|
"esbuild": "^0.28.2",
|
|
34
34
|
"tsx": "^4.23.15",
|
|
35
35
|
"typescript": "~6.0.3"
|
|
@@ -27,20 +27,30 @@ export interface HostPlugin {
|
|
|
27
27
|
readonly name: string;
|
|
28
28
|
readonly resolveId: (id: string) => string | null;
|
|
29
29
|
readonly load: (id: string) => string | null;
|
|
30
|
-
|
|
30
|
+
/** 方法签名而非函数属性:理由同 `DevServerLike`,参数按双变才吃得下各版本 vite */
|
|
31
|
+
configureServer?(server: DevServerLike): void;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* dev server 的最小结构面:只用到「加监听目录、作废模块、整页刷新」三件事。
|
|
36
|
+
*
|
|
37
|
+
* 成员一律写成**方法签名**而不是函数属性。这不是风格问题:`strictFunctionTypes`
|
|
38
|
+
* 只对函数属性做参数逆变检查,方法签名按双变处理。写成属性时 `invalidateModule`
|
|
39
|
+
* 的参数会从 `unknown` 反向要求各版本 vite 的 `ModuleNode` 可赋给 `unknown`
|
|
40
|
+
* 之外的东西——vite 5 的 `(mod: ModuleNode, seen?, timestamp?, isHmr?)` 因此
|
|
41
|
+
* 判不成 `(mod: unknown) => void`,插件对象也就进不了它的 `plugins` 数组。
|
|
42
|
+
* 同一份结构面必须同时兼容 vite 5(小程序壳)与 vite 8(浏览器 / Tauri 壳)。
|
|
43
|
+
*/
|
|
34
44
|
export interface DevServerLike {
|
|
35
45
|
readonly watcher: {
|
|
36
|
-
add
|
|
37
|
-
on
|
|
46
|
+
add(paths: readonly string[]): void;
|
|
47
|
+
on(event: "add" | "unlink", listener: (file: string) => void): void;
|
|
38
48
|
};
|
|
39
49
|
readonly moduleGraph: {
|
|
40
|
-
getModuleById
|
|
41
|
-
invalidateModule
|
|
50
|
+
getModuleById(id: string): unknown;
|
|
51
|
+
invalidateModule(mod: unknown): void;
|
|
42
52
|
};
|
|
43
|
-
readonly ws: { send
|
|
53
|
+
readonly ws: { send(payload: { type: "full-reload" }): void };
|
|
44
54
|
}
|
|
45
55
|
|
|
46
56
|
/** 资源根定位选项 */
|