@dcl-regenesislabs/sdk-commands 0.0.0-stage → 7.0.0-42707159203.commit-ff138cd

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.
Files changed (250) hide show
  1. package/.dclrc +19 -0
  2. package/LICENSE +201 -0
  3. package/README.md +106 -2
  4. package/dist/commands/build/index.d.ts +23 -0
  5. package/dist/commands/build/index.js +80 -0
  6. package/dist/commands/build/index.js.map +1 -0
  7. package/dist/commands/code-to-composite/asset-migrator.d.ts +25 -0
  8. package/dist/commands/code-to-composite/asset-migrator.js +238 -0
  9. package/dist/commands/code-to-composite/asset-migrator.js.map +1 -0
  10. package/dist/commands/code-to-composite/code-commenter.d.ts +11 -0
  11. package/dist/commands/code-to-composite/code-commenter.js +87 -0
  12. package/dist/commands/code-to-composite/code-commenter.js.map +1 -0
  13. package/dist/commands/code-to-composite/composite-generator.d.ts +6 -0
  14. package/dist/commands/code-to-composite/composite-generator.js +65 -0
  15. package/dist/commands/code-to-composite/composite-generator.js.map +1 -0
  16. package/dist/commands/code-to-composite/index.d.ts +16 -0
  17. package/dist/commands/code-to-composite/index.js +130 -0
  18. package/dist/commands/code-to-composite/index.js.map +1 -0
  19. package/dist/commands/code-to-composite/name-generator.d.ts +9 -0
  20. package/dist/commands/code-to-composite/name-generator.js +139 -0
  21. package/dist/commands/code-to-composite/name-generator.js.map +1 -0
  22. package/dist/commands/code-to-composite/scene-executor.d.ts +15 -0
  23. package/dist/commands/code-to-composite/scene-executor.js +421 -0
  24. package/dist/commands/code-to-composite/scene-executor.js.map +1 -0
  25. package/dist/commands/deploy/analytics-features.d.ts +4 -0
  26. package/dist/commands/deploy/analytics-features.js +11 -0
  27. package/dist/commands/deploy/analytics-features.js.map +1 -0
  28. package/dist/commands/deploy/deployment.d.ts +51 -0
  29. package/dist/commands/deploy/deployment.js +122 -0
  30. package/dist/commands/deploy/deployment.js.map +1 -0
  31. package/dist/commands/deploy/index.d.ts +37 -0
  32. package/dist/commands/deploy/index.js +312 -0
  33. package/dist/commands/deploy/index.js.map +1 -0
  34. package/dist/commands/deploy/routes.d.ts +27 -0
  35. package/dist/commands/deploy/routes.js +144 -0
  36. package/dist/commands/deploy/routes.js.map +1 -0
  37. package/dist/commands/deploy/state.d.ts +60 -0
  38. package/dist/commands/deploy/state.js +144 -0
  39. package/dist/commands/deploy/state.js.map +1 -0
  40. package/dist/commands/deploy/upload.d.ts +23 -0
  41. package/dist/commands/deploy/upload.js +120 -0
  42. package/dist/commands/deploy/upload.js.map +1 -0
  43. package/dist/commands/deploy/utils.d.ts +131 -0
  44. package/dist/commands/deploy/utils.js +432 -0
  45. package/dist/commands/deploy/utils.js.map +1 -0
  46. package/dist/commands/export-static/index.d.ts +27 -0
  47. package/dist/commands/export-static/index.js +155 -0
  48. package/dist/commands/export-static/index.js.map +1 -0
  49. package/dist/commands/get-context-files/index.d.ts +12 -0
  50. package/dist/commands/get-context-files/index.js +119 -0
  51. package/dist/commands/get-context-files/index.js.map +1 -0
  52. package/dist/commands/init/download-github-folder.d.ts +2 -0
  53. package/dist/commands/init/download-github-folder.js +69 -0
  54. package/dist/commands/init/download-github-folder.js.map +1 -0
  55. package/dist/commands/init/index.d.ts +18 -0
  56. package/dist/commands/init/index.js +98 -0
  57. package/dist/commands/init/index.js.map +1 -0
  58. package/dist/commands/init/project.d.ts +7 -0
  59. package/dist/commands/init/project.js +36 -0
  60. package/dist/commands/init/project.js.map +1 -0
  61. package/dist/commands/init/repos.d.ts +4 -0
  62. package/dist/commands/init/repos.js +21 -0
  63. package/dist/commands/init/repos.js.map +1 -0
  64. package/dist/commands/pack-smart-wearable/index.d.ts +16 -0
  65. package/dist/commands/pack-smart-wearable/index.js +108 -0
  66. package/dist/commands/pack-smart-wearable/index.js.map +1 -0
  67. package/dist/commands/quests/index.d.ts +28 -0
  68. package/dist/commands/quests/index.js +271 -0
  69. package/dist/commands/quests/index.js.map +1 -0
  70. package/dist/commands/quests/types.d.ts +41 -0
  71. package/dist/commands/quests/types.js +3 -0
  72. package/dist/commands/quests/types.js.map +1 -0
  73. package/dist/commands/quests/utils.d.ts +20 -0
  74. package/dist/commands/quests/utils.js +253 -0
  75. package/dist/commands/quests/utils.js.map +1 -0
  76. package/dist/commands/start/data-layer/fs.d.ts +8 -0
  77. package/dist/commands/start/data-layer/fs.js +73 -0
  78. package/dist/commands/start/data-layer/fs.js.map +1 -0
  79. package/dist/commands/start/data-layer/rpc.d.ts +8 -0
  80. package/dist/commands/start/data-layer/rpc.js +54 -0
  81. package/dist/commands/start/data-layer/rpc.js.map +1 -0
  82. package/dist/commands/start/data-layer/ws.d.ts +4 -0
  83. package/dist/commands/start/data-layer/ws.js +17 -0
  84. package/dist/commands/start/data-layer/ws.js.map +1 -0
  85. package/dist/commands/start/explorer-alpha.d.ts +19 -0
  86. package/dist/commands/start/explorer-alpha.js +109 -0
  87. package/dist/commands/start/explorer-alpha.js.map +1 -0
  88. package/dist/commands/start/index.d.ts +46 -0
  89. package/dist/commands/start/index.js +300 -0
  90. package/dist/commands/start/index.js.map +1 -0
  91. package/dist/commands/start/server/endpoints.d.ts +5 -0
  92. package/dist/commands/start/server/endpoints.js +417 -0
  93. package/dist/commands/start/server/endpoints.js.map +1 -0
  94. package/dist/commands/start/server/file-watch-notifier.d.ts +12 -0
  95. package/dist/commands/start/server/file-watch-notifier.js +96 -0
  96. package/dist/commands/start/server/file-watch-notifier.js.map +1 -0
  97. package/dist/commands/start/server/realm.d.ts +7 -0
  98. package/dist/commands/start/server/realm.js +58 -0
  99. package/dist/commands/start/server/realm.js.map +1 -0
  100. package/dist/commands/start/server/routes.d.ts +6 -0
  101. package/dist/commands/start/server/routes.js +77 -0
  102. package/dist/commands/start/server/routes.js.map +1 -0
  103. package/dist/commands/start/server/ws.d.ts +11 -0
  104. package/dist/commands/start/server/ws.js +19 -0
  105. package/dist/commands/start/server/ws.js.map +1 -0
  106. package/dist/commands/start/types.d.ts +16 -0
  107. package/dist/commands/start/types.js +3 -0
  108. package/dist/commands/start/types.js.map +1 -0
  109. package/dist/commands/start/utils.d.ts +8 -0
  110. package/dist/commands/start/utils.js +57 -0
  111. package/dist/commands/start/utils.js.map +1 -0
  112. package/dist/components/analytics.d.ts +105 -0
  113. package/dist/components/analytics.js +76 -0
  114. package/dist/components/analytics.js.map +1 -0
  115. package/dist/components/config.d.ts +18 -0
  116. package/dist/components/config.js +58 -0
  117. package/dist/components/config.js.map +1 -0
  118. package/dist/components/eth.d.ts +2 -0
  119. package/dist/components/eth.js +6 -0
  120. package/dist/components/eth.js.map +1 -0
  121. package/dist/components/exit-signal.d.ts +5 -0
  122. package/dist/components/exit-signal.js +21 -0
  123. package/dist/components/exit-signal.js.map +1 -0
  124. package/dist/components/fetch.d.ts +6 -0
  125. package/dist/components/fetch.js +9 -0
  126. package/dist/components/fetch.js.map +1 -0
  127. package/dist/components/fs.d.ts +18 -0
  128. package/dist/components/fs.js +85 -0
  129. package/dist/components/fs.js.map +1 -0
  130. package/dist/components/index.d.ts +14 -0
  131. package/dist/components/index.js +25 -0
  132. package/dist/components/index.js.map +1 -0
  133. package/dist/components/log.d.ts +24 -0
  134. package/dist/components/log.js +67 -0
  135. package/dist/components/log.js.map +1 -0
  136. package/dist/generated/decentraland/common/border_rect.gen.d.ts +49 -0
  137. package/dist/generated/decentraland/common/border_rect.gen.js +199 -0
  138. package/dist/generated/decentraland/common/border_rect.gen.js.map +1 -0
  139. package/dist/generated/decentraland/common/vectors.gen.d.ts +71 -0
  140. package/dist/generated/decentraland/common/vectors.gen.js +334 -0
  141. package/dist/generated/decentraland/common/vectors.gen.js.map +1 -0
  142. package/dist/generated/decentraland/realm/about.gen.d.ts +229 -0
  143. package/dist/generated/decentraland/realm/about.gen.js +1175 -0
  144. package/dist/generated/decentraland/realm/about.gen.js.map +1 -0
  145. package/dist/generated/decentraland/sdk/development/local_development.gen.d.ts +70 -0
  146. package/dist/generated/decentraland/sdk/development/local_development.gen.js +278 -0
  147. package/dist/generated/decentraland/sdk/development/local_development.gen.js.map +1 -0
  148. package/dist/index.d.ts +2 -0
  149. package/dist/index.js +37 -0
  150. package/dist/index.js.map +1 -0
  151. package/dist/linker-dapp/routes.d.ts +32 -0
  152. package/dist/linker-dapp/routes.js +140 -0
  153. package/dist/linker-dapp/routes.js.map +1 -0
  154. package/dist/locales/en.json +84 -0
  155. package/dist/locales/es.json +84 -0
  156. package/dist/locales/zh.json +84 -0
  157. package/dist/logic/account.d.ts +6 -0
  158. package/dist/logic/account.js +25 -0
  159. package/dist/logic/account.js.map +1 -0
  160. package/dist/logic/args.d.ts +6 -0
  161. package/dist/logic/args.js +25 -0
  162. package/dist/logic/args.js.map +1 -0
  163. package/dist/logic/beautiful-logs.d.ts +14 -0
  164. package/dist/logic/beautiful-logs.js +55 -0
  165. package/dist/logic/beautiful-logs.js.map +1 -0
  166. package/dist/logic/bundle.d.ts +47 -0
  167. package/dist/logic/bundle.js +573 -0
  168. package/dist/logic/bundle.js.map +1 -0
  169. package/dist/logic/catalyst-requests.d.ts +20 -0
  170. package/dist/logic/catalyst-requests.js +54 -0
  171. package/dist/logic/catalyst-requests.js.map +1 -0
  172. package/dist/logic/commands.d.ts +3 -0
  173. package/dist/logic/commands.js +30 -0
  174. package/dist/logic/commands.js.map +1 -0
  175. package/dist/logic/composite.d.ts +15 -0
  176. package/dist/logic/composite.js +105 -0
  177. package/dist/logic/composite.js.map +1 -0
  178. package/dist/logic/config.d.ts +24 -0
  179. package/dist/logic/config.js +88 -0
  180. package/dist/logic/config.js.map +1 -0
  181. package/dist/logic/coordinates.d.ts +14 -0
  182. package/dist/logic/coordinates.js +31 -0
  183. package/dist/logic/coordinates.js.map +1 -0
  184. package/dist/logic/dcl-ignore.d.ts +8 -0
  185. package/dist/logic/dcl-ignore.js +53 -0
  186. package/dist/logic/dcl-ignore.js.map +1 -0
  187. package/dist/logic/debounce.d.ts +1 -0
  188. package/dist/logic/debounce.js +11 -0
  189. package/dist/logic/debounce.js.map +1 -0
  190. package/dist/logic/error.d.ts +7 -0
  191. package/dist/logic/error.js +13 -0
  192. package/dist/logic/error.js.map +1 -0
  193. package/dist/logic/exec.d.ts +12 -0
  194. package/dist/logic/exec.js +40 -0
  195. package/dist/logic/exec.js.map +1 -0
  196. package/dist/logic/fetch.d.ts +25 -0
  197. package/dist/logic/fetch.js +42 -0
  198. package/dist/logic/fetch.js.map +1 -0
  199. package/dist/logic/fs.d.ts +33 -0
  200. package/dist/logic/fs.js +57 -0
  201. package/dist/logic/fs.js.map +1 -0
  202. package/dist/logic/future.d.ts +6 -0
  203. package/dist/logic/future.js +14 -0
  204. package/dist/logic/future.js.map +1 -0
  205. package/dist/logic/get-free-port.d.ts +1 -0
  206. package/dist/logic/get-free-port.js +70 -0
  207. package/dist/logic/get-free-port.js.map +1 -0
  208. package/dist/logic/lang.d.ts +7 -0
  209. package/dist/logic/lang.js +41 -0
  210. package/dist/logic/lang.js.map +1 -0
  211. package/dist/logic/open.d.ts +1 -0
  212. package/dist/logic/open.js +41 -0
  213. package/dist/logic/open.js.map +1 -0
  214. package/dist/logic/portable-experience-sw-validations.d.ts +18 -0
  215. package/dist/logic/portable-experience-sw-validations.js +48 -0
  216. package/dist/logic/portable-experience-sw-validations.js.map +1 -0
  217. package/dist/logic/project-files.d.ts +40 -0
  218. package/dist/logic/project-files.js +158 -0
  219. package/dist/logic/project-files.js.map +1 -0
  220. package/dist/logic/project-validations.d.ts +45 -0
  221. package/dist/logic/project-validations.js +143 -0
  222. package/dist/logic/project-validations.js.map +1 -0
  223. package/dist/logic/promise-utils.d.ts +1 -0
  224. package/dist/logic/promise-utils.js +20 -0
  225. package/dist/logic/promise-utils.js.map +1 -0
  226. package/dist/logic/prompts.d.ts +23 -0
  227. package/dist/logic/prompts.js +74 -0
  228. package/dist/logic/prompts.js.map +1 -0
  229. package/dist/logic/realm.d.ts +3 -0
  230. package/dist/logic/realm.js +32 -0
  231. package/dist/logic/realm.js.map +1 -0
  232. package/dist/logic/runtime-script.d.ts +42 -0
  233. package/dist/logic/runtime-script.js +217 -0
  234. package/dist/logic/runtime-script.js.map +1 -0
  235. package/dist/logic/runtime-script.ts +270 -0
  236. package/dist/logic/scene-validations.d.ts +35 -0
  237. package/dist/logic/scene-validations.js +135 -0
  238. package/dist/logic/scene-validations.js.map +1 -0
  239. package/dist/logic/script-module.d.ts.template +87 -0
  240. package/dist/logic/workspace-validations.d.ts +27 -0
  241. package/dist/logic/workspace-validations.js +136 -0
  242. package/dist/logic/workspace-validations.js.map +1 -0
  243. package/dist/run-command.d.ts +7 -0
  244. package/dist/run-command.js +95 -0
  245. package/dist/run-command.js.map +1 -0
  246. package/dist/run-dapp.d.ts +23 -0
  247. package/dist/run-dapp.js +66 -0
  248. package/dist/run-dapp.js.map +1 -0
  249. package/package.json +74 -3
  250. package/scripts/postinstall.js +17 -0
