decentrand 3.21.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +56 -0
- package/abi/EstateRegistry.json +1226 -0
- package/abi/LANDRegistry.json +1372 -0
- package/abi/MANAToken.json +410 -0
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +108 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/coords.d.ts +3 -0
- package/dist/commands/coords.d.ts.map +1 -0
- package/dist/commands/coords.js +122 -0
- package/dist/commands/coords.js.map +1 -0
- package/dist/commands/deploy.d.ts +4 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +280 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/export.d.ts +3 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +20 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +19 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/info.d.ts +3 -0
- package/dist/commands/info.d.ts.map +1 -0
- package/dist/commands/info.js +186 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init/help.d.ts +12 -0
- package/dist/commands/init/help.d.ts.map +1 -0
- package/dist/commands/init/help.js +41 -0
- package/dist/commands/init/help.js.map +1 -0
- package/dist/commands/init/index.d.ts +3 -0
- package/dist/commands/init/index.d.ts.map +1 -0
- package/dist/commands/init/index.js +96 -0
- package/dist/commands/init/index.js.map +1 -0
- package/dist/commands/init/library.d.ts +1 -0
- package/dist/commands/init/library.d.ts.map +1 -0
- package/dist/commands/init/library.js +2 -0
- package/dist/commands/init/library.js.map +1 -0
- package/dist/commands/init/repositories.d.ts +11 -0
- package/dist/commands/init/repositories.d.ts.map +1 -0
- package/dist/commands/init/repositories.js +40 -0
- package/dist/commands/init/repositories.js.map +1 -0
- package/dist/commands/init/scene.d.ts +3 -0
- package/dist/commands/init/scene.d.ts.map +1 -0
- package/dist/commands/init/scene.js +56 -0
- package/dist/commands/init/scene.js.map +1 -0
- package/dist/commands/init/types.d.ts +22 -0
- package/dist/commands/init/types.d.ts.map +1 -0
- package/dist/commands/init/types.js +3 -0
- package/dist/commands/init/types.js.map +1 -0
- package/dist/commands/init/utils.d.ts +6 -0
- package/dist/commands/init/utils.d.ts.map +1 -0
- package/dist/commands/init/utils.js +76 -0
- package/dist/commands/init/utils.js.map +1 -0
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +92 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/pack.d.ts +3 -0
- package/dist/commands/pack.d.ts.map +1 -0
- package/dist/commands/pack.js +102 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/start.d.ts +3 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +235 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +80 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/workspace.d.ts +3 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +81 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/commands/world-acl.d.ts +22 -0
- package/dist/commands/world-acl.d.ts.map +1 -0
- package/dist/commands/world-acl.js +262 -0
- package/dist/commands/world-acl.js.map +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +128 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/API.d.ts +23 -0
- package/dist/lib/API.d.ts.map +1 -0
- package/dist/lib/API.js +175 -0
- package/dist/lib/API.js.map +1 -0
- package/dist/lib/Decentraland.d.ts +75 -0
- package/dist/lib/Decentraland.d.ts.map +1 -0
- package/dist/lib/Decentraland.js +227 -0
- package/dist/lib/Decentraland.js.map +1 -0
- package/dist/lib/Ethereum.d.ts +52 -0
- package/dist/lib/Ethereum.d.ts.map +1 -0
- package/dist/lib/Ethereum.js +245 -0
- package/dist/lib/Ethereum.js.map +1 -0
- package/dist/lib/IEthereumDataProvider.d.ts +17 -0
- package/dist/lib/IEthereumDataProvider.d.ts.map +1 -0
- package/dist/lib/IEthereumDataProvider.js +3 -0
- package/dist/lib/IEthereumDataProvider.js.map +1 -0
- package/dist/lib/LinkerAPI.d.ts +28 -0
- package/dist/lib/LinkerAPI.d.ts.map +1 -0
- package/dist/lib/LinkerAPI.js +151 -0
- package/dist/lib/LinkerAPI.js.map +1 -0
- package/dist/lib/Preview.d.ts +17 -0
- package/dist/lib/Preview.d.ts.map +1 -0
- package/dist/lib/Preview.js +113 -0
- package/dist/lib/Preview.js.map +1 -0
- package/dist/lib/Project.d.ts +152 -0
- package/dist/lib/Project.d.ts.map +1 -0
- package/dist/lib/Project.js +446 -0
- package/dist/lib/Project.js.map +1 -0
- package/dist/lib/Workspace.d.ts +21 -0
- package/dist/lib/Workspace.d.ts.map +1 -0
- package/dist/lib/Workspace.js +140 -0
- package/dist/lib/Workspace.js.map +1 -0
- package/dist/lib/WorldsContentServer.d.ts +27 -0
- package/dist/lib/WorldsContentServer.d.ts.map +1 -0
- package/dist/lib/WorldsContentServer.js +79 -0
- package/dist/lib/WorldsContentServer.js.map +1 -0
- package/dist/lib/WorldsContentServerLinkerAPI.d.ts +21 -0
- package/dist/lib/WorldsContentServerLinkerAPI.d.ts.map +1 -0
- package/dist/lib/WorldsContentServerLinkerAPI.js +105 -0
- package/dist/lib/WorldsContentServerLinkerAPI.js.map +1 -0
- package/dist/lib/adapters/proto/broker.d.ts +2 -0
- package/dist/lib/adapters/proto/broker.d.ts.map +1 -0
- package/dist/lib/adapters/proto/broker.js +2189 -0
- package/dist/lib/adapters/proto/broker.js.map +1 -0
- package/dist/lib/adapters/proto/comms.d.ts +2 -0
- package/dist/lib/adapters/proto/comms.d.ts.map +1 -0
- package/dist/lib/adapters/proto/comms.js +965 -0
- package/dist/lib/adapters/proto/comms.js.map +1 -0
- package/dist/lib/adapters/ws.d.ts +12 -0
- package/dist/lib/adapters/ws.d.ts.map +1 -0
- package/dist/lib/adapters/ws.js +20 -0
- package/dist/lib/adapters/ws.js.map +1 -0
- package/dist/lib/content/ContentService.d.ts +27 -0
- package/dist/lib/content/ContentService.d.ts.map +1 -0
- package/dist/lib/content/ContentService.js +60 -0
- package/dist/lib/content/ContentService.js.map +1 -0
- package/dist/lib/content/types.d.ts +12 -0
- package/dist/lib/content/types.d.ts.map +1 -0
- package/dist/lib/content/types.js +3 -0
- package/dist/lib/content/types.js.map +1 -0
- package/dist/lib/controllers/bff.d.ts +8 -0
- package/dist/lib/controllers/bff.d.ts.map +1 -0
- package/dist/lib/controllers/bff.js +58 -0
- package/dist/lib/controllers/bff.js.map +1 -0
- package/dist/lib/controllers/debugger.d.ts +4 -0
- package/dist/lib/controllers/debugger.d.ts.map +1 -0
- package/dist/lib/controllers/debugger.js +42 -0
- package/dist/lib/controllers/debugger.js.map +1 -0
- package/dist/lib/controllers/ecs6-endpoints.d.ts +11 -0
- package/dist/lib/controllers/ecs6-endpoints.d.ts.map +1 -0
- package/dist/lib/controllers/ecs6-endpoints.js +543 -0
- package/dist/lib/controllers/ecs6-endpoints.js.map +1 -0
- package/dist/lib/controllers/legacy-comms-v1.d.ts +7 -0
- package/dist/lib/controllers/legacy-comms-v1.d.ts.map +1 -0
- package/dist/lib/controllers/legacy-comms-v1.js +98 -0
- package/dist/lib/controllers/legacy-comms-v1.js.map +1 -0
- package/dist/lib/smartItems/buildSmartItem.d.ts +2 -0
- package/dist/lib/smartItems/buildSmartItem.d.ts.map +1 -0
- package/dist/lib/smartItems/buildSmartItem.js +18 -0
- package/dist/lib/smartItems/buildSmartItem.js.map +1 -0
- package/dist/lib/smartItems/packProject.d.ts +2 -0
- package/dist/lib/smartItems/packProject.d.ts.map +1 -0
- package/dist/lib/smartItems/packProject.js +31 -0
- package/dist/lib/smartItems/packProject.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +151 -0
- package/dist/main.js.map +1 -0
- package/dist/project/installDependencies.d.ts +2 -0
- package/dist/project/installDependencies.d.ts.map +1 -0
- package/dist/project/installDependencies.js +57 -0
- package/dist/project/installDependencies.js.map +1 -0
- package/dist/project/isTypescriptProject.d.ts +2 -0
- package/dist/project/isTypescriptProject.d.ts.map +1 -0
- package/dist/project/isTypescriptProject.js +14 -0
- package/dist/project/isTypescriptProject.js.map +1 -0
- package/dist/project/projectInfo.d.ts +8 -0
- package/dist/project/projectInfo.d.ts.map +1 -0
- package/dist/project/projectInfo.js +89 -0
- package/dist/project/projectInfo.js.map +1 -0
- package/dist/project/updateBundleDependenciesField.d.ts +4 -0
- package/dist/project/updateBundleDependenciesField.d.ts.map +1 -0
- package/dist/project/updateBundleDependenciesField.js +67 -0
- package/dist/project/updateBundleDependenciesField.js.map +1 -0
- package/dist/sceneJson/index.d.ts +4 -0
- package/dist/sceneJson/index.d.ts.map +1 -0
- package/dist/sceneJson/index.js +24 -0
- package/dist/sceneJson/index.js.map +1 -0
- package/dist/sceneJson/lintSceneFile.d.ts +2 -0
- package/dist/sceneJson/lintSceneFile.d.ts.map +1 -0
- package/dist/sceneJson/lintSceneFile.js +13 -0
- package/dist/sceneJson/lintSceneFile.js.map +1 -0
- package/dist/sceneJson/utils.d.ts +3 -0
- package/dist/sceneJson/utils.d.ts.map +1 -0
- package/dist/sceneJson/utils.js +66 -0
- package/dist/sceneJson/utils.js.map +1 -0
- package/dist/utils/analytics.d.ts +42 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +111 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/buildProject.d.ts +2 -0
- package/dist/utils/buildProject.d.ts.map +1 -0
- package/dist/utils/buildProject.js +26 -0
- package/dist/utils/buildProject.js.map +1 -0
- package/dist/utils/catalystPointers.d.ts +20 -0
- package/dist/utils/catalystPointers.d.ts.map +1 -0
- package/dist/utils/catalystPointers.js +51 -0
- package/dist/utils/catalystPointers.js.map +1 -0
- package/dist/utils/coordinateHelpers.d.ts +65 -0
- package/dist/utils/coordinateHelpers.d.ts.map +1 -0
- package/dist/utils/coordinateHelpers.js +126 -0
- package/dist/utils/coordinateHelpers.js.map +1 -0
- package/dist/utils/download.d.ts +3 -0
- package/dist/utils/download.d.ts.map +1 -0
- package/dist/utils/download.js +42 -0
- package/dist/utils/download.js.map +1 -0
- package/dist/utils/env.d.ts +6 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +31 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/errors.d.ts +18 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +27 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/filesystem.d.ts +41 -0
- package/dist/utils/filesystem.d.ts.map +1 -0
- package/dist/utils/filesystem.js +84 -0
- package/dist/utils/filesystem.js.map +1 -0
- package/dist/utils/getDummyMappings.d.ts +3 -0
- package/dist/utils/getDummyMappings.d.ts.map +1 -0
- package/dist/utils/getDummyMappings.js +19 -0
- package/dist/utils/getDummyMappings.js.map +1 -0
- package/dist/utils/getProjectFilePaths.d.ts +2 -0
- package/dist/utils/getProjectFilePaths.d.ts.map +1 -0
- package/dist/utils/getProjectFilePaths.js +40 -0
- package/dist/utils/getProjectFilePaths.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +33 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/installedDependencies.d.ts +6 -0
- package/dist/utils/installedDependencies.d.ts.map +1 -0
- package/dist/utils/installedDependencies.js +44 -0
- package/dist/utils/installedDependencies.js.map +1 -0
- package/dist/utils/land.d.ts +4 -0
- package/dist/utils/land.d.ts.map +1 -0
- package/dist/utils/land.js +35 -0
- package/dist/utils/land.js.map +1 -0
- package/dist/utils/logging.d.ts +19 -0
- package/dist/utils/logging.d.ts.map +1 -0
- package/dist/utils/logging.js +97 -0
- package/dist/utils/logging.js.map +1 -0
- package/dist/utils/moduleHelpers.d.ts +22 -0
- package/dist/utils/moduleHelpers.d.ts.map +1 -0
- package/dist/utils/moduleHelpers.js +163 -0
- package/dist/utils/moduleHelpers.js.map +1 -0
- package/dist/utils/nodeAndNpmVersion.d.ts +5 -0
- package/dist/utils/nodeAndNpmVersion.d.ts.map +1 -0
- package/dist/utils/nodeAndNpmVersion.js +64 -0
- package/dist/utils/nodeAndNpmVersion.js.map +1 -0
- package/dist/utils/pathsExistOnDir.d.ts +2 -0
- package/dist/utils/pathsExistOnDir.d.ts.map +1 -0
- package/dist/utils/pathsExistOnDir.js +12 -0
- package/dist/utils/pathsExistOnDir.js.map +1 -0
- package/dist/utils/project.d.ts +29 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +48 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/utils/shellCommands.d.ts +19 -0
- package/dist/utils/shellCommands.d.ts.map +1 -0
- package/dist/utils/shellCommands.js +73 -0
- package/dist/utils/shellCommands.js.map +1 -0
- package/dist/utils/spinner.d.ts +6 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +58 -0
- package/dist/utils/spinner.js.map +1 -0
- package/package.json +115 -0
- package/samples/workspace/Dockerfile +21 -0
- package/samples/workspace/package.json +16 -0
- package/sbzkmrj2.cjs +1 -0
@@ -0,0 +1,280 @@
|
|
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.main = exports.failWithSpinner = exports.help = void 0;
|
30
|
+
const arg_1 = __importDefault(require("arg"));
|
31
|
+
const chalk_1 = __importDefault(require("chalk"));
|
32
|
+
const dcl_catalyst_client_1 = require("dcl-catalyst-client");
|
33
|
+
const contracts_snapshots_1 = require("dcl-catalyst-client/dist/contracts-snapshots");
|
34
|
+
const crypto_1 = require("@dcl/crypto");
|
35
|
+
const schemas_1 = require("@dcl/schemas");
|
36
|
+
const opn_1 = __importDefault(require("opn"));
|
37
|
+
const fetch_component_1 = require("@well-known-components/fetch-component");
|
38
|
+
const isTypescriptProject_1 = require("../project/isTypescriptProject");
|
39
|
+
const sceneJson_1 = require("../sceneJson");
|
40
|
+
const Decentraland_1 = require("../lib/Decentraland");
|
41
|
+
const spinner = __importStar(require("../utils/spinner"));
|
42
|
+
const logging_1 = require("../utils/logging");
|
43
|
+
const moduleHelpers_1 = require("../utils/moduleHelpers");
|
44
|
+
const analytics_1 = require("../utils/analytics");
|
45
|
+
const utils_1 = require("../sceneJson/utils");
|
46
|
+
const errors_1 = require("../utils/errors");
|
47
|
+
const help = () => `
|
48
|
+
Usage: ${chalk_1.default.bold('dcl build [options]')}
|
49
|
+
|
50
|
+
${chalk_1.default.dim('Options:')}
|
51
|
+
|
52
|
+
-h, --help Displays complete help
|
53
|
+
-p, --port [port] Select a custom port for the development server
|
54
|
+
-t, --target Specifies the address and port for the target catalyst server. Defaults to peer.decentraland.org
|
55
|
+
-t, --target-content Specifies the address and port for the target content server. Example: 'peer.decentraland.org/content'. Can't be set together with --target
|
56
|
+
-b, --no-browser Do not open a new browser window
|
57
|
+
--skip-version-checks Skip the ECS and CLI version checks, avoid the warning message and launch anyway
|
58
|
+
--skip-build Skip build before deploy
|
59
|
+
--skip-validations Skip permissions verifications on the client side when deploying content
|
60
|
+
--skip-file-size-check Skip check for maximum file size when deploying to a target content server. Must be used with --target-content
|
61
|
+
|
62
|
+
${chalk_1.default.dim('Example:')}
|
63
|
+
|
64
|
+
- Deploy your scene:
|
65
|
+
|
66
|
+
${chalk_1.default.green('$ dcl deploy')}
|
67
|
+
|
68
|
+
- Deploy your scene to a specific content server:
|
69
|
+
|
70
|
+
${chalk_1.default.green('$ dcl deploy --target my-favorite-catalyst-server.org:2323')}
|
71
|
+
`;
|
72
|
+
exports.help = help;
|
73
|
+
function failWithSpinner(message, error) {
|
74
|
+
spinner.fail(message);
|
75
|
+
(0, errors_1.fail)(errors_1.ErrorType.DEPLOY_ERROR, error);
|
76
|
+
}
|
77
|
+
exports.failWithSpinner = failWithSpinner;
|
78
|
+
async function main() {
|
79
|
+
var _a, _b, _c;
|
80
|
+
const args = (0, arg_1.default)({
|
81
|
+
'--help': Boolean,
|
82
|
+
'-h': '--help',
|
83
|
+
'--target': String,
|
84
|
+
'-t': '--target',
|
85
|
+
'--target-content': String,
|
86
|
+
'-tc': '--target-content',
|
87
|
+
'--skip-validations': Boolean,
|
88
|
+
'--skip-version-checks': Boolean,
|
89
|
+
'--skip-build': Boolean,
|
90
|
+
'--skip-file-size-check': Boolean,
|
91
|
+
'--https': Boolean,
|
92
|
+
'--force-upload': Boolean,
|
93
|
+
'--yes': Boolean,
|
94
|
+
'--no-browser': Boolean,
|
95
|
+
'-b': '--no-browser',
|
96
|
+
'--port': String,
|
97
|
+
'-p': '--port'
|
98
|
+
});
|
99
|
+
analytics_1.Analytics.sceneStartDeploy();
|
100
|
+
if (args['--target'] && args['--target-content']) {
|
101
|
+
throw new Error(`You can't set both the 'target' and 'target-content' arguments.`);
|
102
|
+
}
|
103
|
+
const workDir = process.cwd();
|
104
|
+
const skipVersionCheck = args['--skip-version-checks'];
|
105
|
+
const skipBuild = args['--skip-build'];
|
106
|
+
const skipFileSizeCheck = !!args['--skip-file-size-check'] && !!args['--target-content'];
|
107
|
+
const noBrowser = args['--no-browser'];
|
108
|
+
const port = args['--port'];
|
109
|
+
const parsedPort = typeof port === 'string' ? parseInt(port, 10) : void 0;
|
110
|
+
const linkerPort = parsedPort && Number.isInteger(parsedPort) ? parsedPort : void 0;
|
111
|
+
spinner.create('Creating deployment structure');
|
112
|
+
const dcl = new Decentraland_1.Decentraland({
|
113
|
+
isHttps: !!args['--https'],
|
114
|
+
workingDir: workDir,
|
115
|
+
forceDeploy: args['--force-upload'],
|
116
|
+
yes: args['--yes'],
|
117
|
+
// validations are skipped for custom content servers
|
118
|
+
skipValidations: !!args['--skip-validations'] || !!args['--target'] || !!args['--target-content'],
|
119
|
+
linkerPort
|
120
|
+
});
|
121
|
+
const project = dcl.workspace.getSingleProject();
|
122
|
+
if (!project) {
|
123
|
+
return failWithSpinner('Cannot deploy a workspace, please go to the project directory and run `dcl deploy` again there.');
|
124
|
+
}
|
125
|
+
if (!skipVersionCheck) {
|
126
|
+
await project.checkCLIandECSCompatibility();
|
127
|
+
}
|
128
|
+
spinner.create('Building scene in production mode');
|
129
|
+
if (!(await (0, isTypescriptProject_1.isTypescriptProject)(workDir))) {
|
130
|
+
failWithSpinner(`Please make sure that your project has a 'tsconfig.json' file.`);
|
131
|
+
}
|
132
|
+
if (!skipBuild) {
|
133
|
+
try {
|
134
|
+
await (0, moduleHelpers_1.buildTypescript)({
|
135
|
+
workingDir: workDir,
|
136
|
+
watch: false,
|
137
|
+
production: true,
|
138
|
+
silence: true
|
139
|
+
});
|
140
|
+
spinner.succeed('Scene built successfully');
|
141
|
+
}
|
142
|
+
catch (error) {
|
143
|
+
const message = 'Build /scene in production mode failed';
|
144
|
+
failWithSpinner(message, error);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
else {
|
148
|
+
spinner.succeed();
|
149
|
+
}
|
150
|
+
spinner.create('Creating deployment structure');
|
151
|
+
// Obtain list of files to deploy
|
152
|
+
const originalFilesToIgnore = (_a = (await project.getDCLIgnore())) !== null && _a !== void 0 ? _a : (await project.writeDclIgnore());
|
153
|
+
const filesToIgnorePlusEntityJson = originalFilesToIgnore.concat('\n entity.json');
|
154
|
+
const files = await project.getFiles({
|
155
|
+
ignoreFiles: filesToIgnorePlusEntityJson,
|
156
|
+
skipFileSizeCheck: skipFileSizeCheck
|
157
|
+
});
|
158
|
+
const contentFiles = new Map(files.map((file) => [file.path, file.content]));
|
159
|
+
// Create scene.json
|
160
|
+
const sceneJson = await (0, sceneJson_1.getSceneFile)(workDir);
|
161
|
+
const { entityId, files: entityFiles } = await dcl_catalyst_client_1.DeploymentBuilder.buildEntity({
|
162
|
+
type: schemas_1.EntityType.SCENE,
|
163
|
+
pointers: findPointers(sceneJson),
|
164
|
+
files: contentFiles,
|
165
|
+
metadata: sceneJson
|
166
|
+
});
|
167
|
+
spinner.succeed('Deployment structure created.');
|
168
|
+
// Validate scene.json
|
169
|
+
(0, utils_1.validateScene)(sceneJson, true);
|
170
|
+
dcl.on('link:ready', ({ url, params }) => {
|
171
|
+
console.log(chalk_1.default.bold('You need to sign the content before the deployment:'));
|
172
|
+
spinner.create(`Signing app ready at ${url}`);
|
173
|
+
if (!noBrowser) {
|
174
|
+
setTimeout(async () => {
|
175
|
+
try {
|
176
|
+
await (0, opn_1.default)(`${url}?${params}`);
|
177
|
+
}
|
178
|
+
catch (e) {
|
179
|
+
console.log(`Unable to open browser automatically`);
|
180
|
+
}
|
181
|
+
}, 5000);
|
182
|
+
}
|
183
|
+
dcl.on('link:success', ({ address, signature, chainId }) => {
|
184
|
+
spinner.succeed(`Content successfully signed.`);
|
185
|
+
console.log(`${chalk_1.default.bold('Address:')} ${address}`);
|
186
|
+
console.log(`${chalk_1.default.bold('Signature:')} ${signature}`);
|
187
|
+
console.log(`${chalk_1.default.bold('Network:')} ${(0, schemas_1.getChainName)(chainId)}`);
|
188
|
+
});
|
189
|
+
});
|
190
|
+
// Signing message
|
191
|
+
const messageToSign = entityId;
|
192
|
+
const { signature, address, chainId } = await dcl.getAddressAndSignature(messageToSign);
|
193
|
+
const authChain = crypto_1.Authenticator.createSimpleAuthChain(entityId, address, signature);
|
194
|
+
// Uploading data
|
195
|
+
let catalyst = null;
|
196
|
+
let url = '';
|
197
|
+
if (args['--target']) {
|
198
|
+
let target = args['--target'];
|
199
|
+
if (target.endsWith('/')) {
|
200
|
+
target = target.slice(0, -1);
|
201
|
+
}
|
202
|
+
catalyst = await (0, dcl_catalyst_client_1.createCatalystClient)({
|
203
|
+
url: target,
|
204
|
+
fetcher: (0, fetch_component_1.createFetchComponent)()
|
205
|
+
}).getContentClient();
|
206
|
+
url = target;
|
207
|
+
}
|
208
|
+
else if (args['--target-content']) {
|
209
|
+
const targetContent = args['--target-content'];
|
210
|
+
catalyst = (0, dcl_catalyst_client_1.createContentClient)({
|
211
|
+
url: targetContent,
|
212
|
+
fetcher: (0, fetch_component_1.createFetchComponent)()
|
213
|
+
});
|
214
|
+
url = targetContent;
|
215
|
+
}
|
216
|
+
else if (chainId === schemas_1.ChainId.ETHEREUM_SEPOLIA) {
|
217
|
+
catalyst = await (0, dcl_catalyst_client_1.createCatalystClient)({
|
218
|
+
url: 'peer.decentraland.zone',
|
219
|
+
fetcher: (0, fetch_component_1.createFetchComponent)()
|
220
|
+
}).getContentClient();
|
221
|
+
url = 'peer.decentraland.zone';
|
222
|
+
}
|
223
|
+
else {
|
224
|
+
const cachedCatalysts = (0, contracts_snapshots_1.getCatalystServersFromCache)('mainnet');
|
225
|
+
for (const cachedCatalyst of cachedCatalysts) {
|
226
|
+
const client = (0, dcl_catalyst_client_1.createCatalystClient)({
|
227
|
+
url: cachedCatalyst.address,
|
228
|
+
fetcher: (0, fetch_component_1.createFetchComponent)()
|
229
|
+
});
|
230
|
+
const { healthy, content: { publicUrl } } = await client.fetchAbout();
|
231
|
+
if (healthy) {
|
232
|
+
catalyst = await client.getContentClient();
|
233
|
+
url = publicUrl;
|
234
|
+
break;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
if (!catalyst) {
|
239
|
+
failWithSpinner('Could not find a up catalyst');
|
240
|
+
return;
|
241
|
+
}
|
242
|
+
spinner.create(`Uploading data to: ${url}`);
|
243
|
+
const deployData = { entityId, files: entityFiles, authChain };
|
244
|
+
const position = sceneJson.scene.base;
|
245
|
+
const network = chainId === schemas_1.ChainId.ETHEREUM_SEPOLIA ? 'sepolia' : 'mainnet';
|
246
|
+
const worldName = (_b = sceneJson.worldConfiguration) === null || _b === void 0 ? void 0 : _b.name;
|
247
|
+
const worldNameParam = worldName ? `&realm=${worldName}` : '';
|
248
|
+
const sceneUrl = `https://play.decentraland.org/?NETWORK=${network}&position=${position}&${worldNameParam}`;
|
249
|
+
try {
|
250
|
+
const response = (await catalyst.deploy(deployData, {
|
251
|
+
timeout: 600000
|
252
|
+
}));
|
253
|
+
project.setDeployInfo({ status: 'success' });
|
254
|
+
spinner.succeed(`Content uploaded. ${chalk_1.default.underline.bold(sceneUrl)}\n`);
|
255
|
+
const baseCoords = await dcl.workspace.getBaseCoords();
|
256
|
+
const parcelCount = await dcl.workspace.getParcelCount();
|
257
|
+
analytics_1.Analytics.sceneDeploySuccess({
|
258
|
+
projectHash: dcl.getProjectHash(),
|
259
|
+
ecs: await dcl.workspace.getSingleProject().getEcsPackageVersion(),
|
260
|
+
parcelCount: parcelCount,
|
261
|
+
coords: baseCoords,
|
262
|
+
isWorld: !!sceneJson.worldConfiguration,
|
263
|
+
sceneId: entityId,
|
264
|
+
targetContentServer: url,
|
265
|
+
worldName: (_c = sceneJson.worldConfiguration) === null || _c === void 0 ? void 0 : _c.name
|
266
|
+
});
|
267
|
+
if (response.message) {
|
268
|
+
console.log(response.message);
|
269
|
+
}
|
270
|
+
}
|
271
|
+
catch (error) {
|
272
|
+
(0, logging_1.debug)('\n' + error.stack);
|
273
|
+
failWithSpinner('Could not upload content', error);
|
274
|
+
}
|
275
|
+
}
|
276
|
+
exports.main = main;
|
277
|
+
function findPointers(sceneJson) {
|
278
|
+
return sceneJson.scene.parcels;
|
279
|
+
}
|
280
|
+
//# sourceMappingURL=deploy.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAqB;AACrB,kDAAyB;AACzB,6DAAiH;AACjH,sFAA0F;AAC1F,wCAA2C;AAC3C,0CAAgE;AAChE,8CAAqB;AACrB,4EAA6E;AAE7E,wEAAoE;AACpE,4CAA2C;AAC3C,sDAAkD;AAGlD,0DAA2C;AAC3C,8CAAwC;AACxC,0DAAwD;AACxD,kDAA8C;AAC9C,8CAAkD;AAClD,4CAAiD;AAE1C,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC;WACf,eAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC;;MAEtC,eAAK,CAAC,GAAG,CAAC,UAAU,CAAC;;;;;;;;;;;;MAYrB,eAAK,CAAC,GAAG,CAAC,UAAU,CAAC;;;;QAInB,eAAK,CAAC,KAAK,CAAC,cAAc,CAAC;;;;MAI7B,eAAK,CAAC,KAAK,CAAC,4DAA4D,CA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["../../src/commands/export.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,cAEhB,CAAA;AACD,wBAAsB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAK5C"}
|
@@ -0,0 +1,20 @@
|
|
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 = void 0;
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
8
|
+
const analytics_1 = require("../utils/analytics");
|
9
|
+
const help = () => `
|
10
|
+
${chalk_1.default.bold('dcl export')} was deprecated in 3.10.0 version of the Decentraland CLI.
|
11
|
+
`;
|
12
|
+
exports.help = help;
|
13
|
+
async function main() {
|
14
|
+
const link = 'https://docs.decentraland.org/development-guide/deploy-to-now/';
|
15
|
+
console.warn(`\`dcl export\` is not being supported in this CLI version. Please visit ${link} to more information`);
|
16
|
+
analytics_1.Analytics.tryToUseDeprecated({ command: 'export' });
|
17
|
+
return 1;
|
18
|
+
}
|
19
|
+
exports.main = main;
|
20
|
+
//# sourceMappingURL=export.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,kDAA8C;AAEvC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC;EACxB,eAAK,CAAC,IAAI,CAAC,YAAY,CAAC;CACzB,CAAA;AAFY,QAAA,IAAI,QAEhB;AACM,KAAK,UAAU,IAAI;IACxB,MAAM,IAAI,GAAG,gEAAgE,CAAA;IAC7E,OAAO,CAAC,IAAI,CAAC,2EAA2E,IAAI,sBAAsB,CAAC,CAAA;IACnH,qBAAS,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;IACnD,OAAO,CAAC,CAAA;AACV,CAAC;AALD,oBAKC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";AAAA,wBAeE"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = new Set([
|
4
|
+
'init',
|
5
|
+
'build',
|
6
|
+
'start',
|
7
|
+
'deploy',
|
8
|
+
'deploy-deprecated',
|
9
|
+
'info',
|
10
|
+
'status',
|
11
|
+
'help',
|
12
|
+
'export',
|
13
|
+
'pack',
|
14
|
+
'install',
|
15
|
+
'coords',
|
16
|
+
'world-acl',
|
17
|
+
'workspace'
|
18
|
+
]);
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";;AAAA,kBAAe,IAAI,GAAG,CAAS;IAC7B,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,mBAAmB;IACnB,MAAM;IACN,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,MAAM;IACN,SAAS;IACT,QAAQ;IACR,WAAW;IACX,WAAW;CACZ,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/commands/info.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,IAAI,cAuBhB,CAAA;AAmBD,wBAAsB,IAAI,kBAyFzB"}
|
@@ -0,0 +1,186 @@
|
|
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.main = exports.help = void 0;
|
30
|
+
const arg_1 = __importDefault(require("arg"));
|
31
|
+
const chalk_1 = __importDefault(require("chalk"));
|
32
|
+
const Decentraland_1 = require("../lib/Decentraland");
|
33
|
+
const logging_1 = require("../utils/logging");
|
34
|
+
const analytics_1 = require("../utils/analytics");
|
35
|
+
const coordinateHelpers_1 = require("../utils/coordinateHelpers");
|
36
|
+
const errors_1 = require("../utils/errors");
|
37
|
+
const land_1 = require("../utils/land");
|
38
|
+
const spinner = __importStar(require("../utils/spinner"));
|
39
|
+
const help = () => `
|
40
|
+
Usage: ${chalk_1.default.bold('dcl info [target] [options]')}
|
41
|
+
|
42
|
+
${chalk_1.default.dim('Options:')}
|
43
|
+
|
44
|
+
-h, --help Displays complete help
|
45
|
+
-b, --blockchain Retrieve information directly from the blockchain instead of Decentraland remote API
|
46
|
+
-n, --network Choose between ${chalk_1.default.bold('mainnet')} and ${chalk_1.default.bold('sepolia')} (default 'mainnet')
|
47
|
+
|
48
|
+
|
49
|
+
${chalk_1.default.dim('Examples:')}
|
50
|
+
|
51
|
+
- Get information from the ${chalk_1.default.bold('LAND')} located at "${chalk_1.default.bold('-12, 40')}"
|
52
|
+
|
53
|
+
${chalk_1.default.green('$ dcl info -12,40')}
|
54
|
+
|
55
|
+
- Get information from the ${chalk_1.default.bold('estate')} with ID "${chalk_1.default.bold('5')}" directly from blockchain provider
|
56
|
+
|
57
|
+
${chalk_1.default.green('$ dcl info 5 --blockchain')}
|
58
|
+
|
59
|
+
- Get information from the ${chalk_1.default.bold('address 0x8bed95d830475691c10281f1fea2c0a0fe51304b')}"
|
60
|
+
|
61
|
+
${chalk_1.default.green('$ dcl info 0x8bed95d830475691c10281f1fea2c0a0fe51304b')}
|
62
|
+
`;
|
63
|
+
exports.help = help;
|
64
|
+
function getTargetType(value) {
|
65
|
+
if ((0, coordinateHelpers_1.isValid)(value)) {
|
66
|
+
return 'parcel';
|
67
|
+
}
|
68
|
+
const id = parseInt(value, 10);
|
69
|
+
if (Number.isInteger(id) && id > 0) {
|
70
|
+
return 'estate';
|
71
|
+
}
|
72
|
+
if (value.startsWith('0x')) {
|
73
|
+
return 'address';
|
74
|
+
}
|
75
|
+
return '';
|
76
|
+
}
|
77
|
+
async function main() {
|
78
|
+
const args = (0, arg_1.default)({
|
79
|
+
'--help': Boolean,
|
80
|
+
'--blockchain': Boolean,
|
81
|
+
'--network': String,
|
82
|
+
'-h': '--help',
|
83
|
+
'-b': '--blockchain',
|
84
|
+
'-n': '--network'
|
85
|
+
}, { permissive: true });
|
86
|
+
if (!args._[1]) {
|
87
|
+
(0, errors_1.fail)(errors_1.ErrorType.INFO_ERROR, 'Please provide a target to retrieve data');
|
88
|
+
}
|
89
|
+
const target = (0, land_1.parseTarget)(args._);
|
90
|
+
(0, logging_1.debug)(`Parsed target: ${target}`);
|
91
|
+
const type = getTargetType(target);
|
92
|
+
if (!type) {
|
93
|
+
(0, errors_1.fail)(errors_1.ErrorType.INFO_ERROR, `Invalid target "${chalk_1.default.bold(target)}"`);
|
94
|
+
}
|
95
|
+
const dcl = new Decentraland_1.Decentraland({
|
96
|
+
blockchain: args['--blockchain'],
|
97
|
+
workingDir: process.cwd()
|
98
|
+
});
|
99
|
+
if (type === 'parcel') {
|
100
|
+
spinner.create(chalk_1.default.dim(`Fetching information for LAND ${target}`));
|
101
|
+
const coords = (0, coordinateHelpers_1.getObject)(target);
|
102
|
+
analytics_1.Analytics.infoCmd({ type: 'coordinates', target: coords });
|
103
|
+
const [estate, data] = await Promise.all([dcl.getEstateOfParcel(coords), dcl.getParcelInfo(coords)]);
|
104
|
+
const output = estate ? Object.assign(Object.assign({}, data), { estate }) : data;
|
105
|
+
spinner.succeed(`Fetched data for LAND ${chalk_1.default.bold(target)}`);
|
106
|
+
logParcel(output);
|
107
|
+
return;
|
108
|
+
}
|
109
|
+
if (type === 'estate') {
|
110
|
+
spinner.create(chalk_1.default.dim(`Fetching information for Estate ${target}`));
|
111
|
+
const estateId = parseInt(target, 10);
|
112
|
+
analytics_1.Analytics.infoCmd({ type: 'estate', target: estateId });
|
113
|
+
const estate = await dcl.getEstateInfo(estateId);
|
114
|
+
spinner.succeed(`Fetched data for Estate ${chalk_1.default.bold(target)}`);
|
115
|
+
logEstate(estate, estateId);
|
116
|
+
return;
|
117
|
+
}
|
118
|
+
spinner.create(chalk_1.default.dim(`Fetching information for address ${target}`));
|
119
|
+
analytics_1.Analytics.infoCmd({ type: 'address', target: target });
|
120
|
+
const { parcels, estates } = await dcl.getAddressInfo(target);
|
121
|
+
const formattedParcels = parcels.reduce((acc, parcel) => {
|
122
|
+
return Object.assign(Object.assign({}, acc), { [`${parcel.x},${parcel.y}`]: {
|
123
|
+
name: parcel.name,
|
124
|
+
description: parcel.description
|
125
|
+
} });
|
126
|
+
}, {});
|
127
|
+
const formattedEstates = estates.reduce((acc, estate) => {
|
128
|
+
return Object.assign(Object.assign({}, acc), { [`ID ${estate.id.toString()}`]: {
|
129
|
+
name: estate.name,
|
130
|
+
description: estate.description
|
131
|
+
} });
|
132
|
+
}, {});
|
133
|
+
spinner.succeed(`Fetched data for address ${chalk_1.default.bold(target)}`);
|
134
|
+
if (parcels.length === 0 && estates.length === 0) {
|
135
|
+
return console.log(chalk_1.default.italic('\n No information available\n'));
|
136
|
+
}
|
137
|
+
if (parcels.length !== 0) {
|
138
|
+
console.log(`\n LAND owned by ${target}:\n`);
|
139
|
+
console.log((0, logging_1.formatDictionary)(formattedParcels, { spacing: 2, padding: 2 }));
|
140
|
+
}
|
141
|
+
if (estates.length !== 0) {
|
142
|
+
console.log(`\n Estates owned by ${target}:\n`);
|
143
|
+
console.log((0, logging_1.formatDictionary)(formattedEstates, { spacing: 2, padding: 2 }));
|
144
|
+
}
|
145
|
+
}
|
146
|
+
exports.main = main;
|
147
|
+
function logParcel(output) {
|
148
|
+
console.log('\n Scene Metadata:\n');
|
149
|
+
if (output.scene) {
|
150
|
+
console.log((0, logging_1.formatDictionary)(output.scene, { spacing: 2, padding: 2 }));
|
151
|
+
}
|
152
|
+
else {
|
153
|
+
console.log(chalk_1.default.italic(' No information available\n'));
|
154
|
+
}
|
155
|
+
console.log(' LAND Metadata:\n');
|
156
|
+
if (output.land) {
|
157
|
+
console.log((0, logging_1.formatDictionary)(output.land, { spacing: 2, padding: 2 }));
|
158
|
+
}
|
159
|
+
else {
|
160
|
+
console.log(chalk_1.default.italic(' No information available\n'));
|
161
|
+
}
|
162
|
+
if (output.estate) {
|
163
|
+
logEstate(output.estate);
|
164
|
+
}
|
165
|
+
}
|
166
|
+
function logEstate(estate, id) {
|
167
|
+
if (!estate) {
|
168
|
+
console.log(chalk_1.default.italic(`\n Estate with ID ${id} doesn't exist\n`));
|
169
|
+
return;
|
170
|
+
}
|
171
|
+
if (estate.parcels.length === 0) {
|
172
|
+
console.log(chalk_1.default.bold(`\n Estate with ID ${id} has been dissolved\n`));
|
173
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
174
|
+
// @ts-ignore: TODO
|
175
|
+
delete estate.parcels;
|
176
|
+
}
|
177
|
+
console.log(' Estate Metadata:\n');
|
178
|
+
if (estate) {
|
179
|
+
const estateInfo = Object.assign(Object.assign({}, estate), { parcels: singleLineParcels(estate.parcels) });
|
180
|
+
console.log((0, logging_1.formatDictionary)(estateInfo, { spacing: 2, padding: 2 }));
|
181
|
+
}
|
182
|
+
}
|
183
|
+
function singleLineParcels(parcels) {
|
184
|
+
return parcels.map(coordinateHelpers_1.getString).join('; ');
|
185
|
+
}
|
186
|
+
//# sourceMappingURL=info.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/commands/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAqB;AACrB,kDAAyB;AAEzB,sDAA0E;AAC1E,8CAA0D;AAC1D,kDAA8C;AAC9C,kEAA0E;AAC1E,4CAAiD;AACjD,wCAA2C;AAC3C,0DAA2C;AAEpC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC;WACf,eAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC;;MAE9C,eAAK,CAAC,GAAG,CAAC,UAAU,CAAC;;;;iDAIsB,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC;;;MAG7F,eAAK,CAAC,GAAG,CAAC,WAAW,CAAC;;iCAEK,eAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC;;QAEhF,eAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC;;iCAEP,eAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC;;QAEzE,eAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC;;iCAEf,eAAK,CAAC,IAAI,CAAC,oDAAoD,CA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AAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAA;KAC5D;IAED,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;KACzB;AACH,CAAC;AAED,SAAS,SAAS,CAAC,MAAe,EAAE,EAAW;IAC7C,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAAC,CAAA;QACrE,OAAM;KACP;IAED,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,CAAC,CAAA;QACxE,6DAA6D;QAC7D,mBAAmB;QACnB,OAAO,MAAM,CAAC,OAAO,CAAA;KACtB;IAED,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;IAEnC,IAAI,MAAM,EAAE;QACV,MAAM,UAAU,mCAAQ,MAAM,KAAE,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,GAAE,CAAA;QAC5E,OAAO,CAAC,GAAG,CAAC,IAAA,0BAAgB,EAAC,UAAU,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;KACtE;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAY;IACrC,OAAO,OAAO,CAAC,GAAG,CAAC,6BAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC1C,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import arg from 'arg';
|
2
|
+
export declare const args: arg.Result<{
|
3
|
+
'--help': BooleanConstructor;
|
4
|
+
'--project': StringConstructor;
|
5
|
+
'--template': StringConstructor;
|
6
|
+
'--skip-install': BooleanConstructor;
|
7
|
+
'-h': string;
|
8
|
+
'-p': string;
|
9
|
+
'-t': string;
|
10
|
+
}>;
|
11
|
+
export declare const help: () => string;
|
12
|
+
//# sourceMappingURL=help.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/commands/init/help.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAIrB,eAAO,MAAM,IAAI;;;;;;;;EAQf,CAAA;AAEF,eAAO,MAAM,IAAI,cAoBhB,CAAA"}
|
@@ -0,0 +1,41 @@
|
|
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.help = exports.args = void 0;
|
7
|
+
const arg_1 = __importDefault(require("arg"));
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
9
|
+
const utils_1 = require("./utils");
|
10
|
+
exports.args = (0, arg_1.default)({
|
11
|
+
'--help': Boolean,
|
12
|
+
'--project': String,
|
13
|
+
'--template': String,
|
14
|
+
'--skip-install': Boolean,
|
15
|
+
'-h': '--help',
|
16
|
+
'-p': '--project',
|
17
|
+
'-t': '--template'
|
18
|
+
});
|
19
|
+
const help = () => `
|
20
|
+
Usage: ${chalk_1.default.bold('dcl init [options]')}
|
21
|
+
|
22
|
+
${chalk_1.default.dim('Options:')}
|
23
|
+
|
24
|
+
-h, --help Displays complete help
|
25
|
+
-p, --project [type] Choose a projectType (default is scene). It could be any of ${chalk_1.default.bold((0, utils_1.getProjectTypes)())}
|
26
|
+
|
27
|
+
${chalk_1.default.dim('Examples:')}
|
28
|
+
|
29
|
+
- Generate a new Decentraland Scene project in my-project folder
|
30
|
+
|
31
|
+
${chalk_1.default.green('$ dcl init my-project')}
|
32
|
+
|
33
|
+
- Generate a new scene project
|
34
|
+
|
35
|
+
${chalk_1.default.green('$ dcl init --project scene')}
|
36
|
+
|
37
|
+
--skip-install Skip installing dependencies
|
38
|
+
--template The URL to a template. It must be under the decentraland or decentraland-scenes GitHub organization.
|
39
|
+
`;
|
40
|
+
exports.help = help;
|
41
|
+
//# sourceMappingURL=help.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../../src/commands/init/help.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,kDAAyB;AACzB,mCAAyC;AAE5B,QAAA,IAAI,GAAG,IAAA,aAAG,EAAC;IACtB,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE,MAAM;IACnB,YAAY,EAAE,MAAM;IACpB,gBAAgB,EAAE,OAAO;IACzB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,YAAY;CACnB,CAAC,CAAA;AAEK,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC;WACf,eAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC;;MAErC,eAAK,CAAC,GAAG,CAAC,UAAU,CAAC;;;uFAG4D,eAAK,CAAC,IAAI,CAAC,IAAA,uBAAe,GAAE,CAAC;;QAE5G,eAAK,CAAC,GAAG,CAAC,WAAW,CAAC;;;;QAItB,eAAK,CAAC,KAAK,CAAC,uBAAuB,CAAC;;;;QAIpC,eAAK,CAAC,KAAK,CAAC,4BAA4B,CAAC;;;;CAIhD,CAAA;AApBY,QAAA,IAAI,QAoBhB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,wBAAsB,IAAI,kBA2DzB"}
|