@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.
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/build/index.js.map +1 -1
- package/dist/commands/deploy/index.d.ts +1 -6
- package/dist/commands/deploy/index.js +11 -38
- package/dist/commands/deploy/index.js.map +1 -1
- package/dist/commands/deploy/utils.js +1 -2
- package/dist/commands/deploy/utils.js.map +1 -1
- package/dist/commands/export-static/index.js +4 -5
- package/dist/commands/export-static/index.js.map +1 -1
- package/dist/commands/init/index.js +4 -5
- package/dist/commands/init/index.js.map +1 -1
- package/dist/commands/quests/index.js +9 -13
- package/dist/commands/quests/index.js.map +1 -1
- package/dist/commands/start/data-layer/fs.d.ts +1 -1
- package/dist/commands/start/data-layer/fs.js +8 -17
- package/dist/commands/start/data-layer/fs.js.map +1 -1
- package/dist/commands/start/data-layer/rpc.d.ts +1 -1
- package/dist/commands/start/data-layer/rpc.js +2 -2
- package/dist/commands/start/data-layer/rpc.js.map +1 -1
- package/dist/commands/start/explorer-alpha.js +14 -21
- package/dist/commands/start/explorer-alpha.js.map +1 -1
- package/dist/commands/start/index.d.ts +4 -2
- package/dist/commands/start/index.js +51 -31
- package/dist/commands/start/index.js.map +1 -1
- package/dist/commands/start/server/endpoints.js +1 -2
- package/dist/commands/start/server/endpoints.js.map +1 -1
- package/dist/commands/start/server/file-watch-notifier.d.ts +1 -1
- package/dist/commands/start/server/file-watch-notifier.js +9 -3
- package/dist/commands/start/server/file-watch-notifier.js.map +1 -1
- package/dist/components/config.js +1 -2
- package/dist/components/config.js.map +1 -1
- package/dist/components/fs.d.ts +1 -1
- package/dist/components/fs.js +0 -1
- package/dist/components/fs.js.map +1 -1
- package/dist/logic/account.js +1 -5
- package/dist/logic/account.js.map +1 -1
- package/dist/logic/args.js +1 -2
- package/dist/logic/args.js.map +1 -1
- package/dist/logic/bundle.js +8 -54
- package/dist/logic/bundle.js.map +1 -1
- package/dist/logic/commands.js +2 -6
- package/dist/logic/commands.js.map +1 -1
- package/dist/logic/dao-explorer.d.ts +3 -0
- package/dist/logic/dao-explorer.js +156 -0
- package/dist/logic/dao-explorer.js.map +1 -0
- package/dist/logic/dcl-ignore.js +0 -2
- package/dist/logic/dcl-ignore.js.map +1 -1
- package/dist/logic/error.d.ts +1 -6
- package/dist/logic/error.js +0 -6
- package/dist/logic/error.js.map +1 -1
- package/dist/logic/portable-experience-sw-validations.js +2 -6
- package/dist/logic/portable-experience-sw-validations.js.map +1 -1
- package/dist/logic/project-files.js +2 -3
- package/dist/logic/project-files.js.map +1 -1
- package/dist/logic/project-validations.js +2 -3
- package/dist/logic/project-validations.js.map +1 -1
- package/dist/logic/scene-validations.js +8 -13
- package/dist/logic/scene-validations.js.map +1 -1
- package/dist/logic/workspace-validations.js +2 -6
- package/dist/logic/workspace-validations.js.map +1 -1
- package/dist/run-command.js +5 -10
- package/dist/run-command.js.map +1 -1
- package/package.json +10 -14
- package/dist/commands/code-to-composite/asset-migrator.d.ts +0 -25
- package/dist/commands/code-to-composite/asset-migrator.js +0 -239
- package/dist/commands/code-to-composite/asset-migrator.js.map +0 -1
- package/dist/commands/code-to-composite/code-commenter.d.ts +0 -11
- package/dist/commands/code-to-composite/code-commenter.js +0 -88
- package/dist/commands/code-to-composite/code-commenter.js.map +0 -1
- package/dist/commands/code-to-composite/composite-generator.d.ts +0 -6
- package/dist/commands/code-to-composite/composite-generator.js +0 -56
- package/dist/commands/code-to-composite/composite-generator.js.map +0 -1
- package/dist/commands/code-to-composite/index.d.ts +0 -16
- package/dist/commands/code-to-composite/index.js +0 -130
- package/dist/commands/code-to-composite/index.js.map +0 -1
- package/dist/commands/code-to-composite/name-generator.d.ts +0 -9
- package/dist/commands/code-to-composite/name-generator.js +0 -140
- package/dist/commands/code-to-composite/name-generator.js.map +0 -1
- package/dist/commands/code-to-composite/scene-executor.d.ts +0 -15
- package/dist/commands/code-to-composite/scene-executor.js +0 -405
- package/dist/commands/code-to-composite/scene-executor.js.map +0 -1
- package/dist/commands/get-context-files/index.d.ts +0 -12
- package/dist/commands/get-context-files/index.js +0 -116
- package/dist/commands/get-context-files/index.js.map +0 -1
- package/dist/locales/en.json +0 -84
- package/dist/locales/es.json +0 -84
- package/dist/locales/zh.json +0 -84
- package/dist/logic/debounce.d.ts +0 -1
- package/dist/logic/debounce.js +0 -12
- package/dist/logic/debounce.js.map +0 -1
- package/dist/logic/lang.d.ts +0 -7
- package/dist/logic/lang.js +0 -40
- package/dist/logic/lang.js.map +0 -1
- package/scripts/postinstall.js +0 -17
package/dist/logic/bundle.js
CHANGED
|
@@ -12,14 +12,11 @@ const fp_future_1 = require("fp-future");
|
|
|
12
12
|
const glob_1 = require("glob");
|
|
13
13
|
const path_1 = __importDefault(require("path"));
|
|
14
14
|
const url_1 = require("url");
|
|
15
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
16
15
|
const log_1 = require("../components/log");
|
|
17
16
|
const beautiful_logs_1 = require("./beautiful-logs");
|
|
18
17
|
const error_1 = require("./error");
|
|
19
18
|
const composite_1 = require("./composite");
|
|
20
19
|
const project_validations_1 = require("./project-validations");
|
|
21
|
-
const chokidar_1 = require("chokidar");
|
|
22
|
-
const debounce_1 = require("./debounce");
|
|
23
20
|
const MAX_STEP = 2;
|
|
24
21
|
/**
|
|
25
22
|
* Generate the entry-point code for a given original entry-point
|
|
@@ -75,21 +72,21 @@ async function bundleProject(components, options, sceneJson) {
|
|
|
75
72
|
const tsconfig = path_1.default.join(options.workingDirectory, 'tsconfig.json');
|
|
76
73
|
/* istanbul ignore if */
|
|
77
74
|
if (!options.single && !sceneJson.main) {
|
|
78
|
-
throw new error_1.CliError('
|
|
75
|
+
throw new error_1.CliError('scene.json .main must be present');
|
|
79
76
|
}
|
|
80
77
|
/* istanbul ignore if */
|
|
81
78
|
if (sceneJson.runtimeVersion !== '7') {
|
|
82
|
-
throw new error_1.CliError('
|
|
79
|
+
throw new error_1.CliError('scene.json `"runtimeVersion": "7"` must be present');
|
|
83
80
|
}
|
|
84
81
|
/* istanbul ignore if */
|
|
85
82
|
if (!(await components.fs.fileExists(tsconfig))) {
|
|
86
|
-
throw new error_1.CliError(
|
|
83
|
+
throw new error_1.CliError(`File ${tsconfig} must exist to compile the Typescript project`);
|
|
87
84
|
}
|
|
88
|
-
const entrypointSource = options.single
|
|
85
|
+
const entrypointSource = options.single ?? 'src/index.ts';
|
|
89
86
|
const entrypoints = (0, glob_1.globSync)(entrypointSource, { cwd: options.workingDirectory, absolute: true });
|
|
90
87
|
/* istanbul ignore if */
|
|
91
88
|
if (!entrypoints.length)
|
|
92
|
-
throw new error_1.CliError(
|
|
89
|
+
throw new error_1.CliError(`There are no input files to build: ${entrypointSource}`);
|
|
93
90
|
// const output = !options.single ? sceneJson.main : options.single.replace(/\.ts$/, '.js')
|
|
94
91
|
// const outfile = path.join(options.workingDirectory, output)
|
|
95
92
|
const inputs = options.single
|
|
@@ -125,25 +122,6 @@ async function bundleSingleProject(components, options) {
|
|
|
125
122
|
absWorkingDir: options.workingDirectory,
|
|
126
123
|
target: 'es2020',
|
|
127
124
|
external: ['~system/*', '@dcl/inspector', '@dcl/inspector/*' /* ban importing the inspector from the SDK */],
|
|
128
|
-
alias: {
|
|
129
|
-
// Ensure React is always resolved to the same module to prevent duplication
|
|
130
|
-
react: (() => {
|
|
131
|
-
try {
|
|
132
|
-
// First try to resolve from project's node_modules
|
|
133
|
-
return require.resolve('react', { paths: [options.workingDirectory] });
|
|
134
|
-
}
|
|
135
|
-
catch {
|
|
136
|
-
try {
|
|
137
|
-
// Fallback to SDK's React dependency
|
|
138
|
-
return require.resolve('react', { paths: [path_1.default.join(__dirname, '../../../@dcl/sdk')] });
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
// Final fallback to bundled React
|
|
142
|
-
return require.resolve('react');
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
})()
|
|
146
|
-
},
|
|
147
125
|
// convert filesystem paths into file:// to enable VSCode debugger
|
|
148
126
|
sourceRoot: options.production ? 'dcl:///' : (0, url_1.pathToFileURL)(path_1.default.dirname(options.outputFile)).toString(),
|
|
149
127
|
define: {
|
|
@@ -173,32 +151,8 @@ async function bundleSingleProject(components, options) {
|
|
|
173
151
|
});
|
|
174
152
|
/* istanbul ignore if */
|
|
175
153
|
if (options.watch) {
|
|
176
|
-
|
|
177
|
-
const watcher = (0, chokidar_1.watch)(path_1.default.resolve(options.workingDirectory), {
|
|
178
|
-
ignored: ['**/dist/**', '**/*.crdt', '**/*.composite', path_1.default.resolve(options.outputFile)],
|
|
179
|
-
ignoreInitial: true
|
|
180
|
-
});
|
|
181
|
-
const debouncedRebuild = (0, debounce_1.debounce)(async () => {
|
|
182
|
-
try {
|
|
183
|
-
await context.rebuild();
|
|
184
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Bundle saved ${log_1.colors.bold(options.outputFile)}`);
|
|
185
|
-
}
|
|
186
|
-
catch (err) {
|
|
187
|
-
/* istanbul ignore next */
|
|
188
|
-
components.logger.error(err.toString());
|
|
189
|
-
}
|
|
190
|
-
}, 100);
|
|
191
|
-
watcher.on('all', async (event, filePath) => {
|
|
192
|
-
// Only rebuild for TypeScript and JavaScript files
|
|
193
|
-
if (/\.(ts|tsx|js|jsx)$/.test(filePath)) {
|
|
194
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `File ${filePath} changed, rebuilding...`);
|
|
195
|
-
debouncedRebuild();
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
// Do initial build
|
|
199
|
-
await context.rebuild();
|
|
154
|
+
await context.watch({});
|
|
200
155
|
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Bundle saved ${log_1.colors.bold(options.outputFile)}`);
|
|
201
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `The compiler is watching for changes`);
|
|
202
156
|
}
|
|
203
157
|
else {
|
|
204
158
|
try {
|
|
@@ -207,7 +161,7 @@ async function bundleSingleProject(components, options) {
|
|
|
207
161
|
}
|
|
208
162
|
catch (err) {
|
|
209
163
|
/* istanbul ignore next */
|
|
210
|
-
throw new error_1.CliError(
|
|
164
|
+
throw new error_1.CliError(err.toString());
|
|
211
165
|
}
|
|
212
166
|
await context.dispose();
|
|
213
167
|
}
|
|
@@ -241,7 +195,7 @@ function runTypeChecker(components, options) {
|
|
|
241
195
|
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Type checking completed without errors`);
|
|
242
196
|
}
|
|
243
197
|
else {
|
|
244
|
-
typeCheckerFuture.reject(new error_1.CliError(
|
|
198
|
+
typeCheckerFuture.reject(new error_1.CliError(`Typechecker exited with code ${code}.`));
|
|
245
199
|
return;
|
|
246
200
|
}
|
|
247
201
|
typeCheckerFuture.resolve(code);
|
package/dist/logic/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/logic/bundle.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,4EAA4E;;;;;;AAG5E,kEAAyC;AACzC,sDAA6B;AAC7B,yCAAkC;AAClC,+BAA+B;AAC/B,gDAAuB;AACvB,6BAAmC;
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/logic/bundle.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,4EAA4E;;;;;;AAG5E,kEAAyC;AACzC,sDAA6B;AAC7B,yCAAkC;AAClC,+BAA+B;AAC/B,gDAAuB;AACvB,6BAAmC;AAEnC,2CAA0C;AAC1C,qDAAqF;AACrF,mCAAkC;AAClC,2CAA8C;AAC9C,+DAAqD;AA0BrD,MAAM,QAAQ,GAAG,CAAC,CAAA;AAElB;;;;;GAKG;AAEH,SAAS,iBAAiB,CAAC,cAAsB,EAAE,iBAA0B,EAAE,gBAAyB,KAAK;IAC3G,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAA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AC"}
|
package/dist/logic/commands.js
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getCommands = exports.COMMANDS_PATH = void 0;
|
|
7
4
|
const path_1 = require("path");
|
|
8
5
|
const error_1 = require("./error");
|
|
9
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
10
6
|
exports.COMMANDS_PATH = (0, path_1.resolve)(__dirname, '../commands');
|
|
11
7
|
async function getCommands({ fs }) {
|
|
12
8
|
const commandDirs = await fs.readdir(exports.COMMANDS_PATH);
|
|
13
9
|
const commands = commandDirs.map(async (dir) => {
|
|
14
10
|
const path = (0, path_1.resolve)(exports.COMMANDS_PATH, dir);
|
|
15
11
|
if (!(await fs.directoryExists(path))) {
|
|
16
|
-
throw new error_1.CliError('
|
|
12
|
+
throw new error_1.CliError('Developer: All commands must be inside a folder');
|
|
17
13
|
}
|
|
18
14
|
try {
|
|
19
15
|
require.resolve(`${path}`);
|
|
20
16
|
}
|
|
21
17
|
catch {
|
|
22
18
|
/* istanbul ignore next */
|
|
23
|
-
throw new error_1.CliError('
|
|
19
|
+
throw new error_1.CliError('Developer: All commands must have an "index.js" file inside');
|
|
24
20
|
}
|
|
25
21
|
return dir;
|
|
26
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/logic/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/logic/commands.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAE9B,mCAAkC;AAErB,QAAA,aAAa,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,aAAa,CAAC,CAAA;AAEvD,KAAK,UAAU,WAAW,CAAC,EAAE,EAAE,EAA6B;IACjE,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,qBAAa,CAAC,CAAA;IAEnD,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAC7C,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,qBAAa,EAAE,GAAG,CAAC,CAAA;QAExC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE;YACrC,MAAM,IAAI,gBAAQ,CAAC,iDAAiD,CAAC,CAAA;SACtE;QAED,IAAI;YACF,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA;SAC3B;QAAC,MAAM;YACN,0BAA0B;YAC1B,MAAM,IAAI,gBAAQ,CAAC,6DAA6D,CAAC,CAAA;SAClF;QAED,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC9B,CAAC;AArBD,kCAqBC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CliComponents } from '../components';
|
|
2
|
+
export declare function ensureDaoExplorer(components: Pick<CliComponents, 'logger' | 'fs' | 'fetch'>, workingDirectory: string): Promise<void>;
|
|
3
|
+
export declare function runDaoExplorer(components: Pick<CliComponents, 'logger' | 'fs' | 'fetch'>, realmUrl: string, locationCoords: string, workingDirectory: string): void;
|
|
@@ -0,0 +1,156 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.runDaoExplorer = exports.ensureDaoExplorer = void 0;
|
|
30
|
+
const fs_1 = require("./fs");
|
|
31
|
+
const path_1 = __importDefault(require("path"));
|
|
32
|
+
const os_1 = require("os");
|
|
33
|
+
const error_1 = require("./error");
|
|
34
|
+
const beautiful_logs_1 = require("./beautiful-logs");
|
|
35
|
+
const tar = __importStar(require("tar"));
|
|
36
|
+
const child_process_1 = __importDefault(require("child_process"));
|
|
37
|
+
var SupportedPlatform;
|
|
38
|
+
(function (SupportedPlatform) {
|
|
39
|
+
SupportedPlatform[SupportedPlatform["SP_MACOS_ARM64"] = 0] = "SP_MACOS_ARM64";
|
|
40
|
+
SupportedPlatform[SupportedPlatform["SP_LINUX_X64"] = 1] = "SP_LINUX_X64";
|
|
41
|
+
SupportedPlatform[SupportedPlatform["SP_WINDOWS_X64"] = 2] = "SP_WINDOWS_X64";
|
|
42
|
+
SupportedPlatform[SupportedPlatform["SP_UNSUPPORTED"] = 3] = "SP_UNSUPPORTED";
|
|
43
|
+
})(SupportedPlatform || (SupportedPlatform = {}));
|
|
44
|
+
const BEVY_BASE_URL = 'https://github.com/decentraland/bevy-explorer/releases/download/alpha-2025-01-27-14-56-57/bevy-explorer-2025-01-27-14-56-57';
|
|
45
|
+
const BEVY_URL_PLATFORM_SUFFIX = {
|
|
46
|
+
[SupportedPlatform.SP_LINUX_X64]: 'linux-x86_64.tar.gz',
|
|
47
|
+
[SupportedPlatform.SP_MACOS_ARM64]: 'macos-m1m2.zip',
|
|
48
|
+
[SupportedPlatform.SP_WINDOWS_X64]: 'windows-x86_64.zip',
|
|
49
|
+
[SupportedPlatform.SP_UNSUPPORTED]: 'empty'
|
|
50
|
+
};
|
|
51
|
+
function getPlatform() {
|
|
52
|
+
const os = (0, os_1.platform)();
|
|
53
|
+
const arch = process.arch;
|
|
54
|
+
switch (os) {
|
|
55
|
+
case 'darwin':
|
|
56
|
+
if (arch === 'arm64') {
|
|
57
|
+
return SupportedPlatform.SP_MACOS_ARM64;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return SupportedPlatform.SP_UNSUPPORTED;
|
|
61
|
+
}
|
|
62
|
+
case 'win32':
|
|
63
|
+
if (arch === 'x64') {
|
|
64
|
+
return SupportedPlatform.SP_WINDOWS_X64;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return SupportedPlatform.SP_UNSUPPORTED;
|
|
68
|
+
}
|
|
69
|
+
case 'linux':
|
|
70
|
+
if (arch === 'x64') {
|
|
71
|
+
return SupportedPlatform.SP_LINUX_X64;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
return SupportedPlatform.SP_UNSUPPORTED;
|
|
75
|
+
}
|
|
76
|
+
default:
|
|
77
|
+
return SupportedPlatform.SP_UNSUPPORTED;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function getDaoExplorerPath(workingDirectory) {
|
|
81
|
+
// Reliable way to get the path to get the first active node_module folder
|
|
82
|
+
const sdkPath = require.resolve('@dcl/sdk');
|
|
83
|
+
if (sdkPath !== null) {
|
|
84
|
+
// SDK-path is something like /node_modules/@dcl/sdk/index.js
|
|
85
|
+
return path_1.default.resolve(sdkPath, '..', '..', '..', '.bin', 'dao-explorer');
|
|
86
|
+
}
|
|
87
|
+
return path_1.default.resolve(workingDirectory, 'node_modules', '.bin', 'dao-explorer');
|
|
88
|
+
}
|
|
89
|
+
function getDaoExplorerExecutablePath(workingDirectory) {
|
|
90
|
+
const platform = getPlatform();
|
|
91
|
+
if (platform === SupportedPlatform.SP_UNSUPPORTED) {
|
|
92
|
+
throw new error_1.CliError('This platform is not supported to run the DAO Explorers.');
|
|
93
|
+
}
|
|
94
|
+
if (platform === SupportedPlatform.SP_WINDOWS_X64) {
|
|
95
|
+
return path_1.default.resolve(getDaoExplorerPath(workingDirectory), 'decentra-bevy.exe');
|
|
96
|
+
}
|
|
97
|
+
if (platform === SupportedPlatform.SP_MACOS_ARM64) {
|
|
98
|
+
return path_1.default.resolve(getDaoExplorerPath(workingDirectory), 'DecentralandBevyExplorer.app/Contents/MacOS/DecentralandBevyExplorer');
|
|
99
|
+
}
|
|
100
|
+
return path_1.default.resolve(getDaoExplorerPath(workingDirectory), 'decentra-bevy');
|
|
101
|
+
}
|
|
102
|
+
async function ensureDaoExplorer(components, workingDirectory) {
|
|
103
|
+
const daoExplorerFolderPath = getDaoExplorerPath(workingDirectory);
|
|
104
|
+
const platform = getPlatform();
|
|
105
|
+
if (platform === SupportedPlatform.SP_UNSUPPORTED) {
|
|
106
|
+
throw new error_1.CliError('This platform is not supported to run the DAO Explorers.');
|
|
107
|
+
}
|
|
108
|
+
const url = `${BEVY_BASE_URL}-${BEVY_URL_PLATFORM_SUFFIX[platform]}`;
|
|
109
|
+
const versionFilePath = path_1.default.resolve(daoExplorerFolderPath, 'version');
|
|
110
|
+
if (await components.fs.fileExists(versionFilePath)) {
|
|
111
|
+
const versionContent = await components.fs.readFile(versionFilePath, 'utf-8');
|
|
112
|
+
if (versionContent === url) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const tempPackagePath = path_1.default.resolve(daoExplorerFolderPath, BEVY_URL_PLATFORM_SUFFIX[platform]);
|
|
117
|
+
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Downloading DAO Explorer ${BEVY_URL_PLATFORM_SUFFIX[platform]} from ${url}`);
|
|
118
|
+
if (await components.fs.directoryExists(daoExplorerFolderPath)) {
|
|
119
|
+
await components.fs.rm(daoExplorerFolderPath, { recursive: true, force: true });
|
|
120
|
+
}
|
|
121
|
+
await components.fs.mkdir(daoExplorerFolderPath, { recursive: true });
|
|
122
|
+
await (0, fs_1.download)(components, url, tempPackagePath);
|
|
123
|
+
if (tempPackagePath.endsWith('.zip')) {
|
|
124
|
+
await (0, fs_1.extract)(tempPackagePath, daoExplorerFolderPath);
|
|
125
|
+
}
|
|
126
|
+
else if (tempPackagePath.endsWith('.tar.gz') || tempPackagePath.endsWith('.tgz')) {
|
|
127
|
+
await tar.extract({
|
|
128
|
+
C: daoExplorerFolderPath,
|
|
129
|
+
f: tempPackagePath
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
await components.fs.writeFile(versionFilePath, url);
|
|
133
|
+
}
|
|
134
|
+
exports.ensureDaoExplorer = ensureDaoExplorer;
|
|
135
|
+
function runDaoExplorer(components, realmUrl, locationCoords, workingDirectory) {
|
|
136
|
+
const daoExplorerFolderPath = getDaoExplorerPath(workingDirectory);
|
|
137
|
+
const executablePath = getDaoExplorerExecutablePath(workingDirectory);
|
|
138
|
+
executablePath;
|
|
139
|
+
const ts = child_process_1.default.spawn(executablePath, ['--preview', '--server', realmUrl, '--location', locationCoords], {
|
|
140
|
+
env: process.env,
|
|
141
|
+
cwd: daoExplorerFolderPath
|
|
142
|
+
});
|
|
143
|
+
ts.on('close', (code) => {
|
|
144
|
+
/* istanbul ignore else */
|
|
145
|
+
if (code === 0) {
|
|
146
|
+
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Type checking completed without errors`);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
ts.stdout.pipe(process.stdout);
|
|
153
|
+
ts.stderr.pipe(process.stderr);
|
|
154
|
+
}
|
|
155
|
+
exports.runDaoExplorer = runDaoExplorer;
|
|
156
|
+
//# sourceMappingURL=dao-explorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dao-explorer.js","sourceRoot":"","sources":["../../src/logic/dao-explorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6BAAwC;AACxC,gDAAuB;AACvB,2BAA6B;AAC7B,mCAAkC;AAClC,qDAAoD;AACpD,yCAA0B;AAC1B,kEAAyC;AAEzC,IAAK,iBAKJ;AALD,WAAK,iBAAiB;IACpB,6EAAc,CAAA;IACd,yEAAY,CAAA;IACZ,6EAAc,CAAA;IACd,6EAAc,CAAA;AAChB,CAAC,EALI,iBAAiB,KAAjB,iBAAiB,QAKrB;AAED,MAAM,aAAa,GACjB,6HAA6H,CAAA;AAC/H,MAAM,wBAAwB,GAAsC;IAClE,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE,qBAAqB;IACvD,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,gBAAgB;IACpD,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,oBAAoB;IACxD,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,OAAO;CAC5C,CAAA;AAED,SAAS,WAAW;IAClB,MAAM,EAAE,GAAG,IAAA,aAAQ,GAAE,CAAA;IACrB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IACzB,QAAQ,EAAE,EAAE;QACV,KAAK,QAAQ;YACX,IAAI,IAAI,KAAK,OAAO,EAAE;gBACpB,OAAO,iBAAiB,C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AAU,CAAC,MAAM,EAAE,wCAAwC,CAAC,CAAA;SAC/E;aAAM;YACL,OAAM;SACP;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AAChC,CAAC;AAzBD,wCAyBC"}
|
package/dist/logic/dcl-ignore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dcl-ignore.js","sourceRoot":"","sources":["../../src/logic/dcl-ignore.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AAGV,QAAA,gBAAgB,GAAG;IAC9B,IAAI;IACJ,cAAc;IACd,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,QAAQ;IACR,eAAe;IACf,aAAa;IACb,cAAc;IACd,
|
|
1
|
+
{"version":3,"file":"dcl-ignore.js","sourceRoot":"","sources":["../../src/logic/dcl-ignore.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AAGV,QAAA,gBAAgB,GAAG;IAC9B,IAAI;IACJ,cAAc;IACd,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,QAAQ;IACR,eAAe;IACf,aAAa;IACb,cAAc;IACd,SAAS;IACT,UAAU;IACV,YAAY;IACZ,MAAM;IACN,WAAW;IACX,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAA;AAEM,KAAK,UAAU,wBAAwB,CAC5C,UAAqC,EACrC,GAAW;IAEX,IAAI;QACF,OAAO,MAAM,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAA;QAC5E,qCAAqC;KACtC;IAAC,OAAO,CAAC,EAAE,GAAE;IAEd,OAAO,IAAI,CAAA;AACb,CAAC;AAVD,4DAUC;AAED;;;GAGG;AACI,KAAK,UAAU,oBAAoB,CAAC,UAAqC,EAAE,GAAW;IAC3F,MAAM,cAAc,GAAG,MAAM,wBAAwB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IACtE,MAAM,OAAO,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,wBAAgB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACjF,OAAO,CAAC,IAAI,CAAC,GAAG,wBAAgB,CAAC,CAAA;IAEjC,2CAA2C;IAC3C,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAA;IAE5E,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;AACrC,CAAC;AATD,oDASC"}
|
package/dist/logic/error.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare class CliError<T extends CliErrorName> extends Error {
|
|
3
|
-
name: T;
|
|
4
|
-
message: string;
|
|
5
|
-
stack?: string | undefined;
|
|
6
|
-
constructor(name?: T, message?: string, stack?: string | undefined);
|
|
1
|
+
export declare class CliError extends Error {
|
|
7
2
|
}
|
package/dist/logic/error.js
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CliError = void 0;
|
|
4
4
|
class CliError extends Error {
|
|
5
|
-
constructor(name = 'CliError', message = '', stack) {
|
|
6
|
-
super();
|
|
7
|
-
this.name = name;
|
|
8
|
-
this.message = message;
|
|
9
|
-
this.stack = stack;
|
|
10
|
-
}
|
|
11
5
|
}
|
|
12
6
|
exports.CliError = CliError;
|
|
13
7
|
//# sourceMappingURL=error.js.map
|
package/dist/logic/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/logic/error.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/logic/error.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAS,SAAQ,KAAK;CAAG;AAAtC,4BAAsC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getValidWearableJson = exports.assertValidSmartWearable = exports.getSmartWearableFile = exports.SMART_WEARABLE_FILE = void 0;
|
|
7
4
|
const path_1 = require("path");
|
|
8
5
|
const schemas_1 = require("@dcl/schemas");
|
|
9
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
10
6
|
const error_1 = require("./error");
|
|
11
7
|
exports.SMART_WEARABLE_FILE = 'wearable.json';
|
|
12
8
|
/**
|
|
@@ -25,7 +21,7 @@ function assertValidSmartWearable(scene) {
|
|
|
25
21
|
errors.push(`Error validating scene.json: ${error.message}`);
|
|
26
22
|
}
|
|
27
23
|
}
|
|
28
|
-
throw new error_1.CliError('
|
|
24
|
+
throw new error_1.CliError('Invalid scene.json file:\n' + errors.join('\n'));
|
|
29
25
|
}
|
|
30
26
|
// TODO
|
|
31
27
|
return true;
|
|
@@ -41,7 +37,7 @@ async function getValidWearableJson(components, projectRoot) {
|
|
|
41
37
|
return wearableJson;
|
|
42
38
|
}
|
|
43
39
|
catch (err) {
|
|
44
|
-
throw new error_1.CliError(
|
|
40
|
+
throw new error_1.CliError(`Error reading the wearable.json file: ${err.message}`);
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
43
|
exports.getValidWearableJson = getValidWearableJson;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portable-experience-sw-validations.js","sourceRoot":"","sources":["../../src/logic/portable-experience-sw-validations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"portable-experience-sw-validations.js","sourceRoot":"","sources":["../../src/logic/portable-experience-sw-validations.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAC9B,0CAAoC;AAEpC,mCAAkC;AAQrB,QAAA,mBAAmB,GAAG,eAAe,CAAA;AAElD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,WAAmB;IACtD,OAAO,IAAA,cAAO,EAAC,WAAW,EAAE,2BAAmB,CAAC,CAAA;AAClD,CAAC;AAFD,oDAEC;AAED,SAAgB,wBAAwB,CAAC,KAAY;IACnD,IAAI,CAAC,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC1B,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,IAAI,eAAK,CAAC,QAAQ,CAAC,MAAM,EAAE;YACzB,KAAK,MAAM,KAAK,IAAI,eAAK,CAAC,QAAQ,CAAC,MAAM,EAAE;gBACzC,MAAM,CAAC,IAAI,CAAC,gCAAgC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;aAC7D;SACF;QACD,MAAM,IAAI,gBAAQ,CAAC,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;KACrE;IACD,OAAO;IACP,OAAO,IAAI,CAAA;AACb,CAAC;AAZD,4DAYC;AAED;;GAEG;AACI,KAAK,UAAU,oBAAoB,CACxC,UAAgD,EAChD,WAAmB;IAEnB,IAAI;QACF,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAA;QAC/F,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAU,CAAA;QACzD,OAAO,YAAY,CAAA;KACpB;IAAC,OAAO,GAAQ,EAAE;QACjB,MAAM,IAAI,gBAAQ,CAAC,yCAAyC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;KAC3E;AACH,CAAC;AAXD,oDAWC"}
|
|
@@ -30,7 +30,6 @@ exports.getPackageJson = exports.b64HashingFunction = exports.getProjectPublisha
|
|
|
30
30
|
const dcl_ignore_1 = require("./dcl-ignore");
|
|
31
31
|
const glob_1 = require("glob");
|
|
32
32
|
const ignore_1 = __importDefault(require("ignore"));
|
|
33
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
34
33
|
const path_1 = __importStar(require("path"));
|
|
35
34
|
const error_1 = require("./error");
|
|
36
35
|
/**
|
|
@@ -95,7 +94,7 @@ async function getProjectPublishableFilesWithHashes(components, projectRoot, has
|
|
|
95
94
|
const normalizedFile = normalizeDecentralandFilename(projectRoot, file);
|
|
96
95
|
/* istanbul ignore if */
|
|
97
96
|
if (usedFilenames.has(normalizedFile)) {
|
|
98
|
-
throw new error_1.CliError(
|
|
97
|
+
throw new error_1.CliError(`DuplicatedFilenameError: the file ${file} exists with a different casing. Please manually remove one occurrence`);
|
|
99
98
|
}
|
|
100
99
|
usedFilenames.add(normalizedFile);
|
|
101
100
|
ret.push({
|
|
@@ -116,7 +115,7 @@ async function getPackageJson(components, projectRoot) {
|
|
|
116
115
|
return packageJson;
|
|
117
116
|
}
|
|
118
117
|
catch (err) {
|
|
119
|
-
throw new error_1.CliError(
|
|
118
|
+
throw new error_1.CliError(`Error reading the package.json file: ${err.message}`);
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
exports.getPackageJson = getPackageJson;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/logic/project-files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAAmD;AACnD,+BAAuC;AACvC,oDAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/logic/project-files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAAmD;AACnD,+BAAuC;AACvC,oDAA2B;AAC3B,6CAAoC;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AW,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAA;QACjG,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAgB,CAAA;QAC7D,OAAO,WAAW,CAAA;KACnB;IAAC,OAAO,GAAQ,EAAE;QACjB,MAAM,IAAI,gBAAQ,CAAC,wCAAwC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;KAC1E;AACH,CAAC;AARD,wCAQC"}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.isEditorScene = exports.startValidations = exports.npmCommand = exports.npmRun = exports.installDependencies = exports.needsDependencies = exports.assertValidProjectFolder = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
9
8
|
const log_1 = require("../components/log");
|
|
10
9
|
const beautiful_logs_1 = require("./beautiful-logs");
|
|
11
10
|
const error_1 = require("./error");
|
|
@@ -19,7 +18,7 @@ const project_files_1 = require("./project-files");
|
|
|
19
18
|
async function assertValidProjectFolder(components, workingDirectory) {
|
|
20
19
|
// no validations for now, only check that it exists
|
|
21
20
|
if (!(await components.fs.fileExists(path_1.default.resolve(workingDirectory, 'package.json'))))
|
|
22
|
-
throw new error_1.CliError('
|
|
21
|
+
throw new error_1.CliError(`The project root doesn't have a package.json file`);
|
|
23
22
|
// now we will iterate over different file to evaluate the project kind
|
|
24
23
|
switch (true) {
|
|
25
24
|
case await components.fs.fileExists((0, portable_experience_sw_validations_1.getSmartWearableFile)(workingDirectory)): {
|
|
@@ -30,7 +29,7 @@ async function assertValidProjectFolder(components, workingDirectory) {
|
|
|
30
29
|
return { kind: 'scene', scene: await (0, scene_validations_1.getValidSceneJson)(components, workingDirectory), workingDirectory };
|
|
31
30
|
}
|
|
32
31
|
default: {
|
|
33
|
-
throw new error_1.CliError(
|
|
32
|
+
throw new error_1.CliError(`UnknownProjectKind: the kind of project of the folder ${workingDirectory} cannot be identified`);
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-validations.js","sourceRoot":"","sources":["../../src/logic/project-validations.ts"],"names":[],"mappings":";;;;;;AACA,gDAAuB;
|
|
1
|
+
{"version":3,"file":"project-validations.js","sourceRoot":"","sources":["../../src/logic/project-validations.ts"],"names":[],"mappings":";;;;;;AACA,gDAAuB;AAEvB,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,CAAC,MAAM,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,cAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC,CAAC;QACnF,MAAM,IAAI,gBAAQ,CAAC,mDAAmD,CAAC,CAAA;IAEzE,uEAAuE;IACvE,QAAQ,IAAI,EAAE;QACZ,KAAK,MAAM,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,IAAA,yDAAoB,EAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;YAC3E,MAAM,IAAA,yDAAoB,EAAC,UAAU,EAAE,gBAAgB,CAAC,CAAA;YACxD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,IAAA,qCAAiB,EAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAA;SAClH;QAED,KAAK,MAAM,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,IAAA,oCAAgB,EAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;YACvE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAA,qCAAiB,EAAC,UAAU,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C,iBAAiB,EAAE,UAAU,CAAC,SAAS,CAAC;YACxC,iBAAiB,KAAK,OAAO,EAC7B;YACA,OAAM;SACP;QAED,IACE,WAAW,CAAC,YAAY;YACxB,CAAC,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,EACrF;YACA,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAAC,GAAG,UAAU,CAAA;YACxD,IAAI,WAAW,CAAC,eAAe,IAAI,WAAW,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE;gBACjF,OAAO,WAAW,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAA;aACtD;SACF;aAAM;YACL,WAAW,CAAC,eAAe,GAAG,WAAW,CAAC,eAAe,IAAI,EAAE,CAAA;YAC/D,WAAW,CAAC,eAAe,CAAC,iBAAiB,CAAC,GAAG,UAAU,CAAA;SAC5D;QACD,MAAM,UAAU,CAAC,EAAE,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;KAC9F;IAAC,OAAO,CAAM,EAAE;QACf,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;KACtE;AACH,CAAC;AAtCD,4CAsCC;AAED,kFAAkF;AAClF,SAAgB,aAAa,CAAC,UAAqC,EAAE,gBAAwB;IAC3F,OAAO,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,cAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAA;AAC9E,CAAC;AAFD,sCAEC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.validateFilesSizes = exports.getFiles = exports.getBaseCoords = exports.getValidSceneJson = exports.assertValidScene = exports.getSceneFilePath = exports.MAX_FILE_SIZE_BYTES = exports.SCENE_FILE = void 0;
|
|
7
4
|
const path_1 = require("path");
|
|
8
5
|
const schemas_1 = require("@dcl/schemas");
|
|
9
6
|
const dist_cjs_1 = require("@dcl/ecs/dist-cjs");
|
|
10
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
11
7
|
const project_1 = require("../commands/init/project");
|
|
12
8
|
const error_1 = require("./error");
|
|
13
9
|
const coordinates_1 = require("./coordinates");
|
|
@@ -46,14 +42,14 @@ function assertValidScene(components, scene, opts = { log: false }) {
|
|
|
46
42
|
errors.push(`Error validating scene.json: ${errorPath} ${error.message}`);
|
|
47
43
|
}
|
|
48
44
|
}
|
|
49
|
-
throw new error_1.CliError('
|
|
45
|
+
throw new error_1.CliError('Invalid scene.json file:\n' + errors.join('\n'));
|
|
50
46
|
}
|
|
51
47
|
const parcelSet = new Set(scene.scene?.parcels);
|
|
52
48
|
if (parcelSet.size < scene.scene?.parcels?.length) {
|
|
53
|
-
throw new error_1.CliError(
|
|
49
|
+
throw new error_1.CliError(`There are duplicated parcels at scene.json.`);
|
|
54
50
|
}
|
|
55
51
|
if (!parcelSet.has(scene.scene?.base)) {
|
|
56
|
-
throw new error_1.CliError(
|
|
52
|
+
throw new error_1.CliError(`Your base parcel ${scene.scene?.base} should be included on parcels attribute at scene.json`);
|
|
57
53
|
}
|
|
58
54
|
const objParcels = scene.scene?.parcels?.map(coordinates_1.getObject);
|
|
59
55
|
objParcels.forEach(({ x, y }) => {
|
|
@@ -61,13 +57,13 @@ function assertValidScene(components, scene, opts = { log: false }) {
|
|
|
61
57
|
return;
|
|
62
58
|
}
|
|
63
59
|
const constraints = getWorldRangesConstraintsMessage();
|
|
64
|
-
throw new error_1.CliError(
|
|
60
|
+
throw new error_1.CliError(`Coordinates ${x},${y} are outside of allowed limits: \n\n${constraints}`);
|
|
65
61
|
});
|
|
66
62
|
if (!(0, dist_cjs_1.areConnected)(objParcels)) {
|
|
67
|
-
throw new error_1.CliError('
|
|
63
|
+
throw new error_1.CliError('Parcels described on scene.json are not connected. They should be one next to each other');
|
|
68
64
|
}
|
|
69
65
|
if (!scene.main?.endsWith('.js')) {
|
|
70
|
-
throw new error_1.CliError(
|
|
66
|
+
throw new error_1.CliError(`Main scene format file (${scene.main}) is not a supported format`);
|
|
71
67
|
}
|
|
72
68
|
const minimalScene = (0, project_1.getMinimalSceneJson)();
|
|
73
69
|
const defaults = { ...minimalScene.display, navmapThumbnail: 'images/scene-thumbnail.png' };
|
|
@@ -90,7 +86,7 @@ async function getValidSceneJson(components, projectRoot, opts) {
|
|
|
90
86
|
return sceneJson;
|
|
91
87
|
}
|
|
92
88
|
catch (err) {
|
|
93
|
-
throw new error_1.CliError(
|
|
89
|
+
throw new error_1.CliError(`Error reading the scene.json file: ${err.message}`);
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
92
|
exports.getValidSceneJson = getValidSceneJson;
|
|
@@ -128,8 +124,7 @@ exports.getFiles = getFiles;
|
|
|
128
124
|
function validateFilesSizes(files) {
|
|
129
125
|
for (const { path, size } of files) {
|
|
130
126
|
if (size > exports.MAX_FILE_SIZE_BYTES) {
|
|
131
|
-
|
|
132
|
-
throw new error_1.CliError('SCENE_VALIDATIONS_MAX_FILE_SIZE_EXCEEDED', i18next_1.default.t('errors.scene_validations.max_file_size_exceeded', { path, maxSizeInMb }));
|
|
127
|
+
throw new error_1.CliError(`Maximum file size exceeded: '${path}' is larger than ${exports.MAX_FILE_SIZE_BYTES / 1e6}MB`);
|
|
133
128
|
}
|
|
134
129
|
}
|
|
135
130
|
}
|