@dcl/sdk-commands 7.24.6-29505165911.commit-d270434 → 7.24.6-29864780231.commit-4d12b50
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/dist/commands/start/index.js +0 -17
- package/dist/commands/start/index.js.map +1 -1
- package/dist/commands/start/server/routes.js +0 -2
- package/dist/commands/start/server/routes.js.map +1 -1
- package/dist/commands/start/types.d.ts +0 -3
- package/dist/commands/start/utils.d.ts +0 -34
- package/dist/commands/start/utils.js +0 -104
- package/dist/commands/start/utils.js.map +1 -1
- package/dist/components/analytics.d.ts +1 -70
- package/dist/components/analytics.js +2 -3
- package/dist/components/analytics.js.map +1 -1
- package/dist/logic/bundle.d.ts +3 -1
- package/dist/logic/bundle.js +45 -55
- package/dist/logic/bundle.js.map +1 -1
- package/dist/logic/config.d.ts +0 -1
- package/dist/logic/config.js +0 -7
- package/dist/logic/config.js.map +1 -1
- package/dist/logic/error.d.ts +1 -1
- package/dist/logic/error.js.map +1 -1
- package/dist/logic/exec.d.ts +0 -1
- package/dist/logic/exec.js +2 -2
- package/dist/logic/exec.js.map +1 -1
- package/dist/logic/lang.js +1 -1
- package/dist/logic/runtime-script.js +5 -4
- package/dist/logic/runtime-script.js.map +1 -1
- package/dist/logic/runtime-script.ts +267 -0
- package/dist/logic/scene-validations.d.ts +1 -8
- package/dist/logic/scene-validations.js.map +1 -1
- package/package.json +4 -4
- package/dist/commands/sdk-server-logs/index.d.ts +0 -24
- package/dist/commands/sdk-server-logs/index.js +0 -313
- package/dist/commands/sdk-server-logs/index.js.map +0 -1
- package/dist/commands/start/hammurabi-server.d.ts +0 -19
- package/dist/commands/start/hammurabi-server.js +0 -78
- package/dist/commands/start/hammurabi-server.js.map +0 -1
- package/dist/commands/start/server/runtime-env.d.ts +0 -71
- package/dist/commands/start/server/runtime-env.js +0 -226
- package/dist/commands/start/server/runtime-env.js.map +0 -1
- package/dist/commands/start/server/storage-service.d.ts +0 -8
- package/dist/commands/start/server/storage-service.js +0 -156
- package/dist/commands/start/server/storage-service.js.map +0 -1
- package/dist/commands/storage/env.d.ts +0 -5
- package/dist/commands/storage/env.js +0 -86
- package/dist/commands/storage/env.js.map +0 -1
- package/dist/commands/storage/index.d.ts +0 -26
- package/dist/commands/storage/index.js +0 -142
- package/dist/commands/storage/index.js.map +0 -1
- package/dist/commands/storage/player.d.ts +0 -5
- package/dist/commands/storage/player.js +0 -143
- package/dist/commands/storage/player.js.map +0 -1
- package/dist/commands/storage/scene.d.ts +0 -5
- package/dist/commands/storage/scene.js +0 -105
- package/dist/commands/storage/scene.js.map +0 -1
- package/dist/commands/storage/shared.d.ts +0 -62
- package/dist/commands/storage/shared.js +0 -249
- package/dist/commands/storage/shared.js.map +0 -1
- package/dist/commands/storage/types.d.ts +0 -56
- package/dist/commands/storage/types.js +0 -23
- package/dist/commands/storage/types.js.map +0 -1
- package/dist/logic/auth-chain-headers.d.ts +0 -11
- package/dist/logic/auth-chain-headers.js +0 -25
- package/dist/logic/auth-chain-headers.js.map +0 -1
|
@@ -66,7 +66,6 @@ const beautiful_logs_1 = require("../../logic/beautiful-logs");
|
|
|
66
66
|
const project_validations_1 = require("../../logic/project-validations");
|
|
67
67
|
const explorer_alpha_1 = require("./explorer-alpha");
|
|
68
68
|
const utils_1 = require("./utils");
|
|
69
|
-
const hammurabi_server_1 = require("./hammurabi-server");
|
|
70
69
|
exports.args = (0, args_1.declareArgs)({
|
|
71
70
|
'--dir': String,
|
|
72
71
|
'--help': Boolean,
|
|
@@ -233,22 +232,6 @@ async function main(options) {
|
|
|
233
232
|
}
|
|
234
233
|
}
|
|
235
234
|
await startComponents();
|
|
236
|
-
// Start Hammurabi server if needed (stored outside components to avoid lifecycle management)
|
|
237
|
-
let hammurabiServer;
|
|
238
|
-
const project = workspace.projects[0];
|
|
239
|
-
if (project) {
|
|
240
|
-
const realm = `http://localhost:${port}`;
|
|
241
|
-
hammurabiServer = (0, hammurabi_server_1.spawnAuthServer)(components, project, realm);
|
|
242
|
-
// Register cleanup handler for hammurabi server
|
|
243
|
-
if (hammurabiServer) {
|
|
244
|
-
const cleanup = () => {
|
|
245
|
-
if (hammurabiServer && !hammurabiServer.killed) {
|
|
246
|
-
hammurabiServer.kill('SIGTERM');
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
components.signaler.programClosed.then(cleanup).catch(() => { });
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
235
|
const networkInterfaces = os.networkInterfaces();
|
|
253
236
|
const availableURLs = [];
|
|
254
237
|
(0, beautiful_logs_1.printProgressInfo)(options.components.logger, 'Preview server is now running!');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,oBAuCC;AAED,oBAwLC;AA1SD,uCAAwB;AACxB,2CAA4B;AAC5B,gDAAuB;AACvB,oDAA2B;AAG3B,oCAAqC;AACrC,2CAA8C;AAC9C,qEAA6D;AAC7D,6DAAmD;AAEnD,4DAA2E;AAC3E,kEAA6D;AAC7D,oFAAwF;AACxF,+DAAwF;AACxF,oEAA0E;AAC1E,0DAAyE;AACzE,8CAAuD;AACvD,8CAAoE;AACpE,sEAA0E;AAC1E,4CAA4C;AAC5C,oCAA+C;AAC/C,6DAA8D;AAC9D,0CAA6D;AAC7D,8DAAwE;AACxE,6EAAqE;AACrE,+DAAyG;AAEzG,yEAAkE;AAClE,qDAAmD;AACnD,mCAAmC;AAOtB,QAAA,IAAI,GAAG,IAAA,kBAAW,EAAC;IAC9B,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE,OA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G,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;oBAC7C,MAAM,IAAA,cAAI,EAAC,GAAG,CAAC,CAAA;gBACjB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAA;gBACjE,CAAC;YACH,CAAC;YACD,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;QACnD,CAAC;KACF,CAAC,CAAA;IAEF,mEAAmE;IACnE,8EAA8E;IAC9E,UAAU;IACV,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAA;AACjD,CAAC"}
|
|
@@ -10,7 +10,6 @@ const http_server_1 = require("@well-known-components/http-server");
|
|
|
10
10
|
const ws_1 = require("@well-known-components/http-server/dist/ws");
|
|
11
11
|
const ws_2 = require("../data-layer/ws");
|
|
12
12
|
const endpoints_1 = require("./endpoints");
|
|
13
|
-
const storage_service_1 = require("./storage-service");
|
|
14
13
|
const realm_1 = require("./realm");
|
|
15
14
|
const utils_1 = require("../utils");
|
|
16
15
|
exports.sceneUpdateClients = new Set();
|
|
@@ -61,7 +60,6 @@ async function wireRouter(components, workspace, dataLayer) {
|
|
|
61
60
|
};
|
|
62
61
|
});
|
|
63
62
|
(0, realm_1.setupRealmAndComms)(components, router, localSceneParcels);
|
|
64
|
-
(0, storage_service_1.setupStorageEndpoints)(components, router, workspace);
|
|
65
63
|
await (0, endpoints_1.setupEcs6Endpoints)(components, router, workspace);
|
|
66
64
|
components.server.setContext(components);
|
|
67
65
|
components.server.use(router.allowedMethods());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../../src/commands/start/server/routes.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../../src/commands/start/server/routes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AA;IACxC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAA;IAC9C,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;AAC5C,CAAC;AAED,MAAM,gBAAgB,GAAG,CAAC,EAAa,EAAE,OAAuB,EAAE,EAAE;IAClE,IAAI,EAAE,CAAC,UAAU,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACjB,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,CAAC;IACD,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;AAC1C,CAAC,CAAA"}
|
|
@@ -4,7 +4,6 @@ import { RoomComponent } from '@dcl/mini-comms/dist/adapters/rooms';
|
|
|
4
4
|
import { WebSocketComponent } from './server/ws';
|
|
5
5
|
import { CliComponents } from '../../components';
|
|
6
6
|
import { ISignalerComponent } from '../../components/exit-signal';
|
|
7
|
-
import { ChildProcess } from 'child_process';
|
|
8
7
|
export type PreviewComponents = CliComponents & {
|
|
9
8
|
logs: ILoggerComponent;
|
|
10
9
|
server: IHttpServerComponent<PreviewComponents>;
|
|
@@ -14,6 +13,4 @@ export type PreviewComponents = CliComponents & {
|
|
|
14
13
|
rooms: RoomComponent;
|
|
15
14
|
ws: WebSocketComponent;
|
|
16
15
|
signaler: ISignalerComponent;
|
|
17
|
-
/** Authoritative Server process (@dcl/hammurabi-server) */
|
|
18
|
-
hammurabiServer?: ChildProcess;
|
|
19
16
|
};
|
|
@@ -6,37 +6,3 @@ export declare function getLanIp(): string | undefined;
|
|
|
6
6
|
* Get the full LAN URL with protocol for external device access
|
|
7
7
|
*/
|
|
8
8
|
export declare function getLanUrl(port: number | string): string | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* Detects if the code is running in an Electron environment
|
|
11
|
-
*/
|
|
12
|
-
export declare function isElectronEnvironment(): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Gets the spawn environment, adding ELECTRON_RUN_AS_NODE if running in Electron
|
|
15
|
-
*/
|
|
16
|
-
export declare function getSpawnEnv(): {
|
|
17
|
-
[key: string]: string;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Gets the npm binary name (npm or npm.cmd on Windows)
|
|
21
|
-
*/
|
|
22
|
-
export declare function getNpmBin(): string;
|
|
23
|
-
/**
|
|
24
|
-
* Gets the npx binary name (npx or npx.cmd on Windows)
|
|
25
|
-
*/
|
|
26
|
-
export declare function getNpxBin(): string;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the npm-cli.js path in Electron environment, or null if not found
|
|
29
|
-
* Should only be called when isElectronEnvironment() returns true
|
|
30
|
-
*/
|
|
31
|
-
export declare function getElectronNpm(): string | null;
|
|
32
|
-
/**
|
|
33
|
-
* Attempts to find npx-cli.js on disk. Works in both regular Node.js and Electron.
|
|
34
|
-
*
|
|
35
|
-
* Tries three strategies:
|
|
36
|
-
* 1. Derive from process.execPath (standard Node.js installs, nvm, etc.)
|
|
37
|
-
* 2. Look alongside the npm binary found on PATH
|
|
38
|
-
* 3. Look inside Electron's app.asar.unpacked bundled npm (e.g. Creator Hub)
|
|
39
|
-
*
|
|
40
|
-
* Returns the absolute path to npx-cli.js, or null if not found.
|
|
41
|
-
*/
|
|
42
|
-
export declare function findNpxCliJs(): string | null;
|
|
@@ -32,24 +32,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.getLanIp = getLanIp;
|
|
40
37
|
exports.getLanUrl = getLanUrl;
|
|
41
|
-
exports.isElectronEnvironment = isElectronEnvironment;
|
|
42
|
-
exports.getSpawnEnv = getSpawnEnv;
|
|
43
|
-
exports.getNpmBin = getNpmBin;
|
|
44
|
-
exports.getNpxBin = getNpxBin;
|
|
45
|
-
exports.getElectronNpm = getElectronNpm;
|
|
46
|
-
exports.findNpxCliJs = findNpxCliJs;
|
|
47
38
|
const os = __importStar(require("os"));
|
|
48
|
-
const fs_1 = __importDefault(require("fs"));
|
|
49
|
-
const path_1 = __importDefault(require("path"));
|
|
50
|
-
// Platform-aware binary names
|
|
51
|
-
const npmBin = /^win/.test(process.platform) ? 'npm.cmd' : 'npm';
|
|
52
|
-
const npxBin = /^win/.test(process.platform) ? 'npx.cmd' : 'npx';
|
|
53
39
|
/**
|
|
54
40
|
* Get the LAN IP address for external device access (e.g., mobile preview)
|
|
55
41
|
*/
|
|
@@ -68,94 +54,4 @@ function getLanUrl(port) {
|
|
|
68
54
|
return undefined;
|
|
69
55
|
return `http://${ip}:${port}`;
|
|
70
56
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Detects if the code is running in an Electron environment
|
|
73
|
-
*/
|
|
74
|
-
function isElectronEnvironment() {
|
|
75
|
-
return typeof process.versions !== 'undefined' && 'electron' in process.versions;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Gets the spawn environment, adding ELECTRON_RUN_AS_NODE if running in Electron
|
|
79
|
-
*/
|
|
80
|
-
function getSpawnEnv() {
|
|
81
|
-
if (isElectronEnvironment()) {
|
|
82
|
-
return {
|
|
83
|
-
...process.env,
|
|
84
|
-
ELECTRON_RUN_AS_NODE: '1'
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
return process.env;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Gets the npm binary name (npm or npm.cmd on Windows)
|
|
91
|
-
*/
|
|
92
|
-
function getNpmBin() {
|
|
93
|
-
return npmBin;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Gets the npx binary name (npx or npx.cmd on Windows)
|
|
97
|
-
*/
|
|
98
|
-
function getNpxBin() {
|
|
99
|
-
return npxBin;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Gets the npm-cli.js path in Electron environment, or null if not found
|
|
103
|
-
* Should only be called when isElectronEnvironment() returns true
|
|
104
|
-
*/
|
|
105
|
-
function getElectronNpm() {
|
|
106
|
-
const npmPath = process.env.PATH?.split(path_1.default.delimiter)
|
|
107
|
-
.map((dir) => path_1.default.join(dir, npmBin))
|
|
108
|
-
.find((npm) => fs_1.default.existsSync(npm)) || npmBin;
|
|
109
|
-
if (fs_1.default.existsSync(npmPath)) {
|
|
110
|
-
const npmCliJs = path_1.default.join(path_1.default.dirname(npmPath), 'npm-cli.js');
|
|
111
|
-
if (fs_1.default.existsSync(npmCliJs)) {
|
|
112
|
-
return npmCliJs;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Attempts to find npx-cli.js on disk. Works in both regular Node.js and Electron.
|
|
119
|
-
*
|
|
120
|
-
* Tries three strategies:
|
|
121
|
-
* 1. Derive from process.execPath (standard Node.js installs, nvm, etc.)
|
|
122
|
-
* 2. Look alongside the npm binary found on PATH
|
|
123
|
-
* 3. Look inside Electron's app.asar.unpacked bundled npm (e.g. Creator Hub)
|
|
124
|
-
*
|
|
125
|
-
* Returns the absolute path to npx-cli.js, or null if not found.
|
|
126
|
-
*/
|
|
127
|
-
function findNpxCliJs() {
|
|
128
|
-
const execDir = path_1.default.dirname(process.execPath);
|
|
129
|
-
// Strategy 1: Derive from process.execPath
|
|
130
|
-
// Unix: {prefix}/bin/node -> {prefix}/lib/node_modules/npm/bin/npx-cli.js
|
|
131
|
-
// Windows: {prefix}/node.exe -> {prefix}/node_modules/npm/bin/npx-cli.js
|
|
132
|
-
const execPathCandidates = [
|
|
133
|
-
path_1.default.join(execDir, '..', 'lib', 'node_modules', 'npm', 'bin', 'npx-cli.js'),
|
|
134
|
-
path_1.default.join(execDir, 'node_modules', 'npm', 'bin', 'npx-cli.js')
|
|
135
|
-
];
|
|
136
|
-
for (const candidate of execPathCandidates) {
|
|
137
|
-
if (fs_1.default.existsSync(candidate)) {
|
|
138
|
-
return candidate;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
// Strategy 2: Find npx-cli.js next to npm on PATH
|
|
142
|
-
const npmPath = process.env.PATH?.split(path_1.default.delimiter)
|
|
143
|
-
.map((dir) => path_1.default.join(dir, npmBin))
|
|
144
|
-
.find((npm) => fs_1.default.existsSync(npm)) || npmBin;
|
|
145
|
-
if (fs_1.default.existsSync(npmPath)) {
|
|
146
|
-
const npxCliJs = path_1.default.join(path_1.default.dirname(npmPath), 'npx-cli.js');
|
|
147
|
-
if (fs_1.default.existsSync(npxCliJs)) {
|
|
148
|
-
return npxCliJs;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
// Strategy 3: Look in Electron's app.asar.unpacked bundled npm
|
|
152
|
-
const resourcesPath = process.resourcesPath;
|
|
153
|
-
if (resourcesPath) {
|
|
154
|
-
const npxCliJs = path_1.default.join(resourcesPath, 'app.asar.unpacked', 'node_modules', 'npm', 'bin', 'npx-cli.js');
|
|
155
|
-
if (fs_1.default.existsSync(npxCliJs)) {
|
|
156
|
-
return npxCliJs;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return null;
|
|
160
|
-
}
|
|
161
57
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/commands/start/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/commands/start/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,4BAKC;AAKD,8BAIC;AAnBD,uCAAwB;AAExB;;GAEG;AACH,SAAgB,QAAQ;IACtB,MAAM,iBAAiB,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAA;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC;SACpC,IAAI,EAAE;SACN,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,KAAK,WAAW,CAAC,EAAE,OAAO,CAAA;AACnH,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,IAAqB;IAC7C,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IACrB,IAAI,CAAC,EAAE;QAAE,OAAO,SAAS,CAAA;IACzB,OAAO,UAAU,EAAE,IAAI,IAAI,EAAE,CAAA;AAC/B,CAAC"}
|
|
@@ -97,77 +97,8 @@ export type Events = {
|
|
|
97
97
|
code: number;
|
|
98
98
|
creatorAddress: string;
|
|
99
99
|
};
|
|
100
|
-
'Storage Env Set Success': {
|
|
101
|
-
key: string;
|
|
102
|
-
};
|
|
103
|
-
'Storage Env Set Failure': {
|
|
104
|
-
key: string;
|
|
105
|
-
};
|
|
106
|
-
'Storage Env Delete Success': {
|
|
107
|
-
key: string;
|
|
108
|
-
};
|
|
109
|
-
'Storage Env Delete Failure': {
|
|
110
|
-
key: string;
|
|
111
|
-
};
|
|
112
|
-
'Storage Env Clear Success': Record<string, never>;
|
|
113
|
-
'Storage Env Clear Failure': Record<string, never>;
|
|
114
|
-
'Storage Scene Get Success': {
|
|
115
|
-
key: string;
|
|
116
|
-
};
|
|
117
|
-
'Storage Scene Get Failure': {
|
|
118
|
-
key: string;
|
|
119
|
-
};
|
|
120
|
-
'Storage Scene Set Success': {
|
|
121
|
-
key: string;
|
|
122
|
-
};
|
|
123
|
-
'Storage Scene Set Failure': {
|
|
124
|
-
key: string;
|
|
125
|
-
};
|
|
126
|
-
'Storage Scene Delete Success': {
|
|
127
|
-
key: string;
|
|
128
|
-
};
|
|
129
|
-
'Storage Scene Delete Failure': {
|
|
130
|
-
key: string;
|
|
131
|
-
};
|
|
132
|
-
'Storage Scene Clear Success': Record<string, never>;
|
|
133
|
-
'Storage Scene Clear Failure': Record<string, never>;
|
|
134
|
-
'Storage Player Get Success': {
|
|
135
|
-
key: string;
|
|
136
|
-
address: string;
|
|
137
|
-
};
|
|
138
|
-
'Storage Player Get Failure': {
|
|
139
|
-
key: string;
|
|
140
|
-
address: string;
|
|
141
|
-
};
|
|
142
|
-
'Storage Player Set Success': {
|
|
143
|
-
key: string;
|
|
144
|
-
address: string;
|
|
145
|
-
};
|
|
146
|
-
'Storage Player Set Failure': {
|
|
147
|
-
key: string;
|
|
148
|
-
address: string;
|
|
149
|
-
};
|
|
150
|
-
'Storage Player Delete Success': {
|
|
151
|
-
key: string;
|
|
152
|
-
address: string;
|
|
153
|
-
};
|
|
154
|
-
'Storage Player Delete Failure': {
|
|
155
|
-
key: string;
|
|
156
|
-
address: string;
|
|
157
|
-
};
|
|
158
|
-
'Storage Player Clear Success': {
|
|
159
|
-
address: string;
|
|
160
|
-
};
|
|
161
|
-
'Storage Player Clear Failure': {
|
|
162
|
-
address: string;
|
|
163
|
-
};
|
|
164
|
-
'Storage Player Clear All Success': Record<string, never>;
|
|
165
|
-
'Storage Player Clear All Failure': Record<string, never>;
|
|
166
|
-
};
|
|
167
|
-
export type CreateAnalyticsOptions = {
|
|
168
|
-
writeKey?: string;
|
|
169
100
|
};
|
|
170
|
-
export declare function createAnalyticsComponent(components: Pick<CliComponents, 'config' | 'logger' | 'fs'
|
|
101
|
+
export declare function createAnalyticsComponent(components: Pick<CliComponents, 'config' | 'logger' | 'fs'>): Promise<IAnalyticsComponent | {
|
|
171
102
|
get(): Analytics;
|
|
172
103
|
track: <T extends keyof Events>(eventName: T, eventProps: Events[T]) => void;
|
|
173
104
|
stop(): Promise<void>;
|
|
@@ -10,15 +10,14 @@ const noopAnalytics = {
|
|
|
10
10
|
track() { },
|
|
11
11
|
async stop() { }
|
|
12
12
|
};
|
|
13
|
-
async function createAnalyticsComponent(components
|
|
13
|
+
async function createAnalyticsComponent(components) {
|
|
14
14
|
const analyticsEnabled = (await (0, config_1.readStringConfig)(components, 'DCL_DISABLE_ANALYTICS')) !== 'true';
|
|
15
15
|
if (!analyticsEnabled) {
|
|
16
16
|
return noopAnalytics;
|
|
17
17
|
}
|
|
18
18
|
const USER_ID = 'sdk-commands-user';
|
|
19
19
|
let anonId = await (0, config_1.readStringConfig)(components, 'DCL_ANON_ID');
|
|
20
|
-
const
|
|
21
|
-
const analytics = new analytics_node_1.Analytics({ writeKey });
|
|
20
|
+
const analytics = new analytics_node_1.Analytics({ writeKey: (0, config_2.getSegmentKey)() });
|
|
22
21
|
if (!anonId) {
|
|
23
22
|
anonId = (0, uuid_1.v4)();
|
|
24
23
|
await (0, config_1.writeGlobalConfig)(components, 'DCL_ANON_ID', anonId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/components/analytics.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/components/analytics.ts"],"names":[],"mappings":";;AA+FA,4DA4EC;AA3KD,+BAAmC;AACnC,4DAAmD;AAGnD,+BAA8B;AAC9B,qCAAkF;AAClF,4CAAkH;AAoFlH,MAAM,aAAa,GAAwB;IACzC,KAAK,KAAI,CAAC;IACV,KAAK,CAAC,IAAI,KAAI,CAAC;CAChB,CAAA;AAEM,KAAK,UAAU,wBAAwB,CAAC,UAA2D;IACxG,MAAM,gBAAgB,GAAG,CAAC,MAAM,IAAA,yBAAgB,EAAC,UAAU,EAAE,uBAAuB,CAAC,CAAC,KAAK,MAAM,CAAA;IAEjG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,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BAAgB,IAAI,IAAI;QAC3C,GAAG,EAAE;YACH,UAAU,EAAE,MAAM;YAClB,cAAc,EAAE,UAAU;SAC3B;KACF,CAAA;IAED,SAAS,KAAK,CAAyB,SAAY,EAAE,UAAqB;QACxE,SAAS,CAAC,KAAK,CAAC;YACd,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE;gBACV,GAAG,UAAU;gBACb,GAAG,uBAAuB;aAC3B;SACF,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,GAAG;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,KAAK;QACL,KAAK,CAAC,IAAI;YACR,iFAAiF;YACjF,+EAA+E;YAC/E,oFAAoF;YACpF,MAAM,SAAS,CAAC,aAAa,EAAE,CAAA;QACjC,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/logic/bundle.d.ts
CHANGED
|
@@ -36,7 +36,9 @@ export declare function getScriptImportName(scriptPath: string): string;
|
|
|
36
36
|
export declare function generateInitializeScriptsModule(components: BundleComponents, workingDirectory: string, compositeData: {
|
|
37
37
|
scripts: Map<string, Script[]>;
|
|
38
38
|
[key: string]: any;
|
|
39
|
-
} | null
|
|
39
|
+
} | null, opts?: {
|
|
40
|
+
editorScene?: boolean;
|
|
41
|
+
}): Promise<{
|
|
40
42
|
contents: string;
|
|
41
43
|
watchFiles: string[];
|
|
42
44
|
}>;
|
package/dist/logic/bundle.js
CHANGED
|
@@ -86,31 +86,6 @@ export * from ${safeEntrypointPath}
|
|
|
86
86
|
export * from '~sdk/script-utils'
|
|
87
87
|
`;
|
|
88
88
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Ensures a key exists in a JSON file. Supports dot-separated paths (e.g. "scripts.server-logs").
|
|
91
|
-
* Silently skips if the file can't be read/written or the key already exists.
|
|
92
|
-
*/
|
|
93
|
-
async function ensureJsonKey(components, filePath, keyPath, value) {
|
|
94
|
-
try {
|
|
95
|
-
const raw = await components.fs.readFile(filePath, 'utf-8');
|
|
96
|
-
const parsed = JSON.parse(raw);
|
|
97
|
-
const keys = keyPath.split('.');
|
|
98
|
-
const lastKey = keys.pop();
|
|
99
|
-
let target = parsed;
|
|
100
|
-
for (const key of keys) {
|
|
101
|
-
target[key] = target[key] || {};
|
|
102
|
-
target = target[key];
|
|
103
|
-
}
|
|
104
|
-
if (target[lastKey] !== undefined)
|
|
105
|
-
return;
|
|
106
|
-
target[lastKey] = value;
|
|
107
|
-
await components.fs.writeFile(filePath, JSON.stringify(parsed, null, 2));
|
|
108
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Added ${log_1.colors.bold(`${keyPath}: ${JSON.stringify(value)}`)} to ${path_1.default.basename(filePath)}`);
|
|
109
|
-
}
|
|
110
|
-
catch (_) {
|
|
111
|
-
// read/write failed — skip silently
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
89
|
async function bundleProject(components, options, sceneJson) {
|
|
115
90
|
const tsconfig = path_1.default.join(options.workingDirectory, 'tsconfig.json');
|
|
116
91
|
/* istanbul ignore if */
|
|
@@ -135,12 +110,6 @@ async function bundleProject(components, options, sceneJson) {
|
|
|
135
110
|
const inputs = options.single
|
|
136
111
|
? entrypoints.map((entrypoint) => ({ entrypoint, outputFile: entrypoint.replace(/\.ts$/, '.js') }))
|
|
137
112
|
: [{ entrypoint: entrypoints[0], outputFile: sceneJson.main }];
|
|
138
|
-
// Auto-add build-time defaults for Multiplayer Auth Server scene builds
|
|
139
|
-
if (!options.single) {
|
|
140
|
-
const dir = options.workingDirectory;
|
|
141
|
-
await ensureJsonKey(components, path_1.default.join(dir, 'scene.json'), 'authoritativeMultiplayer', true);
|
|
142
|
-
await ensureJsonKey(components, path_1.default.join(dir, 'package.json'), 'scripts.server-logs', 'sdk-commands sdk-server-logs');
|
|
143
|
-
}
|
|
144
113
|
for (const input of inputs) {
|
|
145
114
|
await bundleSingleProject(components, {
|
|
146
115
|
...options,
|
|
@@ -267,7 +236,7 @@ async function bundleSingleProject(components, options) {
|
|
|
267
236
|
logOverride: {
|
|
268
237
|
'import-is-undefined': 'silent'
|
|
269
238
|
},
|
|
270
|
-
plugins: [compositeLoader(components, options)],
|
|
239
|
+
plugins: [compositeLoader(components, options, editorScene)],
|
|
271
240
|
stdin: {
|
|
272
241
|
contents: getEntrypointCode(options.entrypoint, options.customEntryPoint, editorScene),
|
|
273
242
|
resolveDir: path_1.default.dirname(options.entrypoint),
|
|
@@ -373,7 +342,7 @@ function runTypeChecker(components, options) {
|
|
|
373
342
|
}
|
|
374
343
|
return typeCheckerFuture;
|
|
375
344
|
}
|
|
376
|
-
function compositeLoader(components, options) {
|
|
345
|
+
function compositeLoader(components, options, editorScene) {
|
|
377
346
|
let shouldReload = true;
|
|
378
347
|
let compositeData = null;
|
|
379
348
|
return {
|
|
@@ -425,9 +394,9 @@ function compositeLoader(components, options) {
|
|
|
425
394
|
if (!compositeData && !options.ignoreComposite) {
|
|
426
395
|
compositeData = await (0, composite_1.getAllComposites)(components, build.initialOptions.absWorkingDir ?? options.workingDirectory);
|
|
427
396
|
}
|
|
428
|
-
const { contents, watchFiles } = await generateInitializeScriptsModule(components, options.workingDirectory, compositeData);
|
|
397
|
+
const { contents, watchFiles } = await generateInitializeScriptsModule(components, options.workingDirectory, compositeData, { editorScene });
|
|
429
398
|
return {
|
|
430
|
-
loader: '
|
|
399
|
+
loader: 'ts',
|
|
431
400
|
contents,
|
|
432
401
|
watchFiles,
|
|
433
402
|
resolveDir: options.workingDirectory
|
|
@@ -480,23 +449,13 @@ function collectScriptData(compositeData, workingDirectory) {
|
|
|
480
449
|
};
|
|
481
450
|
}
|
|
482
451
|
/**
|
|
483
|
-
* Reads
|
|
452
|
+
* Reads the runtime script TypeScript source for inlining as ESM
|
|
484
453
|
*/
|
|
485
454
|
async function prepareRuntimeCode(fs) {
|
|
486
|
-
const runtimeCodePath =
|
|
455
|
+
const runtimeCodePath = path_1.default.join(__dirname, 'runtime-script.ts');
|
|
487
456
|
const runtimeCode = await fs.readFile(runtimeCodePath, 'utf-8');
|
|
488
|
-
//
|
|
489
|
-
return (
|
|
490
|
-
.replace(/"use strict";?\s*/g, '')
|
|
491
|
-
.replace(/Object\.defineProperty\(exports,.*?\);?\s*/g, '')
|
|
492
|
-
.replace(/exports\.\w+\s*=\s*void 0;?\s*/g, '')
|
|
493
|
-
.replace(/exports\.\w+\s*=\s*/g, '')
|
|
494
|
-
.replace(/^export\s+/gm, '')
|
|
495
|
-
.replace(/^import\s+.*$/gm, '')
|
|
496
|
-
// fix nested asset-packs path (importing from @dcl/inspector is banned in runtime, but @dcl/asset-packs not)
|
|
497
|
-
.replace(/@dcl\/inspector\/node_modules\/@dcl\/asset-packs/g, '@dcl/asset-packs')
|
|
498
|
-
.replace(/\n{3,}/g, '\n\n')
|
|
499
|
-
.trim());
|
|
457
|
+
// fix nested asset-packs path (importing from @dcl/inspector is banned in scene bundles, @dcl/asset-packs is not)
|
|
458
|
+
return runtimeCode.replace(/@dcl\/inspector\/node_modules\/@dcl\/asset-packs/g, '@dcl/asset-packs');
|
|
500
459
|
}
|
|
501
460
|
/**
|
|
502
461
|
* Generates the TypeScript declaration for the ~sdk/script-utils module
|
|
@@ -527,6 +486,33 @@ async function updateSdkTypeDeclarations(components, workingDirectory, typeImpor
|
|
|
527
486
|
components.logger.error('⚠ Could not update sdk.d.ts with script types:', err);
|
|
528
487
|
}
|
|
529
488
|
}
|
|
489
|
+
/**
|
|
490
|
+
* Minimal '~sdk/script-utils' for scenes with no scripts: same export surface,
|
|
491
|
+
* empty-registry semantics, no embedded script runtime (skips the
|
|
492
|
+
* @dcl/asset-packs payload and its glue).
|
|
493
|
+
*/
|
|
494
|
+
function generateScriptStubModuleContent() {
|
|
495
|
+
return `
|
|
496
|
+
export function _initializeScripts(_engine) {}
|
|
497
|
+
|
|
498
|
+
export function getScriptInstance(_entity, _scriptPath) {
|
|
499
|
+
return null
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export function getScriptInstancesByPath(_scriptPath) {
|
|
503
|
+
return []
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export function getAllScriptInstances(_entity) {
|
|
507
|
+
return []
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export function callScriptMethod(entity, scriptPath, methodName, ..._args) {
|
|
511
|
+
console.error(\`Method \${methodName} not found on script \${scriptPath} for entity \${entity}\`)
|
|
512
|
+
return undefined
|
|
513
|
+
}
|
|
514
|
+
`;
|
|
515
|
+
}
|
|
530
516
|
/**
|
|
531
517
|
* Generates the virtual module content with script initialization and helper functions
|
|
532
518
|
*/
|
|
@@ -540,16 +526,20 @@ export function _initializeScripts(engine) {
|
|
|
540
526
|
const scriptsArray = ${scriptsArray}
|
|
541
527
|
return runScripts(engine, scriptsArray)
|
|
542
528
|
}
|
|
543
|
-
|
|
544
|
-
// export helper functions that are defined in the inlined runtime code
|
|
545
|
-
export { getScriptInstance, getScriptInstancesByPath, getAllScriptInstances, callScriptMethod }
|
|
546
529
|
`;
|
|
547
530
|
}
|
|
548
|
-
async function generateInitializeScriptsModule(components, workingDirectory, compositeData) {
|
|
549
|
-
|
|
531
|
+
async function generateInitializeScriptsModule(components, workingDirectory, compositeData, opts) {
|
|
532
|
+
const hasScripts = !!compositeData && compositeData.scripts.size > 0;
|
|
533
|
+
// scriptless non-editor scenes skip the embedded script runtime entirely
|
|
534
|
+
if (!hasScripts && !opts?.editorScene) {
|
|
535
|
+
return {
|
|
536
|
+
contents: generateScriptStubModuleContent(),
|
|
537
|
+
watchFiles: []
|
|
538
|
+
};
|
|
539
|
+
}
|
|
550
540
|
const runtimeCode = await prepareRuntimeCode(components.fs);
|
|
551
541
|
// default empty implementation if no scripts
|
|
552
|
-
if (!
|
|
542
|
+
if (!hasScripts) {
|
|
553
543
|
return {
|
|
554
544
|
contents: generateVirtualModuleContent('', runtimeCode, '[]'),
|
|
555
545
|
watchFiles: []
|