@@ -0,0 +1,45 @@
1
+ import { Scene } from '@dcl/schemas';
2
+ import { CliComponents } from '../components';
3
+ export type BaseProject = {
4
+ workingDirectory: string;
5
+ };
6
+ export type SceneProject = {
7
+ kind: 'scene';
8
+ scene: Scene;
9
+ } & BaseProject;
10
+ export type WearableProject = {
11
+ kind: 'smart-wearable';
12
+ scene: Scene;
13
+ } & BaseProject;
14
+ export type ProjectUnion = SceneProject | WearableProject;
15
+ /**
16
+ * Asserts that the workingDirectory is a valid project
17
+ */
18
+ export declare function assertValidProjectFolder(components: Pick<CliComponents, 'fs' | 'logger'>, workingDirectory: string): Promise<ProjectUnion>;
19
+ export declare function needsDependencies(components: Pick<CliComponents, 'fs'>, workingDirectory: string): Promise<boolean>;
20
+ export declare function installDependencies(components: Pick<CliComponents, 'logger' | 'spawner' | 'fs'>, workingDirectory: string): Promise<void>;
21
+ /**
22
+ * Run NPM commands
23
+ */
24
+ export declare function npmRun(components: Pick<CliComponents, 'spawner'>, cwd: string, command: string, ...args: string[]): Promise<void>;
25
+ /**
26
+ * NPM commands
27
+ */
28
+ export declare function npmCommand(components: Pick<CliComponents, 'spawner'>, cwd: string, command: string, ...args: string[]): Promise<void>;
29
+ /**
30
+ * Start validations to make the scene work.
31
+ * Addd js-runtime package, so you can auto-import all the ~system modules.
32
+ */
33
+ export declare function startValidations(components: Pick<CliComponents, 'spawner' | 'fs' | 'logger'>, cwd: string): Promise<void>;
34
+ /**
35
+ * Returns true if the scene is an "editor scene" that requires the asset-packs runtime.
36
+ *
37
+ * A scene is an editor scene when its main.composite file contains at least one
38
+ * asset-packs component other than `asset-packs::Script`. The Script component is
39
+ * a build-time-only construct (it defines JavaScript scripts bundled separately via
40
+ * `generateInitializeScriptsModule`) and does not require the `initAssetPacks` runtime.
41
+ * Only Action/Trigger/State and similar runtime components need `initAssetPacks`.
42
+ *
43
+ * Evaluated on every (re)build when `~sdk/script-utils` is generated.
44
+ */
45
+ export declare function isEditorScene(components: Pick<CliComponents, 'fs'>, workingDirectory: string): Promise<boolean>;
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.assertValidProjectFolder = assertValidProjectFolder;
7
+ exports.needsDependencies = needsDependencies;
8
+ exports.installDependencies = installDependencies;
9
+ exports.npmRun = npmRun;
10
+ exports.npmCommand = npmCommand;
11
+ exports.startValidations = startValidations;
12
+ exports.isEditorScene = isEditorScene;
13
+ const path_1 = __importDefault(require("path"));
14
+ const i18next_1 = __importDefault(require("i18next"));
15
+ const log_1 = require("../components/log");
16
+ const beautiful_logs_1 = require("./beautiful-logs");
17
+ const error_1 = require("./error");
18
+ const scene_validations_1 = require("./scene-validations");
19
+ const config_1 = require("./config");
20
+ const portable_experience_sw_validations_1 = require("./portable-experience-sw-validations");
21
+ const project_files_1 = require("./project-files");
22
+ /**
23
+ * Asserts that the workingDirectory is a valid project
24
+ */
25
+ async function assertValidProjectFolder(components, workingDirectory) {
26
+ // no validations for now, only check that it exists
27
+ if (!(await components.fs.fileExists(path_1.default.resolve(workingDirectory, 'package.json'))))
28
+ throw new error_1.CliError('PROJECT_VALIDATIONS_PACKAGE_JSON_REQUIRED', i18next_1.default.t('errors.project_validations.package_json_required'));
29
+ // now we will iterate over different file to evaluate the project kind
30
+ switch (true) {
31
+ case await components.fs.fileExists((0, portable_experience_sw_validations_1.getSmartWearableFile)(workingDirectory)): {
32
+ await (0, portable_experience_sw_validations_1.getValidWearableJson)(components, workingDirectory);
33
+ return { kind: 'smart-wearable', scene: await (0, scene_validations_1.getValidSceneJson)(components, workingDirectory), workingDirectory };
34
+ }
35
+ case await components.fs.fileExists((0, scene_validations_1.getSceneFilePath)(workingDirectory)): {
36
+ return { kind: 'scene', scene: await (0, scene_validations_1.getValidSceneJson)(components, workingDirectory), workingDirectory };
37
+ }
38
+ default: {
39
+ throw new error_1.CliError('PROJECT_VALIDATIONS_INVALID_PROJECT_KIND', i18next_1.default.t('errors.project_validations.invalid_project_kind', { workingDirectory }));
40
+ }
41
+ }
42
+ }
43
+ /*
44
+ * Returns true if the project contains an empty node_modules folder
45
+ */
46
+ async function needsDependencies(components, workingDirectory) {
47
+ const nodeModulesPath = path_1.default.join(workingDirectory, 'node_modules');
48
+ const hasNodeModulesFolder = await components.fs.directoryExists(nodeModulesPath);
49
+ const isNodeModulesEmpty = hasNodeModulesFolder && (await components.fs.readdir(nodeModulesPath)).length === 0;
50
+ return !hasNodeModulesFolder || isNodeModulesEmpty;
51
+ }
52
+ /* istanbul ignore next */
53
+ const npmBin = /^win/.test(process.platform) ? 'npm.cmd' : 'npm';
54
+ /*
55
+ * Runs "npm install" for desired project
56
+ */
57
+ async function installDependencies(components, workingDirectory) {
58
+ (0, beautiful_logs_1.printProgressInfo)(components.logger, 'Installing dependencies...');
59
+ // TODO: test in windows
60
+ await components.spawner.exec(workingDirectory, npmBin, ['install']);
61
+ (0, beautiful_logs_1.printProgressInfo)(components.logger, log_1.colors.white('✅ Installing dependencies...'));
62
+ }
63
+ /**
64
+ * Run NPM commands
65
+ */
66
+ async function npmRun(components, cwd, command, ...args) {
67
+ // TODO: test in windows
68
+ await components.spawner.exec(cwd, npmBin, ['run', command, '--silent', '--', ...args], { env: process.env });
69
+ }
70
+ /**
71
+ * NPM commands
72
+ */
73
+ async function npmCommand(components, cwd, command, ...args) {
74
+ await components.spawner.exec(cwd, npmBin, [command, ...args, '--silent'], { env: process.env });
75
+ }
76
+ /**
77
+ * Start validations to make the scene work.
78
+ * Addd js-runtime package, so you can auto-import all the ~system modules.
79
+ */
80
+ async function startValidations(components, cwd) {
81
+ try {
82
+ const sdkVersion = await (0, config_1.getInstalledPackageVersion)(components, '@dcl/sdk', cwd);
83
+ const packageJsonPath = path_1.default.resolve(cwd, 'package.json');
84
+ if (!(await components.fs.fileExists(packageJsonPath))) {
85
+ return;
86
+ }
87
+ const packageJson = await (0, project_files_1.getPackageJson)(components, cwd);
88
+ // Ignore relative or s3 versions
89
+ const sdkPackageVersion = (packageJson.dependencies && packageJson.dependencies['@dcl/sdk']) ||
90
+ (packageJson.devDependencies && packageJson.devDependencies['@dcl/sdk']);
91
+ if (sdkPackageVersion?.startsWith('https://') ||
92
+ sdkPackageVersion?.startsWith('file://') ||
93
+ sdkPackageVersion === '7.0.0') {
94
+ return;
95
+ }
96
+ if (packageJson.dependencies &&
97
+ (packageJson.dependencies['@dcl/js-runtime'] || packageJson.dependencies['@dcl/sdk'])) {
98
+ packageJson.dependencies['@dcl/js-runtime'] = sdkVersion;
99
+ if (packageJson.devDependencies && packageJson.devDependencies['@dcl/js-runtime']) {
100
+ delete packageJson.devDependencies['@dcl/js-runtime'];
101
+ }
102
+ }
103
+ else {
104
+ packageJson.devDependencies = packageJson.devDependencies || {};
105
+ packageJson.devDependencies['@dcl/js-runtime'] = sdkVersion;
106
+ }
107
+ await components.fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf-8');
108
+ }
109
+ catch (e) {
110
+ components.logger.error('Failed to run scene validations', e.message);
111
+ }
112
+ }
113
+ /**
114
+ * Returns true if the scene is an "editor scene" that requires the asset-packs runtime.
115
+ *
116
+ * A scene is an editor scene when its main.composite file contains at least one
117
+ * asset-packs component other than `asset-packs::Script`. The Script component is
118
+ * a build-time-only construct (it defines JavaScript scripts bundled separately via
119
+ * `generateInitializeScriptsModule`) and does not require the `initAssetPacks` runtime.
120
+ * Only Action/Trigger/State and similar runtime components need `initAssetPacks`.
121
+ *
122
+ * Evaluated on every (re)build when `~sdk/script-utils` is generated.
123
+ */
124
+ async function isEditorScene(components, workingDirectory) {
125
+ const mainCompositePath = path_1.default.resolve(workingDirectory, 'assets', 'scene', 'main.composite');
126
+ if (!(await components.fs.fileExists(mainCompositePath)))
127
+ return false;
128
+ try {
129
+ const fileBuffer = await components.fs.readFile(mainCompositePath);
130
+ const json = JSON.parse(new TextDecoder().decode(fileBuffer));
131
+ // asset-packs::Script is a build-time component — it doesn't require the initAssetPacks runtime entrypoint.
132
+ const SCRIPT_COMPONENT = 'asset-packs::Script';
133
+ return (Array.isArray(json.components) &&
134
+ json.components.some((c) => typeof c.name === 'string' &&
135
+ c.name.startsWith('asset-packs::') &&
136
+ c.name !== SCRIPT_COMPONENT));
137
+ }
138
+ catch {
139
+ // Malformed composite — treat as non-editor scene to avoid bundling unnecessary code
140
+ return false;
141
+ }
142
+ }
143
+ //# sourceMappingURL=project-validations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-validations.js","sourceRoot":"","sources":["../../src/logic/project-validations.ts"],"names":[],"mappings":";;;;;AAqBA,4DA6BC;AAKD,8CASC;AAQD,kDAQC;AAKD,wBAQC;AAKD,gCAOC;AAMD,4CAsCC;AAaD,sCAsBC;AAvLD,gDAAuB;AACvB,sDAA6B;AAG7B,2CAA0C;AAC1C,qDAAoD;AACpD,mCAAkC;AAClC,2DAAyE;AACzE,qCAAqD;AACrD,6FAAiG;AACjG,mDAAgD;AAOhD;;GAEG;AACI,KAAK,UAAU,wBAAwB,CAC5C,UAAgD,EAChD,gBAAwB;IAExB,oDAAoD;IACpD,IAAI,CAAC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IAAI,KAAK,QAAQ;gBACrD,CAA6B,CAAC,IAAe,CAAC,UAAU,CAAC,eAAe,CAAC;gBAC1E,CAA6B,CAAC,IAAI,KAAK,gBAAgB,CAC3D,CACF,CAAA;IACH,CAAC;IAAC,MAAM,CAAC;QACP,qFAAqF;QACrF,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function concurrentMap<T, R>(values: readonly T[], mapper: (value: T, index: number) => Promise<R>, concurrency?: number): Promise<R[]>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.concurrentMap = concurrentMap;
4
+ const DEFAULT_CONCURRENCY = 32;
5
+ async function concurrentMap(values, mapper, concurrency = DEFAULT_CONCURRENCY) {
6
+ if (values.length === 0)
7
+ return [];
8
+ const results = new Array(values.length);
9
+ let nextIndex = 0;
10
+ async function worker() {
11
+ while (nextIndex < values.length) {
12
+ const currentIndex = nextIndex++;
13
+ results[currentIndex] = await mapper(values[currentIndex], currentIndex);
14
+ }
15
+ }
16
+ const workerCount = Math.min(Math.max(1, concurrency), values.length);
17
+ await Promise.all(Array.from({ length: workerCount }, worker));
18
+ return results;
19
+ }
20
+ //# sourceMappingURL=promise-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promise-utils.js","sourceRoot":"","sources":["../../src/logic/promise-utils.ts"],"names":[],"mappings":";;AAEA,sCAoBC;AAtBD,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAEvB,KAAK,UAAU,aAAa,CACjC,MAAoB,EACpB,MAA+C,EAC/C,cAAsB,mBAAmB;IAEzC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAElC,MAAM,OAAO,GAAG,IAAI,KAAK,CAAI,MAAM,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,SAAS,GAAG,CAAC,CAAA;IAEjB,KAAK,UAAU,MAAM;QACnB,OAAO,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACjC,MAAM,YAAY,GAAG,SAAS,EAAE,CAAA;YAChC,OAAO,CAAC,YAAY,CAAC,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC,CAAA;QAC1E,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IACrE,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAA;IAC9D,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -0,0 +1,23 @@
1
+ type BaseQuestion = {
2
+ name: string;
3
+ message: string;
4
+ };
5
+ type TextQuestion = BaseQuestion & {
6
+ type: 'text';
7
+ validate?: (value: string) => boolean | Promise<boolean>;
8
+ };
9
+ type NumberQuestion = BaseQuestion & {
10
+ type: 'number';
11
+ validate?: (value: number) => boolean | Promise<boolean>;
12
+ };
13
+ type ConfirmQuestion = BaseQuestion & {
14
+ type: 'confirm';
15
+ initial?: boolean;
16
+ };
17
+ type Options = {
18
+ onCancel?: () => void;
19
+ };
20
+ export default function prompts(question: ConfirmQuestion, options?: Options): Promise<Record<string, boolean>>;
21
+ export default function prompts(question: NumberQuestion, options?: Options): Promise<Record<string, number>>;
22
+ export default function prompts(question: TextQuestion, options?: Options): Promise<Record<string, string>>;
23
+ export {};
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.default = prompts;
37
+ const readline = __importStar(require("readline/promises"));
38
+ async function prompts(question, options = {}) {
39
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
40
+ // on Node <24 Ctrl+C only pauses stdin instead of rejecting rl.question; abort so onCancel runs
41
+ const canceled = new AbortController();
42
+ rl.on('SIGINT', () => canceled.abort());
43
+ try {
44
+ for (;;) {
45
+ const suffix = question.type === 'confirm' ? (question.initial ? ' [Y/n] ' : ' [y/N] ') : ' ';
46
+ const answer = await rl.question(`${question.message}${suffix}`, { signal: canceled.signal });
47
+ if (question.type === 'confirm') {
48
+ const value = answer === '' ? !!question.initial : /^y(es)?$/i.test(answer);
49
+ return { [question.name]: value };
50
+ }
51
+ if (question.type === 'number') {
52
+ const value = Number(answer);
53
+ if (Number.isNaN(value)) {
54
+ process.stdout.write('Please enter a number.\n');
55
+ continue;
56
+ }
57
+ if (!question.validate || (await question.validate(value)))
58
+ return { [question.name]: value };
59
+ }
60
+ else if (!question.validate || (await question.validate(answer))) {
61
+ return { [question.name]: answer };
62
+ }
63
+ process.stdout.write('Invalid input, please try again.\n');
64
+ }
65
+ }
66
+ catch {
67
+ options.onCancel?.();
68
+ return {};
69
+ }
70
+ finally {
71
+ rl.close();
72
+ }
73
+ }
74
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/logic/prompts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,0BAkCC;AArDD,4DAA6C;AAmB9B,KAAK,UAAU,OAAO,CACnC,QAAkB,EAClB,UAAmB,EAAE;IAErB,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IACrF,gGAAgG;IAChG,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAA;IACtC,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;IACvC,IAAI,CAAC;QACH,SAAS,CAAC;YACR,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;YAC7F,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,OAAO,GAAG,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;YAC7F,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAChC,MAAM,KAAK,GAAG,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC3E,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAA;YACnC,CAAC;YACD,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;gBAC5B,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;oBACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;oBAChD,SAAQ;gBACV,CAAC;gBACD,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;oBAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAA;YAC/F,CAAC;iBAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBACnE,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;YACpC,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAA;QAC5D,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAA;QACpB,OAAO,EAAE,CAAA;IACX,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAA;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { AboutResponse } from '../generated/decentraland/realm/about.gen';
2
+ import { CliComponents } from '../components';
3
+ export declare function createStaticRealm(components: Pick<CliComponents, 'config'>): Promise<AboutResponse>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createStaticRealm = createStaticRealm;
4
+ const config_1 = require("./config");
5
+ async function createStaticRealm(components) {
6
+ const catalystUrl = await (0, config_1.getCatalystBaseUrl)(components);
7
+ return {
8
+ acceptingUsers: true,
9
+ bff: { healthy: false, publicUrl: `${catalystUrl}/bff` },
10
+ comms: {
11
+ healthy: true,
12
+ protocol: 'v3',
13
+ fixedAdapter: `offline:offline`
14
+ },
15
+ configurations: {
16
+ networkId: 0,
17
+ globalScenesUrn: [],
18
+ scenesUrn: [],
19
+ realmName: 'SdkStaticExport'
20
+ },
21
+ content: {
22
+ healthy: true,
23
+ publicUrl: `${catalystUrl}/content`
24
+ },
25
+ lambdas: {
26
+ healthy: true,
27
+ publicUrl: `${catalystUrl}/lambdas`
28
+ },
29
+ healthy: true
30
+ };
31
+ }
32
+ //# sourceMappingURL=realm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realm.js","sourceRoot":"","sources":["../../src/logic/realm.ts"],"names":[],"mappings":";;AAIA,8CA0BC;AA5BD,qCAA6C;AAEtC,KAAK,UAAU,iBAAiB,CAAC,UAAyC;IAC/E,MAAM,WAAW,GAAG,MAAM,IAAA,2BAAkB,EAAC,UAAU,CAAC,CAAA;IACxD,OAAO;QACL,cAAc,EAAE,IAAI;QACpB,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,WAAW,MAAM,EAAE;QACxD,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,iBAAiB;SAChC;QACD,cAAc,EAAE;YACd,SAAS,EAAE,CAAC;YACZ,eAAe,EAAE,EAAE;YACnB,SAAS,EAAE,EAAE;YACb,SAAS,EAAE,iBAAiB;SAC7B;QACD,OAAO,EAAE;YACP,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,GAAG,WAAW,UAAU;SACpC;QACD,OAAO,EAAE;YACP,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,GAAG,WAAW,UAAU;SACpC;QACD,OAAO,EAAE,IAAI;KACd,CAAA;AACH,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { Entity } from '@dcl/ecs';
2
+ declare global {
3
+ var __DCL_SCRIPT_INSTANCES__: Map<string, {
4
+ instance: any;
5
+ entity: Entity;
6
+ path: string;
7
+ }>;
8
+ }
9
+ /**
10
+ * Get a specific script instance by entity and script path.
11
+ * @param entity - The entity ID
12
+ * @param scriptPath - The script file path
13
+ * @returns The script instance or null if not found
14
+ */
15
+ export declare function getScriptInstance(entity: Entity, scriptPath: string): any;
16
+ /**
17
+ * Get all instances of a specific script (across all entities).
18
+ * @param scriptPath - The script file path
19
+ * @returns Array of { entity, instance } objects
20
+ */
21
+ export declare function getScriptInstancesByPath(scriptPath: string): Array<{
22
+ entity: Entity;
23
+ instance: any;
24
+ }>;
25
+ /**
26
+ * Get all script instances attached to a specific entity
27
+ * @param entity - The entity ID
28
+ * @returns Array of { path, instance } objects
29
+ */
30
+ export declare function getAllScriptInstances(entity: Entity): Array<{
31
+ path: string;
32
+ instance: any;
33
+ }>;
34
+ /**
35
+ * Call a method on a script instance (with safety checks).
36
+ * @param entity - The entity ID
37
+ * @param scriptPath - The script file path
38
+ * @param methodName - The method name to call
39
+ * @param args - Arguments to pass to the method
40
+ * @returns The method's return value or undefined if method not found
41
+ */
42
+ export declare function callScriptMethod(entity: Entity, scriptPath: string, methodName: string, ...args: any[]): any;
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getScriptInstance = getScriptInstance;
4
+ exports.getScriptInstancesByPath = getScriptInstancesByPath;
5
+ exports.getAllScriptInstances = getAllScriptInstances;
6
+ exports.callScriptMethod = callScriptMethod;
7
+ exports.runScripts = runScripts;
8
+ const events_1 = require("@dcl/inspector/node_modules/@dcl/asset-packs/dist/events");
9
+ if (!globalThis.__DCL_SCRIPT_INSTANCES__) {
10
+ globalThis.__DCL_SCRIPT_INSTANCES__ = new Map();
11
+ }
12
+ // compiler-checked literal: the @dcl/ecs d.ts pins EntityState.Removed = 2, so drift fails this build with TS2322; a value import would embed ecs runtime code into every scene bundle
13
+ const ENTITY_STATE_REMOVED = 2;
14
+ function entityIsRemoved(engine, entity) {
15
+ return engine.getEntityState(entity) === ENTITY_STATE_REMOVED;
16
+ }
17
+ /**
18
+ * Get a specific script instance by entity and script path.
19
+ * @param entity - The entity ID
20
+ * @param scriptPath - The script file path
21
+ * @returns The script instance or null if not found
22
+ */
23
+ function getScriptInstance(entity, scriptPath) {
24
+ const key = `${entity}:${scriptPath}`;
25
+ const entry = globalThis.__DCL_SCRIPT_INSTANCES__.get(key);
26
+ return entry?.instance || null;
27
+ }
28
+ /**
29
+ * Get all instances of a specific script (across all entities).
30
+ * @param scriptPath - The script file path
31
+ * @returns Array of { entity, instance } objects
32
+ */
33
+ function getScriptInstancesByPath(scriptPath) {
34
+ const results = [];
35
+ for (const [_, value] of globalThis.__DCL_SCRIPT_INSTANCES__) {
36
+ if (value.path === scriptPath) {
37
+ results.push({ entity: value.entity, instance: value.instance });
38
+ }
39
+ }
40
+ return results;
41
+ }
42
+ /**
43
+ * Get all script instances attached to a specific entity
44
+ * @param entity - The entity ID
45
+ * @returns Array of { path, instance } objects
46
+ */
47
+ function getAllScriptInstances(entity) {
48
+ const results = [];
49
+ for (const [_, value] of globalThis.__DCL_SCRIPT_INSTANCES__) {
50
+ if (value.entity === entity) {
51
+ results.push({ path: value.path, instance: value.instance });
52
+ }
53
+ }
54
+ return results;
55
+ }
56
+ /**
57
+ * Call a method on a script instance (with safety checks).
58
+ * @param entity - The entity ID
59
+ * @param scriptPath - The script file path
60
+ * @param methodName - The method name to call
61
+ * @param args - Arguments to pass to the method
62
+ * @returns The method's return value or undefined if method not found
63
+ */
64
+ function callScriptMethod(entity, scriptPath, methodName, ...args) {
65
+ const instance = getScriptInstance(entity, scriptPath);
66
+ if (instance && typeof instance[methodName] === 'function') {
67
+ return instance[methodName](...args);
68
+ }
69
+ console.error(`Method ${methodName} not found on script ${scriptPath} for entity ${entity}`);
70
+ return undefined;
71
+ }
72
+ /**
73
+ * Creates an ActionCallback function from an ActionRef.
74
+ * The returned function, when called, will trigger the specified action on the entity.
75
+ *
76
+ * Validation happens here, at resolution time, not inside the returned closure: an
77
+ * unassigned optional action param is stored by the editor as a truthy placeholder
78
+ * ({ entity: RootEntity (0), action: '' }), so validating at call time would still hand
79
+ * the script a callable and make its `if (this.onAction)` guard always pass. Returning
80
+ * undefined for an unwired ref lets that guard work as intended.
81
+ *
82
+ * @param actionRef - The action reference containing entity and action name
83
+ * @returns A function that triggers the action when called, or undefined if the ref is unwired
84
+ */
85
+ function createActionCallback(actionRef) {
86
+ if (!actionRef.entity || !actionRef.action)
87
+ return undefined;
88
+ return () => {
89
+ const actionEvents = (0, events_1.getActionEvents)(actionRef.entity);
90
+ actionEvents.emit(actionRef.action, {});
91
+ };
92
+ }
93
+ /**
94
+ * Resolves script parameters, converting ActionRef values to ActionCallback functions.
95
+ *
96
+ * @param params - The raw parameters from the script layout
97
+ * @returns Array of resolved parameter values
98
+ */
99
+ function resolveScriptParams(params) {
100
+ return Object.values(params).map((param) => {
101
+ if (param.type === 'action' && param.value && typeof param.value === 'object') {
102
+ const actionRef = param.value;
103
+ return createActionCallback(actionRef);
104
+ }
105
+ return param.value;
106
+ });
107
+ }
108
+ /**
109
+ * Initializes and runs all scripts organized by priority.
110
+ * Supports both functional-style scripts (with start/update functions) and class-based scripts.
111
+ * Scripts are extracted at build time from composites.
112
+ *
113
+ * @internal This function is called automatically by the SDK entry point.
114
+ * Users should not call this function directly.
115
+ *
116
+ * @param engine - The ECS engine instance
117
+ * @param scripts - Scripts with their modules, extracted at build time
118
+ */
119
+ function runScripts(engine, scripts) {
120
+ const scriptsByPriority = groupScriptsByPriority(scripts);
121
+ const classInstances = new Map();
122
+ const functionScripts = new Map();
123
+ for (const [priority, instances] of Object.entries(scriptsByPriority)) {
124
+ for (const script of instances) {
125
+ if (entityIsRemoved(engine, script.entity))
126
+ continue;
127
+ const module = script.module;
128
+ if (!module) {
129
+ console.error('[Script] Unknown module:', script.path);
130
+ continue;
131
+ }
132
+ const src = script.path.split('/').slice(0, -1).join('/');
133
+ const layout = script.layout ? JSON.parse(script.layout) : {};
134
+ const params = resolveScriptParams(layout.params || {});
135
+ const registryKey = `${script.entity}:${script.path}`;
136
+ if (typeof module.start === 'function') {
137
+ try {
138
+ module.start(src, script.entity, ...params);
139
+ }
140
+ catch (e) {
141
+ console.error('[Script Error] ' + script.path + ' start() failed:', e);
142
+ throw e;
143
+ }
144
+ functionScripts.set(script.key, {
145
+ src,
146
+ module: module,
147
+ entity: script.entity,
148
+ params
149
+ });
150
+ globalThis.__DCL_SCRIPT_INSTANCES__.set(registryKey, {
151
+ instance: module,
152
+ entity: script.entity,
153
+ path: script.path
154
+ });
155
+ }
156
+ else {
157
+ const ScriptClass = Object.values(module).find((exp) => typeof exp === 'function');
158
+ if (!ScriptClass) {
159
+ console.error('[Script] No class found in module:', script.path);
160
+ continue;
161
+ }
162
+ try {
163
+ const instance = new ScriptClass(src, script.entity, ...params);
164
+ if (typeof instance.start === 'function') {
165
+ instance.start();
166
+ }
167
+ classInstances.set(script.key, { instance, entity: script.entity });
168
+ globalThis.__DCL_SCRIPT_INSTANCES__.set(registryKey, {
169
+ instance: instance,
170
+ entity: script.entity,
171
+ path: script.path
172
+ });
173
+ }
174
+ catch (e) {
175
+ console.error('[Script Error] ' + script.path + ' class initialization failed:', e);
176
+ throw e;
177
+ }
178
+ }
179
+ }
180
+ engine.addSystem((dt) => {
181
+ for (const scriptData of instances) {
182
+ try {
183
+ const classInstance = classInstances.get(scriptData.key);
184
+ if (classInstance && !entityIsRemoved(engine, classInstance.entity)) {
185
+ if (typeof classInstance.instance.update === 'function') {
186
+ classInstance.instance.update(dt);
187
+ }
188
+ }
189
+ else {
190
+ const functionScript = functionScripts.get(scriptData.key);
191
+ if (functionScript && !entityIsRemoved(engine, functionScript.entity)) {
192
+ if (typeof functionScript.module.update === 'function') {
193
+ functionScript.module.update(functionScript.src, functionScript.entity, dt, ...functionScript.params);
194
+ }
195
+ }
196
+ }
197
+ }
198
+ catch (e) {
199
+ console.error('[Script Error] update() failed:', e);
200
+ }
201
+ }
202
+ }, Number(priority));
203
+ }
204
+ }
205
+ function groupScriptsByPriority(scripts) {
206
+ const scriptsByPriority = {};
207
+ for (let i = 0; i < scripts.length; i++) {
208
+ const script = scripts[i];
209
+ const key = `${script.entity}:${script.path}:${i}`;
210
+ if (!scriptsByPriority[script.priority]) {
211
+ scriptsByPriority[script.priority] = [];
212
+ }
213
+ scriptsByPriority[script.priority].push({ ...script, key });
214
+ }
215
+ return scriptsByPriority;
216
+ }
217
+ //# sourceMappingURL=runtime-script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-script.js","sourceRoot":"","sources":["../../src/logic/runtime-script.ts"],"names":[],"mappings":";;AA+DA,8CAIC;AAOD,4DAQC;AAOD,sDAQC;AAUD,4CAOC;AAkDD,gCAwFC;AAzPD,qFAA0F;AAO1F,IAAI,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC;IACzC,UAAU,CAAC,wBAAwB,GAAG,IAAI,GAAG,EAAE,CAAA;AACjD,CAAC;AAsCD,uLAAuL;AACvL,MAAM,oBAAoB,GAAwB,CAAC,CAAA;AAEnD,SAAS,eAAe,CAAC,MAAe,EAAE,MAAc;IACtD,OAAO,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,oBAAoB,CAAA;AAC/D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,MAAc,EAAE,UAAkB;IAClE,MAAM,GAAG,GAAG,GAAG,MAAM,IAAI,UAAU,EAAE,CAAA;IACrC,MAAM,KAAK,GAAG,UAAU,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC1D,OA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