@dcl/sdk-commands 7.12.2 → 7.12.3-19242573384.commit-09d14b4

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 (94) hide show
  1. package/dist/commands/build/index.js +1 -1
  2. package/dist/commands/build/index.js.map +1 -1
  3. package/dist/commands/deploy/index.d.ts +1 -6
  4. package/dist/commands/deploy/index.js +11 -38
  5. package/dist/commands/deploy/index.js.map +1 -1
  6. package/dist/commands/deploy/utils.js +1 -2
  7. package/dist/commands/deploy/utils.js.map +1 -1
  8. package/dist/commands/export-static/index.js +4 -5
  9. package/dist/commands/export-static/index.js.map +1 -1
  10. package/dist/commands/init/index.js +4 -5
  11. package/dist/commands/init/index.js.map +1 -1
  12. package/dist/commands/quests/index.js +9 -13
  13. package/dist/commands/quests/index.js.map +1 -1
  14. package/dist/commands/start/data-layer/fs.d.ts +1 -1
  15. package/dist/commands/start/data-layer/fs.js +8 -17
  16. package/dist/commands/start/data-layer/fs.js.map +1 -1
  17. package/dist/commands/start/data-layer/rpc.d.ts +1 -1
  18. package/dist/commands/start/data-layer/rpc.js +2 -2
  19. package/dist/commands/start/data-layer/rpc.js.map +1 -1
  20. package/dist/commands/start/explorer-alpha.js +14 -21
  21. package/dist/commands/start/explorer-alpha.js.map +1 -1
  22. package/dist/commands/start/index.d.ts +4 -2
  23. package/dist/commands/start/index.js +51 -31
  24. package/dist/commands/start/index.js.map +1 -1
  25. package/dist/commands/start/server/endpoints.js +1 -2
  26. package/dist/commands/start/server/endpoints.js.map +1 -1
  27. package/dist/commands/start/server/file-watch-notifier.d.ts +1 -1
  28. package/dist/commands/start/server/file-watch-notifier.js +9 -3
  29. package/dist/commands/start/server/file-watch-notifier.js.map +1 -1
  30. package/dist/components/config.js +1 -2
  31. package/dist/components/config.js.map +1 -1
  32. package/dist/components/fs.d.ts +1 -1
  33. package/dist/components/fs.js +0 -1
  34. package/dist/components/fs.js.map +1 -1
  35. package/dist/logic/account.js +1 -5
  36. package/dist/logic/account.js.map +1 -1
  37. package/dist/logic/args.js +1 -2
  38. package/dist/logic/args.js.map +1 -1
  39. package/dist/logic/bundle.js +8 -54
  40. package/dist/logic/bundle.js.map +1 -1
  41. package/dist/logic/commands.js +2 -6
  42. package/dist/logic/commands.js.map +1 -1
  43. package/dist/logic/dao-explorer.d.ts +3 -0
  44. package/dist/logic/dao-explorer.js +156 -0
  45. package/dist/logic/dao-explorer.js.map +1 -0
  46. package/dist/logic/dcl-ignore.js +0 -2
  47. package/dist/logic/dcl-ignore.js.map +1 -1
  48. package/dist/logic/error.d.ts +1 -6
  49. package/dist/logic/error.js +0 -6
  50. package/dist/logic/error.js.map +1 -1
  51. package/dist/logic/portable-experience-sw-validations.js +2 -6
  52. package/dist/logic/portable-experience-sw-validations.js.map +1 -1
  53. package/dist/logic/project-files.js +2 -3
  54. package/dist/logic/project-files.js.map +1 -1
  55. package/dist/logic/project-validations.js +2 -3
  56. package/dist/logic/project-validations.js.map +1 -1
  57. package/dist/logic/scene-validations.js +8 -13
  58. package/dist/logic/scene-validations.js.map +1 -1
  59. package/dist/logic/workspace-validations.js +2 -6
  60. package/dist/logic/workspace-validations.js.map +1 -1
  61. package/dist/run-command.js +5 -10
  62. package/dist/run-command.js.map +1 -1
  63. package/package.json +10 -14
  64. package/dist/commands/code-to-composite/asset-migrator.d.ts +0 -25
  65. package/dist/commands/code-to-composite/asset-migrator.js +0 -239
  66. package/dist/commands/code-to-composite/asset-migrator.js.map +0 -1
  67. package/dist/commands/code-to-composite/code-commenter.d.ts +0 -11
  68. package/dist/commands/code-to-composite/code-commenter.js +0 -88
  69. package/dist/commands/code-to-composite/code-commenter.js.map +0 -1
  70. package/dist/commands/code-to-composite/composite-generator.d.ts +0 -6
  71. package/dist/commands/code-to-composite/composite-generator.js +0 -56
  72. package/dist/commands/code-to-composite/composite-generator.js.map +0 -1
  73. package/dist/commands/code-to-composite/index.d.ts +0 -16
  74. package/dist/commands/code-to-composite/index.js +0 -130
  75. package/dist/commands/code-to-composite/index.js.map +0 -1
  76. package/dist/commands/code-to-composite/name-generator.d.ts +0 -9
  77. package/dist/commands/code-to-composite/name-generator.js +0 -140
  78. package/dist/commands/code-to-composite/name-generator.js.map +0 -1
  79. package/dist/commands/code-to-composite/scene-executor.d.ts +0 -15
  80. package/dist/commands/code-to-composite/scene-executor.js +0 -405
  81. package/dist/commands/code-to-composite/scene-executor.js.map +0 -1
  82. package/dist/commands/get-context-files/index.d.ts +0 -12
  83. package/dist/commands/get-context-files/index.js +0 -116
  84. package/dist/commands/get-context-files/index.js.map +0 -1
  85. package/dist/locales/en.json +0 -84
  86. package/dist/locales/es.json +0 -84
  87. package/dist/locales/zh.json +0 -84
  88. package/dist/logic/debounce.d.ts +0 -1
  89. package/dist/logic/debounce.js +0 -12
  90. package/dist/logic/debounce.js.map +0 -1
  91. package/dist/logic/lang.d.ts +0 -7
  92. package/dist/logic/lang.js +0 -40
  93. package/dist/logic/lang.js.map +0 -1
  94. package/scripts/postinstall.js +0 -17
