@dcl/sdk-commands 7.1.3-4479179155.commit-b0d720f → 7.1.3-4479720615.commit-2839aba
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.
@@ -5,11 +5,11 @@ export type IEngine = ReturnType<typeof createEngine>;
|
|
5
5
|
export type DataLayerContext = {
|
6
6
|
engine: IEngine;
|
7
7
|
};
|
8
|
-
export type
|
8
|
+
export type DataLayerRpc = {
|
9
9
|
rpcServer: RpcServer<DataLayerContext>;
|
10
10
|
/**
|
11
11
|
* we use the same engine with multiple transports for all the contexts.
|
12
12
|
*/
|
13
13
|
engine: IEngine;
|
14
14
|
};
|
15
|
-
export declare function createDataLayerRpc({ fs }: Pick<CliComponents, 'fs'>):
|
15
|
+
export declare function createDataLayerRpc({ fs }: Pick<CliComponents, 'fs'>): Promise<DataLayerRpc>;
|
@@ -27,7 +27,7 @@ exports.createDataLayerRpc = void 0;
|
|
27
27
|
const rpc_1 = require("@dcl/rpc");
|
28
28
|
const codegen = __importStar(require("@dcl/rpc/dist/codegen"));
|
29
29
|
const inspector_1 = require("@dcl/inspector");
|
30
|
-
function createDataLayerRpc({ fs }) {
|
30
|
+
async function createDataLayerRpc({ fs }) {
|
31
31
|
const engine = (0, inspector_1.createEngine)();
|
32
32
|
setInterval(() => {
|
33
33
|
engine.update(0.016).catch((err) => {
|
@@ -35,11 +35,13 @@ function createDataLayerRpc({ fs }) {
|
|
35
35
|
debugger;
|
36
36
|
});
|
37
37
|
}, 16);
|
38
|
-
|
38
|
+
// TODO: fs is not matching the types here (fs as any)
|
39
|
+
const dataLayer = await (0, inspector_1.initRpcMethods)(fs, engine);
|
39
40
|
const rpcServer = (0, rpc_1.createRpcServer)({});
|
40
41
|
rpcServer.setHandler(rpcHandler);
|
41
42
|
async function rpcHandler(serverPort) {
|
42
|
-
|
43
|
+
// TODO: dataLayer as any
|
44
|
+
codegen.registerService(serverPort, inspector_1.DataServiceDefinition, async (port, ctx) => dataLayer);
|
43
45
|
}
|
44
46
|
return { rpcServer, engine };
|
45
47
|
}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { WebSocket } from 'ws';
|
2
|
-
import {
|
3
|
-
export declare function handleDataLayerWs(ws: WebSocket, { rpcServer, engine }:
|
2
|
+
import { DataLayerRpc } from './rpc';
|
3
|
+
export declare function handleDataLayerWs(ws: WebSocket, { rpcServer, engine }: DataLayerRpc): Promise<void>;
|
@@ -162,7 +162,7 @@ async function main(options) {
|
|
162
162
|
};
|
163
163
|
},
|
164
164
|
async main({ components, startComponents }) {
|
165
|
-
const dataLayerRpc = withDataLayer ? (0, rpc_1.createDataLayerRpc)({ fs: components.fs }) : undefined;
|
165
|
+
const dataLayerRpc = withDataLayer ? await (0, rpc_1.createDataLayerRpc)({ fs: components.fs }) : undefined;
|
166
166
|
await (0, routes_1.wireRouter)(components, projectRoot, dataLayerRpc);
|
167
167
|
if (watch) {
|
168
168
|
await (0, file_watch_notifier_1.wireFileWatcherToWebSockets)(components, projectRoot);
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { PreviewComponents } from '../types';
|
2
|
-
import {
|
3
|
-
export declare function wireRouter(components: PreviewComponents, dir: string, dataLayer?:
|
2
|
+
import { DataLayerRpc } from '../data-layer/rpc';
|
3
|
+
export declare function wireRouter(components: PreviewComponents, dir: string, dataLayer?: DataLayerRpc): Promise<void>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcl/sdk-commands",
|
3
|
-
"version": "7.1.3-
|
3
|
+
"version": "7.1.3-4479720615.commit-2839aba",
|
4
4
|
"description": "",
|
5
5
|
"scripts": {
|
6
6
|
"start": "tsc -p tsconfig.json --watch",
|
@@ -16,9 +16,9 @@
|
|
16
16
|
"author": "Decentraland",
|
17
17
|
"license": "Apache-2.0",
|
18
18
|
"dependencies": {
|
19
|
-
"@dcl/dcl-rollup": "7.1.3-
|
19
|
+
"@dcl/dcl-rollup": "7.1.3-4479720615.commit-2839aba",
|
20
20
|
"@dcl/hashing": "1.1.3",
|
21
|
-
"@dcl/inspector": "7.1.3-
|
21
|
+
"@dcl/inspector": "7.1.3-4479720615.commit-2839aba",
|
22
22
|
"@dcl/linker-dapp": "0.7.0",
|
23
23
|
"@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be",
|
24
24
|
"@dcl/protocol": "1.0.0-4408137944.commit-a67c796",
|
@@ -56,5 +56,5 @@
|
|
56
56
|
"files": [
|
57
57
|
"dist"
|
58
58
|
],
|
59
|
-
"commit": "
|
59
|
+
"commit": "2839abac7c9c4f2006b23f770ecba166250c6365"
|
60
60
|
}
|