@wovoon/polaris 0.6.0 → 0.6.1
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.md +10 -0
- package/dist/protocol.d.ts +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,6 +26,16 @@ room.send({ text: "你好" });
|
|
|
26
26
|
|
|
27
27
|
零构建页面可直接用平台同源下发的全局版:`<script src="/api/cloud/sdk.js"></script>` → `WovoonCloud.*`。
|
|
28
28
|
|
|
29
|
+
## 自建后端 Web 应用
|
|
30
|
+
|
|
31
|
+
从 0.6.1 起,`WovoonManifest` 类型支持可选的 `backend: "platform" | "external"`。自建后端模式将 Web 静态前端上传并托管到 wovoon,后端和数据库由作者自行部署:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{"protocol":1,"backend":"external","capabilities":[]}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
纯自建后端无需平台 SDK;同时调用平台能力时按实际用途声明 `capabilities`。前端使用绝对 HTTPS API / WSS 地址,后端配置实际运行域名的 CORS、WebSocket Origin 和独立身份校验。服务端密钥不进入前端包,平台 Cookie、令牌与运行票据不发送给外部后端。本地清单校验使用 `@wovoon/cli` 0.12.6 或更高版本。
|
|
38
|
+
|
|
29
39
|
## 资源打包最佳实践(大游戏必读)
|
|
30
40
|
|
|
31
41
|
SDK 只负责云能力;**游戏资源的加载速度取决于打包方式**。两条硬规则:
|
package/dist/protocol.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export declare function isValidCapability(value: string): boolean;
|
|
|
17
17
|
export interface WovoonManifest {
|
|
18
18
|
/** 协议版本,当前仅支持 1,缺省为 1。 */
|
|
19
19
|
protocol?: typeof WOVOON_PROTOCOL_VERSION;
|
|
20
|
+
/** Web 前端仍由平台托管;external 表示使用创作者自行部署的后端,可同时声明实际使用的平台能力。 */
|
|
21
|
+
backend?: "platform" | "external";
|
|
20
22
|
/** 声明使用的能力;未声明的能力在对应服务上线后不可调用。 */
|
|
21
23
|
capabilities?: WovoonCapability[];
|
|
22
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wovoon/polaris",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "wovoon Polaris SDK——wovoon 大后台云能力客户端(身份/数据集合/云函数/房间实时),协议 1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,4 +34,4 @@
|
|
|
34
34
|
"access": "public",
|
|
35
35
|
"registry": "https://registry.npmjs.org/"
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|