@@ -1,405 +0,0 @@
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.executeSceneCode = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const module_1 = __importDefault(require("module"));
9
- const i18next_1 = __importDefault(require("i18next"));
10
- const dist_cjs_1 = require("@dcl/ecs/dist-cjs");
11
- const ByteBuffer_1 = require("@dcl/ecs/dist-cjs/serialization/ByteBuffer");
12
- const inspector_1 = require("@dcl/inspector");
13
- const error_1 = require("../../logic/error");
14
- const bundle_1 = require("../../logic/bundle");
15
- /**
16
- * Returns the set of component IDs that are used by the @dcl/inspector.
17
- */
18
- function getInspectorComponentsIds() {
19
- const { components } = (0, inspector_1.createEngineContext)();
20
- const ids = new Set();
21
- for (const [_, component] of Object.entries(components)) {
22
- ids.add(component.componentId);
23
- }
24
- return ids;
25
- }
26
- /**
27
- * Initializes the ECS engine with a mock transport layer.
28
- *
29
- * The transport layer is used to capture CRDT messages sent by the scene code.
30
- * This allows us to capture the state of all entities and components.
31
- */
32
- function initEngine() {
33
- const transport = {
34
- filter: () => true,
35
- send: async (_messages) => { }
36
- };
37
- dist_cjs_1.engine.addTransport(transport);
38
- return {
39
- engine: dist_cjs_1.engine,
40
- transport
41
- };
42
- }
43
- /**
44
- * Creates initial CRDT state with required engine components.
45
- */
46
- function getInitialCrdtState() {
47
- function addPlayerEntityTransform() {
48
- const buffer = new ByteBuffer_1.ReadWriteByteBuffer();
49
- const transform = dist_cjs_1.Transform.create(dist_cjs_1.engine.PlayerEntity);
50
- dist_cjs_1.Transform.schema.serialize(transform, buffer);
51
- const transformData = buffer.toCopiedBinary();
52
- buffer.resetBuffer();
53
- dist_cjs_1.PutComponentOperation.write(1, 1, dist_cjs_1.Transform.componentId, transformData, buffer);
54
- dist_cjs_1.PutComponentOperation.write(2, 1, dist_cjs_1.Transform.componentId, transformData, buffer);
55
- return buffer.toBinary();
56
- }
57
- function addUICanvasOnRootEntity() {
58
- const buffer = new ByteBuffer_1.ReadWriteByteBuffer();
59
- const uiCanvasInformation = dist_cjs_1.UiCanvasInformation.create(dist_cjs_1.engine.RootEntity);
60
- dist_cjs_1.UiCanvasInformation.schema.serialize(uiCanvasInformation, buffer);
61
- const uiCanvasComponentData = buffer.toCopiedBinary();
62
- buffer.resetBuffer();
63
- dist_cjs_1.PutComponentOperation.write(0, 1, dist_cjs_1.UiCanvasInformation.componentId, uiCanvasComponentData, buffer);
64
- return buffer.toBinary();
65
- }
66
- function addCameraMode() {
67
- const buffer = new ByteBuffer_1.ReadWriteByteBuffer();
68
- const cameraMode = dist_cjs_1.CameraMode.create(dist_cjs_1.engine.RootEntity);
69
- dist_cjs_1.CameraMode.schema.serialize(cameraMode, buffer);
70
- const cameraModeComponentData = buffer.toCopiedBinary();
71
- buffer.resetBuffer();
72
- dist_cjs_1.PutComponentOperation.write(2, 1, dist_cjs_1.CameraMode.componentId, cameraModeComponentData, buffer);
73
- return buffer.toBinary();
74
- }
75
- return [addPlayerEntityTransform(), addUICanvasOnRootEntity(), addCameraMode()];
76
- }
77
- /**
78
- * Creates pre-defined mocks for critical ~system modules.
79
- *
80
- * These modules are runtime-specific and don't exist in Node.js.
81
- * This function provides meaningful mock implementations for the most
82
- * commonly used system modules to ensure scene code executes correctly.
83
- */
84
- function createCriticalModuleMocks(engine, transport, crdtState) {
85
- return {
86
- '~system/EngineApi': {
87
- crdtSendToRenderer: async (crdt) => {
88
- transport.onmessage(crdt.data);
89
- await engine.update(0);
90
- },
91
- crdtGetState: async () => ({
92
- hasEntities: false,
93
- data: [...getInitialCrdtState(), crdtState]
94
- }),
95
- sendBatch: async () => ({ events: [] }),
96
- subscribe: async () => ({}),
97
- unsubscribe: async () => ({}),
98
- isServer: async () => ({ isServer: false }),
99
- crdtGetMessageFromRenderer: async () => ({ data: [] })
100
- },
101
- '~system/Scene': {
102
- getSceneInfo: async () => ({
103
- cid: '',
104
- metadata: '{}',
105
- baseUrl: '',
106
- contents: []
107
- })
108
- },
109
- '~system/UserIdentity': {
110
- getUserData: async () => ({
111
- data: {
112
- displayName: 'Test User',
113
- userId: 'test-user-id',
114
- hasConnectedWeb3: false,
115
- version: 1,
116
- avatar: {
117
- bodyShape: 'urn:decentraland:off-chain:base-avatars:BaseMale',
118
- skinColor: '#000000',
119
- hairColor: '#000000',
120
- eyeColor: '#000000',
121
- wearables: [],
122
- snapshots: {
123
- face256: '',
124
- body: ''
125
- }
126
- }
127
- }
128
- }),
129
- getUserPublicKey: async () => ({ address: undefined })
130
- },
131
- '~system/EnvironmentApi': {
132
- isPreviewMode: async () => ({ isPreview: true }),
133
- getBootstrapData: async () => ({
134
- id: '',
135
- baseUrl: '',
136
- entity: {
137
- content: [],
138
- metadataJson: '{}'
139
- },
140
- useFPSThrottling: false
141
- }),
142
- getPlatform: async () => ({ platform: 'desktop' }),
143
- areUnsafeRequestAllowed: async () => ({ status: false }),
144
- getCurrentRealm: async () => ({ currentRealm: undefined }),
145
- getExplorerConfiguration: async () => ({ clientUri: '', configurations: {} }),
146
- getDecentralandTime: async () => ({ seconds: Date.now() / 1000 })
147
- },
148
- '~system/Runtime': {
149
- getRealm: async () => ({
150
- realmInfo: {
151
- baseUrl: 'http://localhost',
152
- realmName: 'localhost',
153
- networkId: 1,
154
- commsAdapter: 'offline',
155
- isPreview: true
156
- }
157
- }),
158
- getWorldTime: async () => ({ seconds: Date.now() / 1000 }),
159
- readFile: async () => ({ content: new Uint8Array(), hash: '' }),
160
- getSceneInformation: async () => ({
161
- urn: '',
162
- content: [],
163
- metadataJson: '{}',
164
- baseUrl: ''
165
- }),
166
- getExplorerInformation: async () => ({
167
- agent: 'code-to-composite',
168
- platform: 'desktop',
169
- configurations: {}
170
- })
171
- },
172
- '~system/Players': {
173
- getPlayerData: async () => ({ data: undefined }),
174
- getPlayersInScene: async () => ({ players: [] }),
175
- getConnectedPlayers: async () => ({ players: [] })
176
- },
177
- '~system/RestrictedActions': {
178
- movePlayerTo: async () => ({}),
179
- teleportTo: async () => ({}),
180
- triggerEmote: async () => ({}),
181
- changeRealm: async () => ({ success: false }),
182
- openExternalUrl: async () => ({ success: false }),
183
- openNftDialog: async () => ({ success: false }),
184
- setCommunicationsAdapter: async () => ({ success: false }),
185
- triggerSceneEmote: async () => ({ success: false })
186
- },
187
- '~system/CommsApi': {
188
- getActiveVideoStreams: async () => ({ streams: [] })
189
- },
190
- '~system/CommunicationsController': {
191
- send: async () => ({}),
192
- sendBinary: async () => ({ data: [] })
193
- },
194
- '~system/EthereumController': {
195
- requirePayment: async () => ({ jsonAnyResponse: '{}' }),
196
- signMessage: async () => ({ message: '', hexEncodedMessage: '', signature: '' }),
197
- convertMessageToObject: async () => ({ dict: {} }),
198
- sendAsync: async () => ({ jsonAnyResponse: '{}' }),
199
- getUserAccount: async () => ({ address: undefined })
200
- },
201
- '~system/PortableExperiences': {
202
- spawn: async () => ({ pid: '', parentCid: '', name: '' }),
203
- kill: async () => ({ status: false }),
204
- exit: async () => ({ status: false }),
205
- getPortableExperiencesLoaded: async () => ({ loaded: [] })
206
- },
207
- '~system/SignedFetch': {
208
- signedFetch: async () => ({
209
- ok: false,
210
- status: 404,
211
- statusText: 'Not Found',
212
- headers: {},
213
- body: ''
214
- }),
215
- getHeaders: async () => ({ headers: {} })
216
- },
217
- '~system/Testing': {
218
- logTestResult: async () => ({}),
219
- plan: async () => ({}),
220
- setCameraTransform: async () => ({})
221
- },
222
- '~system/UserActionModule': {
223
- requestTeleport: async () => ({})
224
- }
225
- };
226
- }
227
- /**
228
- * Creates a Proxy that automatically mocks unknown properties and functions.
229
- *
230
- * This provides a fallback mechanism for ~system module functions that aren't
231
- * explicitly mocked.
232
- */
233
- function createAutoMockProxy(baseMock = {}) {
234
- return new Proxy(baseMock, {
235
- get(target, prop) {
236
- if (prop in target) {
237
- return target[prop];
238
- }
239
- return async (...args) => {
240
- return {};
241
- };
242
- }
243
- });
244
- }
245
- /**
246
- * Creates a mock implementation for a ~system/* module.
247
- *
248
- * ~system modules are runtime-specific and don't exist in Node.js, so they need
249
- * to be mocked for scene execution.
250
- */
251
- function createSystemModuleMock(engine, transport, mainCrdt, moduleId) {
252
- const criticalModuleMocks = createCriticalModuleMocks(engine, transport, mainCrdt);
253
- if (moduleId in criticalModuleMocks) {
254
- return createAutoMockProxy(criticalModuleMocks[moduleId]);
255
- }
256
- return createAutoMockProxy();
257
- }
258
- /**
259
- * Sets up a Node.js require hook to intercept and mock ~system/* module imports.
260
- *
261
- * This patches Module.prototype.require to intercept require() calls during
262
- * scene bundle execution.
263
- *
264
- * NOTE: The hook is temporary and should be removed after scene execution using
265
- * the returned cleanup function.
266
- */
267
- function setupRequireHook(engine, transport, mainCrdt) {
268
- const originalRequire = module_1.default.prototype.require;
269
- module_1.default.prototype.require = function (id) {
270
- if (id.startsWith('~system/')) {
271
- return createSystemModuleMock(engine, transport, mainCrdt, id);
272
- }
273
- return originalRequire.apply(this, [id]);
274
- };
275
- return () => {
276
- module_1.default.prototype.require = originalRequire;
277
- };
278
- }
279
- /**
280
- * Loads and executes the scene bundle to populate the ECS engine.
281
- */
282
- async function loadAndExecuteBundle(bundlePath) {
283
- delete require.cache[require.resolve(bundlePath)];
284
- // eslint-disable-next-line @typescript-eslint/no-var-requires
285
- const sceneModule = require(bundlePath);
286
- if (typeof sceneModule.onStart === 'function') {
287
- const onStart = sceneModule.onStart();
288
- if (typeof onStart.then === 'function') {
289
- await onStart;
290
- }
291
- }
292
- if (typeof sceneModule.onUpdate === 'function') {
293
- const onUpdate = sceneModule.onUpdate(0);
294
- if (typeof onUpdate.then === 'function') {
295
- await onUpdate;
296
- }
297
- }
298
- }
299
- /**
300
- * Filters out components that are not supported by the @dcl/inspector.
301
- */
302
- function filterInspectorCompatibleComponents(engine) {
303
- const validComponentIds = getInspectorComponentsIds();
304
- const reactEcsComponentIds = new Set([
305
- dist_cjs_1.UiTransform.componentId,
306
- dist_cjs_1.UiText.componentId,
307
- dist_cjs_1.UiBackground.componentId,
308
- dist_cjs_1.UiInput.componentId,
309
- dist_cjs_1.UiInputResult.componentId,
310
- dist_cjs_1.UiDropdown.componentId,
311
- dist_cjs_1.UiDropdownResult.componentId,
312
- ]);
313
- // first pass: identify entities with react-ecs components
314
- const uiEntities = new Set();
315
- for (const component of engine.componentsIter()) {
316
- if (reactEcsComponentIds.has(component.componentId)) {
317
- for (const [entity] of engine.getEntitiesWith(component)) {
318
- uiEntities.add(entity);
319
- }
320
- }
321
- }
322
- // second pass: remove components from entities that either:
323
- // - are root engine entities
324
- // - have react-ecs components
325
- for (const component of engine.componentsIter()) {
326
- if ('deleteFrom' in component) {
327
- const isValidComponent = validComponentIds.has(component.componentId);
328
- for (const [entity] of engine.getEntitiesWith(component)) {
329
- if (uiEntities.has(entity) || !isValidComponent) {
330
- component.deleteFrom(entity);
331
- }
332
- }
333
- }
334
- }
335
- // BONUS: remove Transform from PlayerEntity to avoid bad placement when running the client
336
- dist_cjs_1.Transform.deleteFrom(engine.PlayerEntity);
337
- }
338
- /**
339
- * Loads the main CRDT file if it exists, otherwise returns an empty buffer.
340
- *
341
- * The CRDT file contains serialized component state that may already exist
342
- * in the scene. This is used to initialize the engine with any pre-existing
343
- * state before executing the scene code.
344
- */
345
- async function getMainCrdtFile(components, crdtFilePath) {
346
- let mainCrdt = new Uint8Array();
347
- if (await components.fs.fileExists(crdtFilePath)) {
348
- mainCrdt = new Uint8Array(await components.fs.readFile(crdtFilePath));
349
- }
350
- return mainCrdt;
351
- }
352
- /**
353
- * Bundles the scene code and returns the entrypoint.
354
- */
355
- async function bundle(components, project) {
356
- try {
357
- const { inputs } = await (0, bundle_1.bundleProject)(components, {
358
- workingDirectory: project.workingDirectory,
359
- watch: false,
360
- production: false,
361
- emitDeclaration: false,
362
- ignoreComposite: true,
363
- customEntryPoint: false
364
- }, project.scene);
365
- return inputs[0].entrypoint;
366
- }
367
- catch (err) {
368
- throw new error_1.CliError('CODE_TO_COMPOSITE_BUILD_FAILED', i18next_1.default.t('errors.code_to_composite.build_failed', { error: err.message }));
369
- }
370
- }
371
- /**
372
- * Executes a Decentraland scene's code and captures the resulting ECS engine state.
373
- *
374
- * This is the main entry point for the code-to-composite command. It runs scene
375
- * code in a Node.js environment to extract the entity/component structure.
376
- *
377
- * The returned engine can then be used to generate composite/CRDT files.
378
- */
379
- async function executeSceneCode(components, project, crdtFilePath) {
380
- const { fs, logger } = components;
381
- logger.log('Building scene...');
382
- const sceneCodeEntrypoint = await bundle(components, project);
383
- const bundlePath = path_1.default.join(project.workingDirectory, project.scene.main);
384
- if (!(await fs.fileExists(bundlePath))) {
385
- throw new error_1.CliError('CODE_TO_COMPOSITE_BUNDLE_NOT_FOUND', i18next_1.default.t('errors.code_to_composite.bundle_not_found', { bundlePath }));
386
- }
387
- logger.log('Executing scene code to capture engine state...');
388
- const crdtState = await getMainCrdtFile(components, crdtFilePath);
389
- const { engine, transport } = initEngine();
390
- const restoreRequire = setupRequireHook(engine, transport, crdtState);
391
- try {
392
- await loadAndExecuteBundle(bundlePath);
393
- filterInspectorCompatibleComponents(engine);
394
- return { engine: engine, sceneCodeEntrypoint };
395
- }
396
- catch (err) {
397
- throw new error_1.CliError('CODE_TO_COMPOSITE_EXECUTION_FAILED', i18next_1.default.t('errors.code_to_composite.execution_failed', { error: `${err.message}\n${err.stack || ''}` }));
398
- }
399
- finally {
400
- // cleanup: restore original require
401
- restoreRequire();
402
- }
403
- }
404
- exports.executeSceneCode = executeSceneCode;
405
- //# sourceMappingURL=scene-executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scene-executor.js","sourceRoot":"","sources":["../../../src/commands/code-to-composite/scene-executor.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,oDAA2B;AAC3B,sDAA6B;AAC7B,gDAgB0B;AAC1B,2EAAgF;AAChF,8CAAoD;AAKpD,6CAA4C;AAC5C,+CAAkD;AAElD;;GAEG;AACH,SAAS,yBAAyB;IAChC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,+BAAmB,GAAE,CAAA;IAC5C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAA;IAC7B,KAAK,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACvD,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;KAC/B;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;;GAKG;AACH,SAAS,UAAU;IACjB,MAAM,SAAS,GAAc;QAC3B,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI;QAClB,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAE,CAAC;KAC9B,CAAA;IAED,iBAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;IAE9B,OAAO;QACL,MAAM,EAAN,iBAAM;QACN,SAAS;KACV,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SA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U,EAAE,CAAA;IAC1C,MAAM,cAAc,GAAG,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;IAErE,IAAI;QACF,MAAM,oBAAoB,CAAC,UAAU,CAAC,CAAA;QACtC,mCAAmC,CAAC,MAAM,CAAC,CAAA;QAC3C,OAAO,EAAE,MAAM,EAAE,MAAwB,EAAE,mBAAmB,EAAE,CAAA;KACjE;IAAC,OAAO,GAAQ,EAAE;QACjB,MAAM,IAAI,gBAAQ,CAChB,oCAAoC,EACpC,iBAAO,CAAC,CAAC,CAAC,2CAA2C,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,EAAE,CAAC,CACxG,CAAA;KACF;YAAS;QACR,oCAAoC;QACpC,cAAc,EAAE,CAAA;KACjB;AACH,CAAC;AArCD,4CAqCC"}
@@ -1,12 +0,0 @@
1
- import { CliComponents } from '../../components';
2
- import { Result } from 'arg';
3
- export interface Options {
4
- args: Result<typeof args>;
5
- components: Pick<CliComponents, 'logger' | 'fs' | 'fetch'>;
6
- }
7
- export declare const args: {
8
- '--help': BooleanConstructor;
9
- '-h': string;
10
- };
11
- export declare function help(options: Options): void;
12
- export declare function main(options: Options): Promise<void>;
@@ -1,116 +0,0 @@
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.main = exports.help = exports.args = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const args_1 = require("../../logic/args");
9
- const project_validations_1 = require("../../logic/project-validations");
10
- const error_1 = require("../../logic/error");
11
- const i18next_1 = __importDefault(require("i18next"));
12
- const GITHUB_API_BASE = 'https://api.github.com/repos/decentraland/documentation/contents/ai-sdk-context';
13
- exports.args = (0, args_1.declareArgs)({
14
- '--help': Boolean,
15
- '-h': '--help'
16
- });
17
- function help(options) {
18
- options.components.logger.log(`
19
- Usage: 'sdk-commands get-context-files [options]'
20
- Options:
21
- -h, --help Gets & updates context files from https://github.com/decentraland/documentation/tree/main/ai-sdk-context only on valid scenes
22
-
23
- Example:
24
- - Get context files:
25
- $ sdk-commands get-context-files
26
- `);
27
- }
28
- exports.help = help;
29
- async function listFilesFromPath(components, url) {
30
- const response = await components.fetch.fetch(url);
31
- if (!response.ok) {
32
- throw new error_1.CliError('GET_CONTEXT_FILES_LIST_FAILED', i18next_1.default.t('errors.get_context_files.list_failed'));
33
- }
34
- return (await response.json());
35
- }
36
- async function downloadFile(components, url) {
37
- const response = await components.fetch.fetch(url);
38
- if (!response.ok) {
39
- throw new error_1.CliError('GET_CONTEXT_FILES_DOWNLOAD_FAILED', i18next_1.default.t('errors.get_context_files.download_failed'));
40
- }
41
- return await response.text();
42
- }
43
- async function getAllFiles(components, initialUrl = GITHUB_API_BASE) {
44
- const files = [];
45
- const rootFiles = await listFilesFromPath(components, initialUrl);
46
- for (const file of rootFiles) {
47
- if (file.type === 'file') {
48
- if (file.download_url) {
49
- const filename = file.name;
50
- const fileInfo = {
51
- url: file.download_url,
52
- filename: filename,
53
- path: file.path
54
- };
55
- files.push(fileInfo);
56
- }
57
- }
58
- else if (file.type === 'dir') {
59
- const subFiles = await getAllFiles(components, file.url);
60
- files.push(...subFiles);
61
- }
62
- }
63
- return files;
64
- }
65
- async function main(options) {
66
- const targetDir = process.cwd();
67
- try {
68
- await (0, project_validations_1.assertValidProjectFolder)(options.components, targetDir);
69
- options.components.logger.log('✓ Valid Scene project');
70
- }
71
- catch (error) {
72
- options.components.logger.log('Not a valid Scene...');
73
- return;
74
- }
75
- const contextDir = path_1.default.join(targetDir, 'dclcontext');
76
- const contextExists = await options.components.fs.directoryExists(contextDir);
77
- if (contextExists) {
78
- options.components.logger.log('Context directory exists. Removing old files...');
79
- await options.components.fs.rm(contextDir, { recursive: true });
80
- }
81
- options.components.logger.log('Creating context directory...');
82
- await options.components.fs.mkdir(contextDir);
83
- const filesToDownload = await getAllFiles(options.components, GITHUB_API_BASE);
84
- const successfulDownloads = [];
85
- const failedDownloads = [];
86
- const downloadPromises = filesToDownload.map(async ({ url, filename, path: filePath }) => {
87
- try {
88
- const content = await downloadFile(options.components, url);
89
- const localFilePath = path_1.default.join(contextDir, filename);
90
- await options.components.fs.writeFile(localFilePath, content);
91
- options.components.logger.log(`✓ Saved ${filePath}`);
92
- successfulDownloads.push(filePath);
93
- }
94
- catch (error) {
95
- const errorMessage = error instanceof Error ? error.message : String(error);
96
- options.components.logger.log(`✗ Failed to download ${filePath}: ${errorMessage}`);
97
- failedDownloads.push({ filePath, error: errorMessage });
98
- }
99
- });
100
- await Promise.all(downloadPromises);
101
- options.components.logger.log(`\nDownload complete: ${successfulDownloads.length} successful, ${failedDownloads.length} failed`);
102
- if (successfulDownloads.length > 0) {
103
- options.components.logger.log(`Successfully downloaded:`);
104
- successfulDownloads.forEach((filePath) => {
105
- options.components.logger.log(` ✓ ${filePath}`);
106
- });
107
- }
108
- if (failedDownloads.length > 0) {
109
- options.components.logger.log(`Failed downloads:`);
110
- failedDownloads.forEach(({ filePath, error }) => {
111
- options.components.logger.log(` ✗ ${filePath}: ${error}`);
112
- });
113
- }
114
- }
115
- exports.main = main;
116
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/get-context-files/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AAEvB,2CAA8C;AAC9C,yEAA0E;AAC1E,6CAA4C;AAC5C,sDAA6B;AAG7B,MAAM,eAAe,GAAG,iFAAiF,CAAA;AAc5F,QAAA,IAAI,GAAG,IAAA,kBAAW,EAAC;IAC9B,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,QAAQ;CACf,CAAC,CAAA;AAEF,SAAgB,IAAI,CAAC,OAAgB;IACnC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC;;;;;;;;GAQ7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CAAA;IACD,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;QAClC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;QACzD,mBAAmB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACvC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;KACH;IAED,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QAClD,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;YAC9C,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,QAAQ,KAAK,KAAK,EAAE,CAAC,CAAA;QAC5D,CAAC,CAAC,CAAA;KACH;AACH,CAAC;AAzDD,oBAyDC"}
@@ -1,84 +0,0 @@
1
- {
2
- "errors": {
3
- "command": {
4
- "invalid_folder": "Developer: All commands must be inside a folder",
5
- "invalid_index_file": "Developer: All commands must have an \"index.js\" file inside",
6
- "not_found": "Command \"{{command}}\" is invalid. {{help}}",
7
- "not_valid": "Command does not follow implementation rules:\n* Requires a \"help\" function\n* Requires a \"main\" function"
8
- },
9
- "config": {
10
- "not_provided": "Configuration {{key}} was not provided"
11
- },
12
- "account": {
13
- "invalid_private_key": "Addresses should be 64 characters length."
14
- },
15
- "args": {
16
- "arg_error": "Argument error: {{message}}"
17
- },
18
- "portable_experience_sw_validations": {
19
- "invalid_scene_json": "Invalid scene.json file:\n{{errors}}"
20
- },
21
- "project_files": {
22
- "duplicate_file": "The file {{file}} exists with a different casing. Please manually remove one occurrence",
23
- "invalid_package_json": "Error reading the package.json file: {{error}}",
24
- "package_json_required": "The project root doesn't have a package.json file",
25
- "invalid_project_kind": "The kind of project of the folder {{workingDirectory}} cannot be identified"
26
- },
27
- "scene_validations": {
28
- "invalid_scene_json": "Invalid scene.json file:\n{{errors}}",
29
- "duplicate_parcels": "The scene contains duplicated parcel coordinates, they must all be unique. Check Scene Layout settings, or the scene.json file.",
30
- "base_parcel_required": "You must include the coordinates for a base parcel {{base}} on the parcels attribute in the scene.json file.",
31
- "coordinates_outside_limits": "The coordinates {{x}},{{y}} are re outside of the allowed limits, you cannot publish to those coordinates: \n\n{{constraints}}",
32
- "parcels_not_connected": "Some of the parcels listed in the layout are not adjacent to each other, they must all be connected. Check Scene Layout settings, or the scene.json file.",
33
- "invalid_main_format": "This scene's scene.main has an unsupported format {{main}}",
34
- "max_file_size_exceeded": "Maximum file size exceeded: '{{path}}' is larger than {{maxSizeInMb}}MB"
35
- },
36
- "workspace_validations": {
37
- "invalid_workspace_json": "Invalid {{workspace_file}} file:\n{{errors}}",
38
- "invalid_workspace_json_error": "Error reading the {{workspace_file}} file: {{error}}"
39
- },
40
- "deploy": {
41
- "workspace_not_supported": "This scene is not valid for publishing. Make sure the scene dependencies are all up to date.",
42
- "invalid_project_type": "The project you're trying to publish is not being recognized as a Decentraland scene. Make sure it's valid, and that the scene dependencies are all up to date.",
43
- "invalid_arguments": "You can't set values for both the 'target' and 'target-content' arguments in the same command.",
44
- "failed_to_upload": "Could not upload content: {{error}}"
45
- },
46
- "export_static": {
47
- "base_url_required": "--baseUrl is mandatory when --realmName is provided",
48
- "invalid_realm_name": "--realmName has invalid characters",
49
- "invalid_output_directory": "The destination path {{outputDirectory}} is not a directory"
50
- },
51
- "get_context_files": {
52
- "list_failed": "Failed to list context files",
53
- "download_failed": "Failed to download context file"
54
- },
55
- "init": {
56
- "dir_not_empty": "The target directory specified is not empty. Run this command with --yes to override.",
57
- "invalid_arguments": "Specifying --template and --project at the same time is not allowed. Please specify only one of them.",
58
- "invalid_project": "The requested scene doesn't exist empty. Valid options are: {{options}}",
59
- "invalid_template_zip_url": "The zip downloaded has many folder on the root, make sure it has only one folder on the root."
60
- },
61
- "quests": {
62
- "invalid_target": "The provided target is not a valid URL",
63
- "invalid_json": "{{path}} doesn't contain a valid JSON",
64
- "invalid_quest_json": "You provided an invalid Quest JSON. Please check the documentation",
65
- "file_does_not_exist": "File doesn't exist",
66
- "creation_cancelled": "Quest creation was cancelled",
67
- "invalid_address": "You should provide a valid EVM address",
68
- "invalid_uuid": "You should provide a valid uuid"
69
- },
70
- "bundle": {
71
- "scene_main_required": "This scene does not have the required file scene.main",
72
- "scene_runtime_version_required": "The field `\"runtimeVersion\": \"7\"` must be present in the scene's scene.json file. Make sure the scene's code is written in SDK 7.x.",
73
- "tsconfig_required": "This scene does not have the required file {{tsconfig}}",
74
- "no_input_files": "There are no input files to build: {{entrypointSource}}",
75
- "rebuild_failed": "Could not rebuild bundle: {{error}}",
76
- "type_checker_failed": "Typechecker exited with code {{code}}."
77
- },
78
- "code_to_composite": {
79
- "build_failed": "Failed to build the scene: {{error}}",
80
- "bundle_not_found": "Could not find the bundled scene at {{bundlePath}}",
81
- "execution_failed": "Failed to execute scene code: {{error}}"
82
- }
83
- }
84
- }